Ignore:
File:
1 edited

Legend:

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

    rb2a1fd92 r44a7ee5  
    4646#include <errno.h>
    4747#include <print.h>
    48 #include <stdbool.h>
    4948#include <str.h>
    5049#include <syscall/copy.h>
     
    158157 *
    159158 * Initiates a debugging session for the current task (and its threads).
    160  * When the debugging session has started a reply should be sent to the
     159 * When the debugging session has started a reply will be sent to the
    161160 * UDEBUG_BEGIN call. This may happen immediately in this function if
    162161 * all the threads in this task are stoppable at the moment and in this
    163  * case the function sets @a *active to @c true.
    164  *
    165  * Otherwise the function sets @a *active to false and the resonse should
    166  * be sent as soon as all the threads become stoppable (i.e. they can be
    167  * considered stopped).
     162 * case the function returns 1.
     163 *
     164 * Otherwise the function returns 0 and the reply will be sent as soon as
     165 * all the threads become stoppable (i.e. they can be considered stopped).
    168166 *
    169167 * @param call The BEGIN call we are servicing.
    170  * @param active Place to store @c true iff we went directly to active state,
    171  *               @c false if we only went to beginning state
    172  *
    173  * @return EOK on success, EBUSY if the task is already has an active
    174  *         debugging session.
    175  */
    176 int udebug_begin(call_t *call, bool *active)
     168 *
     169 * @return 0 (OK, but not done yet), 1 (done) or negative error code.
     170 *
     171 */
     172int udebug_begin(call_t *call)
    177173{
    178174        LOG("Debugging task %" PRIu64, TASK->taskid);
     
    189185        TASK->udebug.debugger = call->sender;
    190186       
     187        int reply;
     188       
    191189        if (TASK->udebug.not_stoppable_count == 0) {
    192190                TASK->udebug.dt_state = UDEBUG_TS_ACTIVE;
    193191                TASK->udebug.begin_call = NULL;
    194                 *active = true;  /* directly to active state */
     192                reply = 1;  /* immediate reply */
    195193        } else
    196                 *active = false;  /* only in beginning state */
     194                reply = 0;  /* no reply */
    197195       
    198196        /* Set udebug.active on all of the task's userspace threads. */
     
    209207       
    210208        mutex_unlock(&TASK->udebug.lock);
    211         return EOK;
     209        return reply;
    212210}
    213211
Note: See TracChangeset for help on using the changeset viewer.