From 3500d60eaa090c048fae181cde26492f38a2b65f Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Mon, 11 Jul 2011 10:52:07 +0800 Subject: 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 --- Debugger/debug_stub.S | 5 +++-- 1 file 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 -- cgit v1.2.3