summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-03-24 11:01:26 +0800
committerTat-Chee Wan (USM)2011-03-24 11:01:26 +0800
commitccc74cd2f443d57b3edc29a94935ed8f13ffef46 (patch)
tree7b10f13ebf93ce0f8a548d8a7c84029b6e811352
parente1e0d31f9aad0ed6c64f61208e94cef43e256de7 (diff)
cater for variable length address parameters
-rw-r--r--Debugger/debug_stub.S11
-rw-r--r--Debugger/debug_stub.h3
2 files changed, 12 insertions, 2 deletions
diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S
index de126be..fb64b51 100644
--- a/Debugger/debug_stub.S
+++ b/Debugger/debug_stub.S
@@ -970,9 +970,12 @@ _dbg__nop:
_dbg__cmd_ReadMem:
stmfd sp!, {lr}
bl __dbg__cmdParamLen
+#if 0
teq r1, #CMD_MEM_READ_PARAMLEN /* Check for correct length */
bne __dbg__procCmdParamError /* Unexpected input, report error */
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 */
_check_msgseparator r1
bne __dbg__procCmdParamError /* Can't find ',' */
@@ -1005,10 +1008,13 @@ _dbg__cmd_ReadMem:
_dbg__cmd_WriteMem:
stmfd sp!, {lr}
bl __dbg__cmdParamLen
+#if 0
cmp r1, #CMD_MEM_WRITE_MINPARAMLEN /* Check for correct (minimum) length */
blo __dbg__procCmdParamError /* Unexpected input, report error */
sub r4, r1, #CMD_MEM_WRITE_MINPARAMLEN /* R4: Number of ASCII Hex chars for byte writes */
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 */
_check_msgseparator r1
bne __dbg__procCmdParamError /* Can't find ',' */
@@ -1044,10 +1050,13 @@ _dbg__cmd_Continue:
bl __dbg__cmdParamLen
cmp r1, #CMD_REG_CONTINUE_PARAMLEN /* Check for correct parameter length */
beq _dbg__cmd_processContinue /* Continue from current PC */
+#if 0
cmp r1, #CMD_REG_CONTINUEFROM_PARAMLEN /* Check for correct parameter length */
bne __dbg__procCmdParamError /* Unexpected input, report error */
- /* Continue from Specified Address */
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 */
+ /* Continue from Specified Address */
mov r2, #DBGSTACK_NEXTINSTR_INDEX /* The Next Instruction Pointer for Resume is in index 0 of the Debug Stack */
_setdbgregisterfromindex r2, r0, r1 /* Set Register contents in R0, using index in R2, and scratch register R1 */
diff --git a/Debugger/debug_stub.h b/Debugger/debug_stub.h
index 229c6d6..9d97705 100644
--- a/Debugger/debug_stub.h
+++ b/Debugger/debug_stub.h
@@ -92,6 +92,8 @@
/** @name Debug Memory Command Constants.
*
* Debug Memory Command
+ * FIXME: These limits are not enforced by the GDB client, it truncates addresses and lengths to remove leading '0's
+ * The PARAMLEN constants would probably be removed
*/
/*@{*/
#define CMD_NUMITEMS_PARAMLEN 4 /* 16-bit ASCII Hex Value */
@@ -110,7 +112,6 @@
*/
/*@{*/
#define CMD_REG_CONTINUE_PARAMLEN 0
-#define CMD_REG_CONTINUEFROM_PARAMLEN CMD_REG_REGPARAMLEN /* Address length is equivalent to reg param len */
/*@}*/