aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-07-11 17:02:35 +0800
committerTat-Chee Wan (USM)2011-07-11 17:02:35 +0800
commit2830257afe20ee94de071990250868ed1290cd7f (patch)
treea76b563c79ca8165597f367c05d43780f49931c9
parentb5d953af250eb97ee1f41940edab873d547f2579 (diff)
do not set thumb flag before calling thumb instruction handler routines
Pass valid (even) addresses to thumb instruction handler routines. Set Thumb bit (b0) only on return from the handlers.
-rw-r--r--Debugger/debug_opcodes.S14
1 files changed, 7 insertions, 7 deletions
diff --git a/Debugger/debug_opcodes.S b/Debugger/debug_opcodes.S
index fbdd7db..d7811d7 100644
--- a/Debugger/debug_opcodes.S
+++ b/Debugger/debug_opcodes.S
@@ -698,7 +698,10 @@ _dbg_get_aborted_instr:
beq _following_instr_addr_for_arm
_following_instr_addr_for_thumb:
add r6, r6, #2 /* Store default following Thumb instruction address to R6 */
+#if 0
+ /* Flag Thumb instruction only within the instruction handler */
orr r6, r6, #BKPT_STATE_THUMB_FLAG /* Set b0 to indicate Thumb instruction */
+#endif
/* R4: Candidate Instruction Opcode
* R5[3:0]: CPSR condition codes
* R6: Default Following Instruction Address (PC+2)
@@ -1159,9 +1162,6 @@ _arm_bx_blx_handler:
_regenum2index r0, r1 /* Convert Enum into Index in R1 */
_getdbgregisterfromindex r1, r0 /* Retrieve Register contents from Index (R1) into R0 */
/* Here, the register value would have B0 set to indicate switch to Thumb mode */
-#if 0
- bic r0, #0x01 /* Clear R0[0] since it is used to indicates Thumb mode */
-#endif
ldmfd sp!, {pc}
/* _arm_ldr_pc_handler
@@ -1354,7 +1354,7 @@ _thumb_get_regcount:
ldr r0, [r1] /* Retrieve new PC value */
#if 0
/* PC Value should have B0 set */
- orr r0, r0, #0x01 /* Force R0[0] since it is used to indicates Thumb mode */
+ orr r0, r0, #BKPT_STATE_THUMB_FLAG /* Force R0[0] since it is used to indicates Thumb mode */
#endif
ldmfd sp!, {pc}
@@ -1395,7 +1395,7 @@ _thumb_calc_bcond_offset:
add r0, r6, r0 /* PC+2 + signed offset */
add r0, r0, #2 /* PC+4 + signed offset */
_exit_thumb_bcond_instr:
- orr r0, r0, #0x01 /* Set R0[0] since it is used to indicates Thumb mode */
+ orr r0, r0, #BKPT_STATE_THUMB_FLAG /* Set R0[0] since it is used to indicates Thumb mode */
_exit_thumb_bcond_swi_handler:
ldmfd sp!, {pc}
@@ -1416,7 +1416,7 @@ _thumb_b_handler:
asr r0, r0, #(32-12) /* Convert into 12-bit signed offset in R0[11:0] */
add r0, r6, r0 /* PC+2 + signed offset */
add r0, r0, #2 /* PC+4 + signed offset */
- orr r0, r0, #0x01 /* Set R0[0] since it is used to indicates Thumb mode */
+ orr r0, r0, #BKPT_STATE_THUMB_FLAG /* Set R0[0] since it is used to indicates Thumb mode */
ldmfd sp!, {pc}
/* _thumb_long_bl_blx_handler
@@ -1475,7 +1475,7 @@ _return_default_thumb_following_instr:
*/
mov r0, r6 /* Return default Following/Subsequent Instruction Address */
_flag_thumb_instr_addr:
- orr r0, r0, #0x01 /* Set R0[0] since it is used to indicates Thumb mode */
+ orr r0, r0, #BKPT_STATE_THUMB_FLAG /* Set R0[0] since it is used to indicates Thumb mode */
_exit_thumb_long_bl_blx_handler:
ldmfd sp!, {pc}