Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2920 → Rev 2921

/branches/tracing/kernel/generic/include/udebug/udebug.h
145,7 → 145,8
UDEBUG_EVENT_SYSCALL_E, /**< After finishing syscall execution */
UDEBUG_EVENT_THREAD_B, /**< The task created a new thread */
UDEBUG_EVENT_THREAD_E, /**< A thread exited */
UDEBUG_EVENT_BREAKPOINT /**< Breakpoint instruction executed */
UDEBUG_EVENT_BREAKPOINT, /**< Breakpoint instruction executed */
UDEBUG_EVENT_TRAP /**< Single-step trap */
} udebug_event_t;
 
#define UDEBUG_EVMASK(event) (1 << ((event) - 1))
158,6 → 159,7
UDEBUG_EM_THREAD_B = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B),
UDEBUG_EM_THREAD_E = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E),
UDEBUG_EM_BREAKPOINT = UDEBUG_EVMASK(UDEBUG_EVENT_BREAKPOINT),
UDEBUG_EM_TRAP = UDEBUG_EVMASK(UDEBUG_EVENT_TRAP),
UDEBUG_EM_ALL =
UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED) |
UDEBUG_EVMASK(UDEBUG_EVENT_STOP) |
165,7 → 167,8
UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E) |
UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B) |
UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E) |
UDEBUG_EVMASK(UDEBUG_EVENT_BREAKPOINT)
UDEBUG_EVMASK(UDEBUG_EVENT_BREAKPOINT) |
UDEBUG_EVMASK(UDEBUG_EVENT_TRAP)
} udebug_evmask_t;
 
#ifdef KERNEL
195,6 → 198,7
void udebug_stoppable_end(void);
 
void udebug_breakpoint_event(uintptr_t addr);
void udebug_trap_event(uintptr_t addr);
 
int udebug_task_cleanup(struct task *ta);
 
/branches/tracing/kernel/generic/src/udebug/udebug.c
329,14 → 329,11
/* This event does not sleep - debugging has finished in this thread */
}
 
void udebug_breakpoint_event(uintptr_t addr)
static void breakpoint_trap_event(uintptr_t addr, udebug_event_t etype)
{
call_t *call;
ipl_t ipl;
udebug_event_t etype;
 
etype = UDEBUG_EVENT_BREAKPOINT;
 
ipl = interrupts_disable();
spinlock_lock(&THREAD->debug_lock);
 
349,7 → 346,7
return;
}
 
klog_printf("udebug_breakpoint_event");
klog_printf("udebug_breakpoint/trap_event");
call = THREAD->debug_go_call;
IPC_SET_RETVAL(call->data, 0);
IPC_SET_ARG1(call->data, etype);
374,7 → 371,16
udebug_wait_for_go(&THREAD->go_wq);
}
 
void udebug_breakpoint_event(uintptr_t addr)
{
breakpoint_trap_event(addr, UDEBUG_EVENT_BREAKPOINT);
}
 
void udebug_trap_event(uintptr_t addr)
{
breakpoint_trap_event(addr, UDEBUG_EVENT_TRAP);
}
 
/**
* Terminate task debugging session.
*