forked from Imagelibrary/rtems
cpukit/libdebugger: Add pure swbreak capability
Add a capability that allows for implementations that operate purely using software breaks. Due to this implementation method, software breaks must not be restored until just before returning control to the thread itself and will be handled by the implementation through thread switch and interrupt hooks.
This commit is contained in:
committed by
Joel Sherrill
parent
924993a4bc
commit
ea1a4fd29b
@@ -49,9 +49,17 @@ extern "C" {
|
||||
/**
|
||||
* Target capabilities mask.
|
||||
*/
|
||||
#define RTEMS_DEBUGGER_TARGET_CAP_SWBREAK (1 << 0)
|
||||
#define RTEMS_DEBUGGER_TARGET_CAP_HWBREAK (1 << 1)
|
||||
#define RTEMS_DEBUGGER_TARGET_CAP_HWWATCH (1 << 2)
|
||||
#define RTEMS_DEBUGGER_TARGET_CAP_SWBREAK (1 << 0)
|
||||
#define RTEMS_DEBUGGER_TARGET_CAP_HWBREAK (1 << 1)
|
||||
#define RTEMS_DEBUGGER_TARGET_CAP_HWWATCH (1 << 2)
|
||||
/*
|
||||
* This target capability indicates that the target implementation uses a pure
|
||||
* software break implementation which must not allow breakpoints to be
|
||||
* inserted before the actual switch to the thread, be it in interrupt context
|
||||
* or otherwise. Such implementations must necessarily implement a thread
|
||||
* switch hook and interrupt hooks to handle these situations.
|
||||
*/
|
||||
#define RTEMS_DEBUGGER_TARGET_CAP_PURE_SWBREAK (1 << 3)
|
||||
|
||||
/**
|
||||
* Types of hardware breakpoints.
|
||||
|
||||
@@ -355,9 +355,11 @@ rtems_debugger_thread_system_resume(bool detaching)
|
||||
current = rtems_debugger_thread_current(threads);
|
||||
if (current != NULL) {
|
||||
size_t i;
|
||||
rtems_debugger_target* target = rtems_debugger->target;
|
||||
if (rtems_debugger_verbose())
|
||||
rtems_debugger_printf("rtems-db: sys: : resuming\n");
|
||||
if (!detaching) {
|
||||
if (!detaching
|
||||
&& (target->capabilities & RTEMS_DEBUGGER_TARGET_CAP_PURE_SWBREAK) == 0) {
|
||||
r = rtems_debugger_target_swbreak_insert();
|
||||
if (r == 0)
|
||||
r = rtems_debugger_target_hwbreak_insert();
|
||||
|
||||
Reference in New Issue
Block a user