summaryrefslogtreecommitdiff
path: root/Debugger/debug_stub.S
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-04-01 11:55:13 +0800
committerTat-Chee Wan (USM)2011-04-01 11:55:13 +0800
commit90a30d6380d7e1ffd7cacf3d18423ebe111a6859 (patch)
treeda16fdf0c97ac93c49ba2ff6d0ae7e13f610fe01 /Debugger/debug_stub.S
parent74f6599332a09493f93c1c0893da87581ca91ed8 (diff)
fixed thumb breakpoint detection logic in undef handler
Thumb breakpoints were not handled properly in the Undef instruciton handler previously. This fixes the problem.
Diffstat (limited to 'Debugger/debug_stub.S')
-rw-r--r--Debugger/debug_stub.S23
1 files changed, 12 insertions, 11 deletions
diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S
index a82088d..3743b98 100644
--- a/Debugger/debug_stub.S
+++ b/Debugger/debug_stub.S
@@ -1172,11 +1172,7 @@ _dbg__cont_check_breakpoint_type:
teq r0, #DBG_MANUAL_BKPT_ARM
beq _dbg__cont_is_manual_bkpt_or_address_specified
teq r0, #DBG_MANUAL_BKPT_THUMB
- bne _dbg__cont_is_normal_breakpoint
-
-_dbg__cont_is_manual_bkpt_or_address_specified:
- bl _dbg__activate_breakpoints /* Restore exisiting breakpoints */
- b _dbg__switch2undefmode
+ beq _dbg__cont_is_manual_bkpt_or_address_specified
_dbg__cont_is_normal_breakpoint:
/* FIXME: _dbg_next_instruction_addr doesn't actually work currently.
@@ -1193,6 +1189,10 @@ _dbg__cont_is_normal_breakpoint:
bl _dbg__activate_autobreakpoint /* pass next instruction address in r1 */
b _dbg__switch2undefmode
+_dbg__cont_is_manual_bkpt_or_address_specified:
+ bl _dbg__activate_breakpoints /* Restore exisiting breakpoints */
+ b _dbg__switch2undefmode
+
/* _dbg__cmd_Step
* Step User Program Execution Command Handler
* Setup breakpoints before resuming execution of program.
@@ -1230,12 +1230,7 @@ _dbg__step_check_breakpoint_type:
teq r0, #DBG_MANUAL_BKPT_ARM
beq _dbg__step_is_manual_bkpt
teq r0, #DBG_MANUAL_BKPT_THUMB
- bne _dbg__step_is_normal_breakpoint
-
-_dbg__step_is_manual_bkpt:
- mov r2, #DBGSTACK_NEXTINSTR_INDEX /* The Next Instruction Pointer for Resume is in index 0 of the Debug Stack */
- _getdbgregisterfromindex r2, r1 /* Retrieve Register contents into R1 */
- b _dbg__step_is_manual_bkpt_or_address_specified
+ beq _dbg__step_is_manual_bkpt
_dbg__step_is_normal_breakpoint:
/* FIXME: _dbg_next_instruction_addr doesn't actually work currently.
@@ -1246,6 +1241,12 @@ _dbg__step_is_normal_breakpoint:
_getdbgregisterfromindex r2, r0 /* Retrieve Register contents into R0 */
mov r2, #DBGSTACK_NEXTINSTR_INDEX /* The Next Instruction Pointer for Resume is in index 0 of the Debug Stack */
_setdbgregisterfromindex r2, r0, r1 /* Set Register contents in R0, using index in R2, and scratch register R1 */
+ b _dbg__step_is_manual_bkpt_or_address_specified
+
+_dbg__step_is_manual_bkpt:
+ mov r2, #DBGSTACK_NEXTINSTR_INDEX /* The Next Instruction Pointer for Resume is in index 0 of the Debug Stack */
+ _getdbgregisterfromindex r2, r1 /* Retrieve Register contents into R1 */
+ /* b _dbg__step_is_manual_bkpt_or_address_specified */
_dbg__step_is_manual_bkpt_or_address_specified:
/* R1 contains the instruction address to be executed upon return */