aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-07-20 12:09:57 +0800
committerTat-Chee Wan (USM)2011-07-20 12:09:57 +0800
commit638903cb029c3b64c11bed2de2132880349b81c8 (patch)
treef7bc20d4f41008f51e69e473f704c5fed637cdfb
parentc459f880d4a63516664434c0da480905e4481400 (diff)
fix register usage clobbered by revised output macros
R3 was clobbered by buffer output macros. Don't use R3 to store important data.
-rw-r--r--Debugger/debug_stub.S12
1 files changed, 6 insertions, 6 deletions
diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S
index cbb253a..7b8e2f3 100644
--- a/Debugger/debug_stub.S
+++ b/Debugger/debug_stub.S
@@ -786,7 +786,7 @@ _dbg__cmd_Query_default:
* r0: parameter buffer pointer (contents after '$' and '<cmdchar>')
* x
* On exit:
- * r0, r1, r2, r3: destroyed
+ * r0, r1, r2, r3, r4: destroyed
*
*/
_dbg__cmd_GetOneReg:
@@ -799,9 +799,9 @@ _dbg__cmd_GetOneReg:
bl ascii2hex_varlen_be /* convert ASCII reg enum to Hex (in R0), R1 has address of next buffer char */
_dbg__proc_getRegister:
- mov r3, r0 /* Keep register index safe */
+ mov r4, r0 /* Keep register index safe */
_dbg_outputMsgValidResponse /* R0: address of output message buffer data pointer (after response prefix) */
- mov r1, r3 /* Move register index value to R1 */
+ mov r1, r4 /* Move register index value to R1 */
bl _dbg_outputOneRegValue /* update output buffer */
_asciiz r0, r1
bl dbg__putDebugMsg /* Send response to the GDB server */
@@ -1012,7 +1012,7 @@ _dbg__nop:
* r0: parameter buffer pointer (contents after '$' and '<cmdchar>')
* AA..AA,LLLL
* On exit:
- * r0, r1, r2, r3, r4: destroyed
+ * r0, r1, r2, r3, r4, r5: destroyed
*/
_dbg__cmd_ReadMem:
stmfd sp!, {lr}
@@ -1023,7 +1023,7 @@ _dbg__cmd_ReadMem:
bl ascii2word_be /* convert ASCII address location to Hex (in R0), R1 has address of next buffer char */
#endif
bl ascii2hex_varlen_be /* convert ASCII address to Hex (in R0), R1 has address of next buffer char */
- mov r3, r0 /* Keep Address location in R3 */
+ mov r5, r0 /* Keep Address location in R5 */
_check_msgseparator r1
bne __dbg__procCmdParamError /* Can't find ',' */
mov r0, r1 /* move buffer pointer to R0 for subsequent processing */
@@ -1034,7 +1034,7 @@ _dbg__cmd_ReadMem:
/* FIXME: Should validate the address? */
_dbg_outputMsgValidResponse /* R0: address of output message buffer data pointer (after response prefix) */
-1: ldrb r1, [r3], #1
+1: ldrb r1, [r5], #1
bl byte2ascii /* update output buffer */
subs r4, r4, #1
bne 1b