Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2824 → Rev 2825

/branches/tracing/kernel/generic/src/udebug/udebug.c
24,13 → 24,13
nsc = --TASK->not_stoppable_count;
db_call = TASK->debug_begin_call;
 
if (TASK->stop_request == true) {
if (TASK->dt_state == UDEBUG_TS_BEGINNING) {
klog_printf("udebug_stoppable_begin");
klog_printf(" - nsc := %d", nsc);
}
 
if (TASK->stop_request == true && nsc == 0) {
TASK->stop_request = false;
if (TASK->dt_state == UDEBUG_TS_BEGINNING && nsc == 0) {
TASK->dt_state = UDEBUG_TS_ACTIVE;
TASK->debug_begin_call = NULL;
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
52,7 → 52,9
ipl = interrupts_disable();
spinlock_lock(&TASK->lock);
 
if (TASK->stop_request) {
if ((TASK->dt_state == UDEBUG_TS_BEGINNING ||
TASK->dt_state == UDEBUG_TS_ACTIVE) &&
THREAD->debug_stop == true) {
TASK->debug_begin_call = NULL;
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
77,8 → 79,7
ipl = interrupts_disable();
spinlock_lock(&TASK->lock);
 
/* being debugged + have go */
if (TASK->being_debugged && !TASK->stop_request) {
if (TASK->dt_state == UDEBUG_TS_ACTIVE) {
klog_printf("udebug_syscall_event");
call = TASK->debug_go_call;
IPC_SET_RETVAL(call->data, 0);
94,6 → 95,13
THREAD->syscall_args[4] = a5;
THREAD->syscall_args[5] = a6;
 
/*
* 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;
 
ipc_answer(&TASK->answerbox, TASK->debug_go_call);
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);