Ignore:
Timestamp:
2008-09-19T19:09:06Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d93a1c5a
Parents:
d1c8287
Message:

Document functions in udebug.c and udebug_ops.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/udebug/udebug_ops.c

    rd1c8287 r7dc62af  
    3434 * @file
    3535 * @brief       Udebug operations.
     36 *
     37 * Udebug operations on tasks and threads are implemented here. The
     38 * functions defined here are called from the udebug_ipc module
     39 * when servicing udebug IPC messages.
    3640 */
    3741 
     
    6670 * the t->lock spinlock to the t->udebug.lock mutex.
    6771 *
     72 * @param t             Pointer, need not at all be valid.
     73 * @param having_go     Required thread state.
     74 *
    6875 * Returns EOK if all went well, or an error code otherwise.
    6976 */
     
    147154}
    148155
    149 
     156/** End debugging operation on a thread. */
    150157static void _thread_op_end(thread_t *t)
    151158{
     
    153160}
    154161
    155 /**
    156  * \return 0 (ok, but not done yet), 1 (done) or negative error code.
     162/** Begin debugging the current task.
     163 *
     164 * Initiates a debugging session for the current task (and its threads).
     165 * When the debugging session has started a reply will be sent to the
     166 * UDEBUG_BEGIN call. This may happen immediately in this function if
     167 * all the threads in this task are stoppable at the moment and in this
     168 * case the function returns 1.
     169 *
     170 * Otherwise the function returns 0 and the reply will be sent as soon as
     171 * all the threads become stoppable (i.e. they can be considered stopped).
     172 *
     173 * @param call  The BEGIN call we are servicing.
     174 * @return      0 (OK, but not done yet), 1 (done) or negative error code.
    157175 */
    158176int udebug_begin(call_t *call)
     
    206224}
    207225
     226/** Finish debugging the current task.
     227 *
     228 * Closes the debugging session for the current task.
     229 * @return Zero on success or negative error code.
     230 */
    208231int udebug_end(void)
    209232{
     
    222245}
    223246
     247/** Set the event mask.
     248 *
     249 * Sets the event mask that determines which events are enabled.
     250 *
     251 * @param mask  Or combination of events that should be enabled.
     252 * @return      Zero on success or negative error code.
     253 */
    224254int udebug_set_evmask(udebug_evmask_t mask)
    225255{
     
    242272}
    243273
    244 
     274/** Give thread GO.
     275 *
     276 * Upon recieving a go message, the thread is given GO. Having GO
     277 * means the thread is allowed to execute userspace code (until
     278 * a debugging event or STOP occurs, at which point the thread loses GO.
     279 *
     280 * @param t     The thread to operate on (unlocked and need not be valid).
     281 * @param call  The GO call that we are servicing.
     282 */
    245283int udebug_go(thread_t *t, call_t *call)
    246284{
     
    267305}
    268306
     307/** Stop a thread (i.e. take its GO away)
     308 *
     309 * Generates a STOP event as soon as the thread becomes stoppable (i.e.
     310 * can be considered stopped).
     311 *
     312 * @param t     The thread to operate on (unlocked and need not be valid).
     313 * @param call  The GO call that we are servicing.
     314 */
    269315int udebug_stop(thread_t *t, call_t *call)
    270316{
     
    316362}
    317363
     364/** Read the list of userspace threads in the current task.
     365 *
     366 * The list takes the form of a sequence of thread hashes (i.e. the pointers
     367 * to thread structures). A buffer of size @a buf_size is allocated and
     368 * a pointer to it written to @a buffer. The sequence of hashes is written
     369 * into this buffer.
     370 *
     371 * If the sequence is longer than @a buf_size bytes, only as much hashes
     372 * as can fit are copied. The number of thread hashes copied is stored
     373 * in @a n.
     374 *
     375 * The rationale for having @a buf_size is that this function is only
     376 * used for servicing the THREAD_READ message, which always specifies
     377 * a maximum size for the userspace buffer.
     378 *
     379 * @param buffer        The buffer for storing thread hashes.
     380 * @param buf_size      Buffer size in bytes.
     381 * @param n             The actual number of hashes copied will be stored here.
     382 */
    318383int udebug_thread_read(void **buffer, size_t buf_size, size_t *n)
    319384{
     
    377442}
    378443
     444/** Read the arguments of a system call.
     445 *
     446 * The arguments of the system call being being executed are copied
     447 * to an allocated buffer and a pointer to it is written to @a buffer.
     448 * The size of the buffer is exactly such that it can hold the maximum number
     449 * of system-call arguments.
     450 *
     451 * Unless the thread is currently blocked in a SYSCALL_B or SYSCALL_E event,
     452 * this function will fail with an EINVAL error code.
     453 *
     454 * @param buffer        The buffer for storing thread hashes.
     455 */
    379456int udebug_args_read(thread_t *t, void **buffer)
    380457{
     
    407484}
    408485
     486/** Read the memory of the debugged task.
     487 *
     488 * Reads @a n bytes from the address space of the debugged task, starting
     489 * from @a uspace_addr. The bytes are copied into an allocated buffer
     490 * and a pointer to it is written into @a buffer.
     491 *
     492 * @param uspace_addr   Address from where to start reading.
     493 * @param n             Number of bytes to read.
     494 * @param buffer        For storing a pointer to the allocated buffer.
     495 */
    409496int udebug_mem_read(unative_t uspace_addr, size_t n, void **buffer)
    410497{
Note: See TracChangeset for help on using the changeset viewer.