summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-06-18 16:31:07 +0800
committerTat-Chee Wan (USM)2011-06-18 16:31:07 +0800
commit2342c9ee61f0c19af069b3a9b8f20fc4784ee59e (patch)
tree15e36c81fba385f252bdf3ebee0926c11db774b3
parent3bd42c4969f92d991605c89d4cb3112cc7c5e917 (diff)
added detach command support
Detach acts in the same way as Continue (without arguments).
-rw-r--r--Debugger/debug_internals.h1
-rw-r--r--Debugger/debug_stub.S26
2 files changed, 25 insertions, 2 deletions
diff --git a/Debugger/debug_internals.h b/Debugger/debug_internals.h
index 9dc2bad..c7f5d16 100644
--- a/Debugger/debug_internals.h
+++ b/Debugger/debug_internals.h
@@ -89,6 +89,7 @@
#define CMD_REG_SETONE_MAXPARAMLEN (3 + CMD_REG_REGPARAMLEN)
#define CMD_REG_SETALL_PARAMLEN (CMD_REG_NUMREGS*CMD_REG_REGPARAMLEN)
#define CMD_KILL_PARAMLEN 0
+#define CMD_DETACH_PARAMLEN 0
/*@}*/
diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S
index fc4f368..3f1b53e 100644
--- a/Debugger/debug_stub.S
+++ b/Debugger/debug_stub.S
@@ -227,7 +227,7 @@ debug_OkResponse:
/* The CmdIndexTable and CmdJumpTable must be kept in sync */
debug_cmdIndexTable:
- .byte 'g','G','p','P','m','M','c','s','k','z','Z','?','q','Q',0
+ .byte 'g','G','p','P','m','M','c','s','k','z','Z','?','q','Q','D',0
/* Command Handlers
* On entry:
@@ -254,6 +254,7 @@ debug_cmdJumpTable:
.word _dbg__cmd_Status /* '?' */
.word _dbg__cmd_Query /* 'q' */
.word _dbg__nop /* 'Q' */
+ .word _dbg__cmd_Detach /* 'D' */
.word 0
/* Rm Shifted Shift Type Jump Table
@@ -1147,6 +1148,27 @@ _dbg__cmd_WriteMem:
bne 1b
b __dbg__procCmdOk
+/* _dbg__cmd_Detach
+ * Detach User Program Execution Command Handler
+ * Treat this as being equivalent to 'Continue' without any arguments
+ *
+ * On entry:
+ * r0: parameter buffer pointer (contents after '$' and '<cmdchar>')
+ * <NULL> (No Parameters)
+ * On exit:
+ * r0-r7: destroyed
+ * Note: This routine does not return to caller. Instead it switches
+ * operating mode to UNDEF and returns to previously active program
+ */
+_dbg__cmd_Detach:
+ stmfd sp!, {lr} /* In case unexpected parameters were received */
+ bl __dbg__cmdParamLen
+ teq r1, #CMD_DETACH_PARAMLEN /* Check for correct length */
+ bne __dbg__procCmdParamError /* Unexpected input, report error */
+
+ pop sp!, {lr} /* Cleanup stack, since we won't return to the Debugger Run Loop */
+ b _dbg__cont_check_breakpoint_type /* Continue from current PC */
+
/* _dbg__cmd_Continue
* Continue User Program Execution Command Handler
* Setup breakpoints before resuming execution of program.
@@ -1284,7 +1306,7 @@ _dbg__cmd_Kill:
bne __dbg__procCmdParamError /* Unexpected input, report error */
bl __dbg__procAckOnly /* send Ack to keep GDB server happy */
- b dbg__reboot
+ b dbg__reboot /* Goodbye.... */
/* _dbg__proc_brkpt_params
* Process Breakpoint Parameters