aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-03-25 12:44:52 +0800
committerTat-Chee Wan (USM)2011-03-25 12:44:52 +0800
commit41d30e96debfa7fb4a787ec6b298b8d3e6b76045 (patch)
tree1b1918d3820d5b7dc811631117208da92a58d62d
parent61647c1986a16665329ea185907b4acc76c2eb74 (diff)
separated breakpoint type from debugger state
-rw-r--r--Debugger/debug_macros.h31
-rw-r--r--Debugger/debug_stub.S13
-rw-r--r--Debugger/debug_stub.h19
3 files changed, 49 insertions, 14 deletions
diff --git a/Debugger/debug_macros.h b/Debugger/debug_macros.h
index d6786d5..0afa0a4 100644
--- a/Debugger/debug_macros.h
+++ b/Debugger/debug_macros.h
@@ -289,7 +289,7 @@
*/
.macro _dbg_getstate reg
ldr \reg, =debug_state
- ldrb \reg, [\reg]
+ ldrb \reg, [\reg]
.endm
/* _dbg_setstate
@@ -300,7 +300,7 @@
.macro _dbg_setstate state
mov r0, #\state
ldr r1, =debug_state
- strb r0, [r1]
+ strb r0, [r1]
.endm
/* _dbg_getmode
@@ -310,7 +310,7 @@
*/
.macro _dbg_getmode reg
ldr \reg, =debug_mode
- ldrb \reg, [\reg]
+ ldrb \reg, [\reg]
.endm
/* _dbg_setmode
@@ -321,9 +321,32 @@
.macro _dbg_setmode mode
mov r0, #\mode
ldr r1, =debug_mode
- strb r0, [r1]
+ strb r0, [r1]
.endm
+/* _dbg_get_bkpt_type
+ * Get Breakpoint Type
+ * On exit:
+ * reg: Breakpoint Type
+ */
+ .macro _dbg_get_bkpt_type reg
+ ldr \reg, =debug_bkpt_type
+ ldrb \reg, [\reg]
+ .endm
+
+/* _dbg_set_bkpt_type
+ * Set Breakpoint Type to given value
+ * On exit:
+ * r0, r1: destroyed
+ */
+ .macro _dbg_set_bkpt_type bkpt_type
+ mov r0, #\bkpt_type
+ ldr r1, =debug_bkpt_type
+ strb r0, [r1]
+ .endm
+
+
+
/* _dbg_getcurrbkpt_index
* Get current breakpoint index
* On exit:
diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S
index fae254f..1547882 100644
--- a/Debugger/debug_stub.S
+++ b/Debugger/debug_stub.S
@@ -198,9 +198,11 @@ debug_OutMsgBuf:
.space MSGBUF_SIZE,0
debug_state:
- .byte 0x0
+ .byte 0x0 /* dbg_state_t variable */
debug_mode:
.byte 0x0 /* Boolean variable */
+debug_bkpt_type:
+ .byte 0x0 /* bkpt_type_t variable */
.data
.align 4
@@ -522,7 +524,7 @@ dbg__thumb_bkpt_handler:
teq r4, #0 /* Check if AUTO flag set */
bne _process_auto_breakpoint
/* else */
- _dbg_setstate DBG_NORMAL_BKPT_THUMB
+ _dbg_set_bkpt_type DBG_NORMAL_BKPT_THUMB
b _process_normal_breakpoint
.global dbg__arm_bkpt_handler
@@ -545,7 +547,7 @@ dbg__arm_bkpt_handler:
teq r4, #0 /* Check if AUTO flag set */
bne _process_auto_breakpoint
/* else */
- _dbg_setstate DBG_NORMAL_BKPT_ARM
+ _dbg_set_bkpt_type DBG_NORMAL_BKPT_ARM
/* b _process_normal_breakpoint */
_process_normal_breakpoint:
@@ -564,14 +566,15 @@ _process_auto_breakpoint:
bl _dbg__activate_one_breakpoint
bl _dbg__restore_singlestep
bl _dbg__clear_singlestep
+ _dbg_set_bkpt_type DBG_AUTO_BKPT
b __dbg__resume_execution
_process_manual_breakpoint_thumb:
- _dbg_setstate DBG_MANUAL_BKPT_THUMB
+ _dbg_set_bkpt_type DBG_MANUAL_BKPT_THUMB
b dbg__bkpt_waitCMD
_process_manual_breakpoint_arm:
- _dbg_setstate DBG_MANUAL_BKPT_ARM
+ _dbg_set_bkpt_type DBG_MANUAL_BKPT_ARM
/* b dbg__bkpt_waitCMD */
dbg__bkpt_inactive:
diff --git a/Debugger/debug_stub.h b/Debugger/debug_stub.h
index ae82028..a69efd3 100644
--- a/Debugger/debug_stub.h
+++ b/Debugger/debug_stub.h
@@ -232,12 +232,21 @@ ENUM_BEGIN
ENUM_VALASSIGN(DBG_RESET, 0) /**< Initial State. */
ENUM_VAL(DBG_INIT) /**< Debugger Initialized. */
ENUM_VAL(DBG_CONFIGURED) /**< Debugger has been configured by GDB Server */
-ENUM_VAL(DBG_MANUAL_BKPT_ARM) /**< Manual ARM Breakpoint. */
-ENUM_VAL(DBG_NORMAL_BKPT_ARM) /**< Normal ARM Breakpoint (Single Step, Normal). */
-ENUM_VAL(DBG_MANUAL_BKPT_THUMB) /**< Manual Thumb Breakpoint. */
-ENUM_VAL(DBG_NORMAL_BKPT_THUMB) /**< Normal Thumb Breakpoint (Single Step, Normal). */
ENUM_END(dbg_state_t)
+/** Breakpoint Type Enums
+ *
+ * Breakpoint Type.
+ * The enums must be consecutive, starting from 0
+ */
+ENUM_BEGIN
+ENUM_VALASSIGN(DBG_AUTO_BKPT,0) /**< Auto Thumb Breakpoint (Instruction resume after breakpoint). */
+ENUM_VAL(DBG_MANUAL_BKPT_ARM) /**< Manual ARM Breakpoint. */
+ENUM_VAL(DBG_NORMAL_BKPT_ARM) /**< Normal ARM Breakpoint (Single Step, Normal). */
+ENUM_VAL(DBG_MANUAL_BKPT_THUMB) /**< Manual Thumb Breakpoint. */
+ENUM_VAL(DBG_NORMAL_BKPT_THUMB) /**< Normal Thumb Breakpoint (Single Step, Normal). */
+ENUM_END(bkpt_type_t)
+
/** Debugger Message Error Enums
*
* Debugger Error Message Enums.
@@ -257,7 +266,7 @@ ENUM_END(dbg_msg_errno)
/** Register Enums
*
* Register Enums.
- * The enums must be consecutive, starting from -1
+ * Refer to eCOS's arm_stub.h for enum values
*/
ENUM_BEGIN
ENUM_VALASSIGN(REG_R0, 0) /**< User Reg R0 */