summaryrefslogtreecommitdiff
path: root/Debugger/debug_stub.h
diff options
context:
space:
mode:
authorTC Wan2011-03-24 12:13:51 +0800
committerTC Wan2011-03-24 12:13:51 +0800
commit110b7562fef3ef9efe37c04dd9d86a34d4bdf53b (patch)
tree30a3c8c2f1a62b563e346d8bfcb05f1b9c806bfc /Debugger/debug_stub.h
parent156ff4b478684f9ddafa9e2a99d3e9665f06177d (diff)
parentf60b520e4da4d19dc43a5058168e668acdaaee00 (diff)
Merge branch 'master' of ssh://svc.cs.usm.my/~/gitrepo-bare/armdebug
Diffstat (limited to 'Debugger/debug_stub.h')
-rw-r--r--Debugger/debug_stub.h35
1 files changed, 31 insertions, 4 deletions
diff --git a/Debugger/debug_stub.h b/Debugger/debug_stub.h
index 7dc9aa8..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 */
/*@}*/
@@ -147,9 +148,9 @@
#define DBGSTACK_NEXTINSTR_INDEX 0 /* Next Instruction Address is at index 0 from bottom of Debug Stack */
#define DBGSTACK_USERCPSR_INDEX 1 /* User CPSR (SPSR_UNDEF) is at index 1 from bottom of Debug Stack */
#define DBGSTACK_USERREG_INDEX 2 /* R0 starts at index 2 from bottom of Debug Stack */
-#define DBGSTACK_USERSP_INDEX (DBGSTACK_USERREG_INDEX + 13) /* SP is R13 */
-#define DBGSTACK_USERPC_INDEX (DBGSTACK_USERREG_INDEX + 15) /* PC is R15 */
-#define DBGSTACK_USERCPSR_OFFSET (DBGSTACK_USERCPSR_INDEX-DBGSTACK_USERREG_INDEX) /* = -1, offset for calculating Debug Stack index */
+#define DBGSTACK_USERSP_INDEX (DBGSTACK_USERREG_INDEX + REG_SP) /* SP is R13 */
+#define DBGSTACK_USERLR_INDEX (DBGSTACK_USERREG_INDEX + REG_LR) /* LR is R14 */
+#define DBGSTACK_USERPC_INDEX (DBGSTACK_USERREG_INDEX + REG_PC) /* PC is R15 */
/*@}*/
/** @name Bitmask Definitions.
@@ -252,6 +253,32 @@ ENUM_VAL(MSG_UNKNOWNPARAM) /**< Unrecognized Parameter Error. */
ENUM_VAL(MSG_UNKNOWNBRKPT) /**< Unrecognized Breakpoint Error. */
ENUM_END(dbg_msg_errno)
+/** Register Enums
+ *
+ * Register Enums.
+ * The enums must be consecutive, starting from -1
+ */
+ENUM_BEGIN
+ENUM_VALASSIGN(REG_CPSR, -1) /**< Previous Mode CPSR */
+ENUM_VAL(REG_R0) /**< User Reg R0 */
+ENUM_VAL(REG_R1) /**< User Reg R1 */
+ENUM_VAL(REG_R2) /**< User Reg R2 */
+ENUM_VAL(REG_R3) /**< User Reg R3 */
+ENUM_VAL(REG_R4) /**< User Reg R4 */
+ENUM_VAL(REG_R5) /**< User Reg R5 */
+ENUM_VAL(REG_R6) /**< User Reg R6 */
+ENUM_VAL(REG_R7) /**< User Reg R7 */
+ENUM_VAL(REG_R8) /**< User Reg R8 */
+ENUM_VAL(REG_R9) /**< User Reg R9 */
+ENUM_VAL(REG_R10) /**< User Reg R10 */
+ENUM_VAL(REG_R11) /**< User Reg R11 */
+ENUM_VAL(REG_R12) /**< User Reg R12 */
+ENUM_VAL(REG_SP) /**< Previous Mode SP (R13) */
+ENUM_VAL(REG_LR) /**< Previous Mode LR (R14) */
+ENUM_VAL(REG_PC) /**< Program Counter (R15) */
+
+ENUM_END(register_enum_t)
+
#ifndef __ASSEMBLY__