summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/libdebugger/rtems-debugger-target.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cpukit/libdebugger/rtems-debugger-target.c b/cpukit/libdebugger/rtems-debugger-target.c
index e4951701e9..bf7579700d 100644
--- a/cpukit/libdebugger/rtems-debugger-target.c
+++ b/cpukit/libdebugger/rtems-debugger-target.c
@@ -171,17 +171,19 @@ int
rtems_debugger_target_swbreak_control(bool insert, DB_UINT addr, DB_UINT kind)
{
rtems_debugger_target* target = rtems_debugger->target;
- rtems_debugger_target_swbreak* swbreaks = target->swbreaks.block;
+ rtems_debugger_target_swbreak* swbreaks;
size_t swbreak_size;
uint8_t* loc = (void*) addr;
size_t i;
int r;
- if (target == NULL || swbreaks == NULL || kind != target->breakpoint_size) {
+ if (target == NULL || target->swbreaks.block == NULL ||
+ kind != target->breakpoint_size) {
errno = EIO;
return -1;
}
+ swbreaks = target->swbreaks.block;
swbreak_size =
sizeof(rtems_debugger_target_swbreak) + target->breakpoint_size;