summaryrefslogtreecommitdiff
path: root/Debugger/debug_stub.S
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-07-06 08:25:06 +0800
committerTat-Chee Wan (USM)2011-07-06 08:25:06 +0800
commitb2f8982f8293ed6b875f2251b4a01011d1786428 (patch)
tree9f81c1d3a6f3c9e492152ffb5bc060d244668cd2 /Debugger/debug_stub.S
parent0a17d7ae48b32cce9e9c7e7de80610ae429c7e26 (diff)
fix bug in b and bl offset calculation, code cleanup.
B/BL Instruction Parsing routine was not calculating the correct offset. Cleanup debugger stack frame access logic
Diffstat (limited to 'Debugger/debug_stub.S')
-rw-r--r--Debugger/debug_stub.S7
1 files changed, 3 insertions, 4 deletions
diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S
index a0797c6..2152f7f 100644
--- a/Debugger/debug_stub.S
+++ b/Debugger/debug_stub.S
@@ -1090,8 +1090,7 @@ _dbg__cmd_Continue:
_dbg__cont_fromAddr:
bl ascii2hex_varlen_be /* convert ASCII address to Hex (in R0), R1 has address of next buffer char */
/* Continue from Specified Address */
- 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 */
+ _setdbgregister DBGSTACK_NEXTINSTR_INDEX, r0, r1 /* Set Next Instruction Pointer for Resume using contents of R0, and scratch register R1 */
bl __dbg__procAckOnly /* send Ack to keep GDB server happy */
b _dbg__cont_is_manual_bkpt_or_address_specified
@@ -1102,6 +1101,7 @@ _dbg__cont_check_breakpoint_type:
teq r0, #DBG_MANUAL_BKPT_THUMB
beq _dbg__cont_is_manual_bkpt_or_address_specified
+@ FIXME: Need to validate the following code
_dbg__cont_is_normal_breakpoint:
_getdbgregister DBGSTACK_USERPC_INDEX, r0 /* Retrieve Aborted Instruction PC from the Debug Stack into R0 */
_setdbgregister DBGSTACK_NEXTINSTR_INDEX, r0, r1 /* Set Next Instruction Pointer for Resume using contents of R0, and scratch register R1 */
@@ -1143,8 +1143,7 @@ _dbg__cmd_Step:
_dbg__step_fromAddr:
bl ascii2hex_varlen_be /* convert ASCII address to Hex (in R0), R1 has address of next buffer char */
/* Step from Specified Address */
- 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 */
+ _setdbgregister DBGSTACK_NEXTINSTR_INDEX, r0, r1 /* Set Next Instruction Pointer for Resume using contents of R0, and scratch register R1 */
b _dbg__step_is_manual_bkpt_or_address_specified
_dbg__step_check_breakpoint_type: