summaryrefslogtreecommitdiff
path: root/Debugger/debug_macros.h
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-07-08 16:08:47 +0800
committerTat-Chee Wan (USM)2011-07-08 16:08:47 +0800
commit08c4d9c38bebc5689d0677431ef59cf45c4b5714 (patch)
treeebf59cd0e4f35138f5af75fed5bf0de7439db77b /Debugger/debug_macros.h
parent37faf49dcde68185b86c9d2ab3239428b461c5b7 (diff)
code cleanup, fix breakpoint handling logic on entry to debugger
When any Breakpoint is triggered, we must restore all active breakpoints. Otherwise, in the case where Normal Breakpoints are active and we encounter a Manual Breakpoint, the Normal Breakpoint will be left dangling (and eventually the breakpoint will be cleared by GDB, destroying the original instruction opcode).
Diffstat (limited to 'Debugger/debug_macros.h')
-rw-r--r--Debugger/debug_macros.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/Debugger/debug_macros.h b/Debugger/debug_macros.h
index e3208b4..3a60677 100644
--- a/Debugger/debug_macros.h
+++ b/Debugger/debug_macros.h
@@ -377,18 +377,27 @@
.endm
/* _dbg_set_bkpt_type
+ * Set Breakpoint Type using value in reg
+ * On exit:
+ * reg: destroyed
+ * r1: destroyed
+ */
+ .macro _dbg_set_bkpt_type reg
+ ldr r1, =debug_bkpt_type
+ strb \reg, [r1]
+ .endm
+
+/* _dbg_set_bkpt_type_val
* Set Breakpoint Type to given value
* On exit:
* r0, r1: destroyed
*/
- .macro _dbg_set_bkpt_type bkpt_type
+ .macro _dbg_set_bkpt_type_val bkpt_type
mov r0, #\bkpt_type
ldr r1, =debug_bkpt_type
strb r0, [r1]
.endm
-
-
/* _dbg_getcurrbkpt_index
* Get current breakpoint index
* On exit: