Rev 2918 | Rev 3014 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2918 | Rev 2921 | ||
---|---|---|---|
Line 327... | Line 327... | ||
327 | interrupts_restore(ipl); |
327 | interrupts_restore(ipl); |
328 | 328 | ||
329 | /* This event does not sleep - debugging has finished in this thread */ |
329 | /* This event does not sleep - debugging has finished in this thread */ |
330 | } |
330 | } |
331 | 331 | ||
332 | void udebug_breakpoint_event(uintptr_t addr) |
332 | static void breakpoint_trap_event(uintptr_t addr, udebug_event_t etype) |
333 | { |
333 | { |
334 | call_t *call; |
334 | call_t *call; |
335 | ipl_t ipl; |
335 | ipl_t ipl; |
336 | udebug_event_t etype; |
- | |
337 | - | ||
338 | etype = UDEBUG_EVENT_BREAKPOINT; |
- | |
339 | 336 | ||
340 | ipl = interrupts_disable(); |
337 | ipl = interrupts_disable(); |
341 | spinlock_lock(&THREAD->debug_lock); |
338 | spinlock_lock(&THREAD->debug_lock); |
342 | 339 | ||
343 | /* Must only generate events when in debugging session and have go */ |
340 | /* Must only generate events when in debugging session and have go */ |
Line 347... | Line 344... | ||
347 | spinlock_unlock(&THREAD->debug_lock); |
344 | spinlock_unlock(&THREAD->debug_lock); |
348 | interrupts_restore(ipl); |
345 | interrupts_restore(ipl); |
349 | return; |
346 | return; |
350 | } |
347 | } |
351 | 348 | ||
352 | klog_printf("udebug_breakpoint_event"); |
349 | klog_printf("udebug_breakpoint/trap_event"); |
353 | call = THREAD->debug_go_call; |
350 | call = THREAD->debug_go_call; |
354 | IPC_SET_RETVAL(call->data, 0); |
351 | IPC_SET_RETVAL(call->data, 0); |
355 | IPC_SET_ARG1(call->data, etype); |
352 | IPC_SET_ARG1(call->data, etype); |
356 | IPC_SET_ARG2(call->data, addr); |
353 | IPC_SET_ARG2(call->data, addr); |
357 | 354 | ||
Line 372... | Line 369... | ||
372 | interrupts_restore(ipl); |
369 | interrupts_restore(ipl); |
373 | 370 | ||
374 | udebug_wait_for_go(&THREAD->go_wq); |
371 | udebug_wait_for_go(&THREAD->go_wq); |
375 | } |
372 | } |
376 | 373 | ||
- | 374 | void udebug_breakpoint_event(uintptr_t addr) |
|
- | 375 | { |
|
- | 376 | breakpoint_trap_event(addr, UDEBUG_EVENT_BREAKPOINT); |
|
- | 377 | } |
|
- | 378 | ||
- | 379 | void udebug_trap_event(uintptr_t addr) |
|
- | 380 | { |
|
- | 381 | breakpoint_trap_event(addr, UDEBUG_EVENT_TRAP); |
|
- | 382 | } |
|
377 | 383 | ||
378 | /** |
384 | /** |
379 | * Terminate task debugging session. |
385 | * Terminate task debugging session. |
380 | * |
386 | * |
381 | * \param ta Must be already locked and interrupts must be disabled. |
387 | * \param ta Must be already locked and interrupts must be disabled. |