Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2901 → Rev 2902

/branches/tracing/kernel/generic/src/udebug/udebug.c
47,11 → 47,13
call_t *db_call, *go_call;
ipl_t ipl;
 
ASSERT(THREAD);
ASSERT(TASK);
 
ipl = interrupts_disable();
spinlock_lock(&TASK->lock);
 
nsc = --TASK->not_stoppable_count;
db_call = TASK->debug_begin_call;
 
if (TASK->dt_state == UDEBUG_TS_BEGINNING) {
klog_printf("udebug_stoppable_begin");
64,6 → 66,9
* DEBUG_BEGIN call.
*/
 
db_call = TASK->debug_begin_call;
ASSERT(db_call);
 
/* Lock order OK, THREAD->debug_lock is after TASK->lock */
spinlock_lock(&THREAD->debug_lock);
THREAD->debug_stoppable = true;
87,7 → 92,7
spinlock_lock(&THREAD->debug_lock);
THREAD->debug_stoppable = true;
 
if (THREAD->debug_stop) {
if (THREAD->debug_active && THREAD->debug_stop) {
/*
* Thread was requested to stop - answer go call
*/
95,6 → 100,7
/* Make sure nobody takes this call away from us */
go_call = THREAD->debug_go_call;
THREAD->debug_go_call = NULL;
ASSERT(go_call);
 
IPC_SET_RETVAL(go_call->data, 0);
IPC_SET_ARG1(go_call->data, UDEBUG_EVENT_STOP);
145,8 → 151,7
klog_printf("debug_stop=%d", THREAD->debug_stop);
}
 
if ((TASK->dt_state == UDEBUG_TS_BEGINNING ||
TASK->dt_state == UDEBUG_TS_ACTIVE) &&
if (THREAD->debug_active &&
THREAD->debug_stop == true) {
TASK->debug_begin_call = NULL;
spinlock_unlock(&THREAD->debug_lock);