228,7 → 228,7 |
waitq_sleep(&THREAD->go_wq); |
} |
|
void udebug_new_thread_event(struct thread *t) |
void udebug_thread_b_event(struct thread *t) |
{ |
call_t *call; |
ipl_t ipl; |
236,7 → 236,7 |
ipl = interrupts_disable(); |
spinlock_lock(&THREAD->debug_lock); |
|
klog_printf("udebug_new_thread_event"); |
klog_printf("udebug_thread_b_event"); |
klog_printf("- check state"); |
|
/* Must only generate events when in debugging session */ |
253,7 → 253,7 |
|
call = THREAD->debug_go_call; |
IPC_SET_RETVAL(call->data, 0); |
IPC_SET_ARG1(call->data, UDEBUG_EVENT_NEW_THREAD); |
IPC_SET_ARG1(call->data, UDEBUG_EVENT_THREAD_B); |
IPC_SET_ARG2(call->data, (unative_t)t); |
|
/* |
263,7 → 263,7 |
*/ |
THREAD->debug_stop = true; |
|
THREAD->cur_event = UDEBUG_EVENT_NEW_THREAD; |
THREAD->cur_event = UDEBUG_EVENT_THREAD_B; |
spinlock_unlock(&THREAD->debug_lock); |
|
spinlock_lock(&TASK->lock); |
276,6 → 276,54 |
waitq_sleep(&THREAD->go_wq); |
} |
|
void udebug_thread_e_event(void) |
{ |
call_t *call; |
ipl_t ipl; |
|
ipl = interrupts_disable(); |
spinlock_lock(&THREAD->debug_lock); |
|
klog_printf("udebug_thread_e_event"); |
klog_printf("- check state"); |
|
/* Must only generate events when in debugging session */ |
if (THREAD->debug_active != true) { |
klog_printf("- debug_active: %s, debug_stop: %s", |
THREAD->debug_active ? "yes(+)" : "no(-)", |
THREAD->debug_stop ? "yes(-)" : "no(+)"); |
spinlock_unlock(&THREAD->debug_lock); |
interrupts_restore(ipl); |
return; |
} |
|
klog_printf("- trigger event"); |
|
call = THREAD->debug_go_call; |
IPC_SET_RETVAL(call->data, 0); |
IPC_SET_ARG1(call->data, UDEBUG_EVENT_THREAD_E); |
|
/* |
* Make sure debug_stop is true when going to sleep |
* in case we get woken up by DEBUG_END. (At which |
* point it must be back to the initial true value). |
*/ |
THREAD->debug_stop = true; |
|
THREAD->cur_event = UDEBUG_EVENT_THREAD_E; |
spinlock_unlock(&THREAD->debug_lock); |
|
spinlock_lock(&TASK->lock); |
ipc_answer(&TASK->answerbox, THREAD->debug_go_call); |
spinlock_unlock(&TASK->lock); |
|
interrupts_restore(ipl); |
klog_printf("- sleep"); |
|
waitq_sleep(&THREAD->go_wq); |
} |
|
|
/** |
* Terminate task debugging session. |
* |