Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2917 → Rev 2918

/branches/tracing/kernel/generic/src/udebug/udebug.c
329,7 → 329,52
/* This event does not sleep - debugging has finished in this thread */
}
 
void udebug_breakpoint_event(uintptr_t addr)
{
call_t *call;
ipl_t ipl;
udebug_event_t etype;
 
etype = UDEBUG_EVENT_BREAKPOINT;
 
ipl = interrupts_disable();
spinlock_lock(&THREAD->debug_lock);
 
/* Must only generate events when in debugging session and have go */
if (THREAD->debug_active != true ||
THREAD->debug_stop == true ||
(TASK->debug_evmask & UDEBUG_EVMASK(etype)) == 0) {
spinlock_unlock(&THREAD->debug_lock);
interrupts_restore(ipl);
return;
}
 
klog_printf("udebug_breakpoint_event");
call = THREAD->debug_go_call;
IPC_SET_RETVAL(call->data, 0);
IPC_SET_ARG1(call->data, etype);
IPC_SET_ARG2(call->data, addr);
 
/*
* 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 = etype;
spinlock_unlock(&THREAD->debug_lock);
klog_printf("- send answer");
 
spinlock_lock(&TASK->lock);
ipc_answer(&TASK->answerbox, THREAD->debug_go_call);
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
 
udebug_wait_for_go(&THREAD->go_wq);
}
 
 
/**
* Terminate task debugging session.
*