From edc8ef9f05a2f02f401990c8b1b73da538114099 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Mon, 21 Mar 2011 08:46:57 +0800 Subject: fixed incorrect argument size comparison for debug_mode --- Debugger/debug_stub.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Debugger/debug_stub.S') diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index c9b9ad7..839d661 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -429,8 +429,7 @@ cCommHandleDebug: bl dbg__copyNxtDebugMsg /* setup Debugger Message Buffers, validate input, CPSR returned in R0 */ /* pop {r1-r3} */ /* restore values */ _dbg_getmode r0 /* Get Debug Mode */ - ldr r1, =TRUE /* Thumb mode can't accept direct constant */ - cmp r0, r1 + cmp r0, #(TRUE & BYTE0) /* Confine it to Byte size */ /* If Debug Mode is TRUE, this means that we're already running the Debugger */ beq _cCommHandleDebug_cont -- cgit v1.2.3 From d356cf987dae39c89c419bcf65684e734c969188 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Mon, 21 Mar 2011 09:06:34 +0800 Subject: dumb mistake, forgot to preserve lr --- Debugger/debug_stub.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Debugger/debug_stub.S') diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index 839d661..ed91418 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -425,9 +425,9 @@ debug_armComplexCCTable: */ cCommHandleDebug: /* Arg Registers are not preserved since this is invoked explicitly */ - /* push {r1-r3} */ /* store arg registers */ + push {lr} /* store arg registers */ bl dbg__copyNxtDebugMsg /* setup Debugger Message Buffers, validate input, CPSR returned in R0 */ - /* pop {r1-r3} */ /* restore values */ + pop {lr} /* restore values */ _dbg_getmode r0 /* Get Debug Mode */ cmp r0, #(TRUE & BYTE0) /* Confine it to Byte size */ -- cgit v1.2.3 From 3090f0d215427af30264b183be9165fdeee88c91 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Mon, 21 Mar 2011 09:56:04 +0800 Subject: cannot pop lr in thumb mode --- Debugger/debug_stub.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Debugger/debug_stub.S') diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index ed91418..0e92667 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -427,7 +427,6 @@ cCommHandleDebug: /* Arg Registers are not preserved since this is invoked explicitly */ push {lr} /* store arg registers */ bl dbg__copyNxtDebugMsg /* setup Debugger Message Buffers, validate input, CPSR returned in R0 */ - pop {lr} /* restore values */ _dbg_getmode r0 /* Get Debug Mode */ cmp r0, #(TRUE & BYTE0) /* Confine it to Byte size */ @@ -436,8 +435,9 @@ cCommHandleDebug: /* Else, we're in normal operation mode (SVC), or other mode (??!) and need to force a switch to Debug mode */ dbg__bkpt_thumb _cCommHandleDebug_cont: - mov r0, #0 /* FIXME: Return Status */ - bx lr + mov r0, #0 /* FIXME: Return Status */ + pop {r1} /* Can't Pop LR directly */ + bx r1 /* Safe code: actually we should be able to Pop PC since the caller is Thumb Mode */ .ltorg #endif -- cgit v1.2.3 From 578d4edc66d62165e40be7aec45b09e48554ee0e Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Mon, 21 Mar 2011 10:55:34 +0800 Subject: should be mov not moveq when copying numbytes to register r4 --- Debugger/debug_stub.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Debugger/debug_stub.S') diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index 0e92667..168fd80 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -907,7 +907,7 @@ _dbg__cmd_WriteMem: bne __dbg__procCmdParamError /* Number of bytes does not match argument length */ cmp r0, #CMD_MEM_MAXWRITEBYTES /* Don't overflow our buffer (2 x CMD_MEM_MAXWRITEBYTES) */ bhi __dbg__procCmdReturnInputLengthError /* Requested Length greater than buffer size, return error */ - moveq r4, r0 /* Keep numbytes in R4 */ + mov r4, r0 /* Keep numbytes in R4 */ /* FIXME: Should validate the address? */ _check_msgargument r1 bne __dbg__procCmdParamError /* Can't find ':' */ -- cgit v1.2.3 From 257213e9adff1f8ef4e57ca3c563b3abf8a87cfd Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Mon, 21 Mar 2011 15:53:04 +0800 Subject: fixed comments for breakpoint command support --- Debugger/debug_stub.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Debugger/debug_stub.S') diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index 168fd80..bef3dfa 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -99,7 +99,7 @@ * 4: access watchpoint * k: 2 (16-bit Thumb), 3 (32-bit Thumb2) * or 4 (32-bit ARM) for t=[0,1] - * Num. bytes to watch for t=[3,4] + * Num. bytes to watch for t=[2,4] * * All commands and responses are sent with a packet which includes a * checksum. A packet consists of @@ -121,6 +121,9 @@ ****************************************************************************/ /* Modified GDB Server Remote Protocol definition from GDB's sparc-stub.c Comment Header included above * Additional commands from GDB Reference Appendix D.2 + * + * Note: ARMDEBUG can only implement Memory Breakpoints t=0. Hardware breakpoints requires a JTAG debugger. + * Currently, watchpoints are not implemented as they require hardware support as well (need verification). */ #define __ASSEMBLY__ -- cgit v1.2.3