summaryrefslogtreecommitdiff
path: root/Debugger
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-07-11 10:52:07 +0800
committerTat-Chee Wan (USM)2011-07-11 10:52:07 +0800
commit3500d60eaa090c048fae181cde26492f38a2b65f (patch)
treec893a140e3791789ee50f80bc9fa086d64693a2a /Debugger
parent7af6f3e1ef6d172311038390b156e6c65c72afb1 (diff)
fix data abort error due to thumb bit set in instruction address
Need to clear thumb flag in _dbg__install_one_breakpoint before accessing memory location, otherwise a Data Abort will be triggered for thumb instructions
Diffstat (limited to 'Debugger')
-rw-r--r--Debugger/debug_stub.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S
index 19645a5..6dfb333 100644
--- a/Debugger/debug_stub.S
+++ b/Debugger/debug_stub.S
@@ -1412,8 +1412,9 @@ _dbg__install_one_breakpoint:
/* Check for Thumb bit */
tst r1, #BKPT_STATE_THUMB_FLAG /* 1: Thumb instruction */
/* Assume that the address entry is valid, otherwise we should sanitize it (mask out b1) */
- ldreq r2, [r1] /* if 0: load ARM instruction from address location */
- ldrneh r2, [r1] /* else load Thumb instruction */
+ bic r2, r1, #BKPT_STATE_THUMB_FLAG /* R2: Instruction Address; clear Thumb Flag for accessing to Memory */
+ ldreq r2, [r2] /* if 0: load ARM instruction from address location */
+ ldrneh r2, [r2] /* else load Thumb instruction */
_index2bkptindex_addr r0, r3 /* Calculate Breakpoint Entry Address */
stm r3, {r1, r2}
bx lr