aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/Debugger/debug_stub.S
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-02-14 10:52:44 +0800
committerTat-Chee Wan (USM)2011-02-14 10:52:44 +0800
commit8613433acf8dd6f22da08c2be384f439264c4aef (patch)
tree106624257b6b5479f2b6085fd4924480a63e0431 /AT91SAM7S256/armdebug/Debugger/debug_stub.S
parent414653369733b86f7bb5aa5d7b49f4e2157caba0 (diff)
parent447d92e66be8c481db8e066da20fd8186ef78083 (diff)
Merge branch 'master' of ssh://svc.cs.usm.my/~/gitrepo-bare/armdebug
Diffstat (limited to 'AT91SAM7S256/armdebug/Debugger/debug_stub.S')
-rw-r--r--AT91SAM7S256/armdebug/Debugger/debug_stub.S39
1 files changed, 21 insertions, 18 deletions
diff --git a/AT91SAM7S256/armdebug/Debugger/debug_stub.S b/AT91SAM7S256/armdebug/Debugger/debug_stub.S
index 78a5472..5d4cfff 100644
--- a/AT91SAM7S256/armdebug/Debugger/debug_stub.S
+++ b/AT91SAM7S256/armdebug/Debugger/debug_stub.S
@@ -3,7 +3,7 @@
*
*/
-/* Copyright (C) 2007-2010 the NxOS developers
+/* Copyright (C) 2007-2011 the NxOS developers
*
* Module Developed by: TC Wan <tcwan@cs.usm.my>
*
@@ -320,6 +320,7 @@ debug_armComplexCCTable:
.extern dbg__hasDebugMsg /* Check for message from the communications link */
.extern dbg__getDebugMsg /* Read a message from the communications link */
.extern dbg__putDebugMsg /* Write a message to the communications link */
+ .extern dbg__runloopTasks /* Platform specific Run Loop processing */
/* The Debugger Interface can handle a total of (n-1) Breakpoint States and 1 Single Stepping State,
@@ -501,7 +502,7 @@ dbg__bkpt_offset_outofrange:
*
****************************************************************************/
dbg__bkpt_waitCMD:
-1: bl dbg__getDebugMsg /* Read new message from Debugger, message buffer addr in R0, NULL if error */
+1: bl dbg__getDebugMsg /* Read new message from Debugger, message buffer addr in R0, 0 if none, -1 if error */
cmp r0, #0
beq 1b /* No message yet, keep checking */
movlt r0, #MSG_ERRCHKSUM /* Message invalid, checksum error? */
@@ -528,6 +529,7 @@ _dbg__cmdExists:
_dbg__cmdError:
_dbg_outputMsgStatusErr
bl dbg__putDebugMsg /* Send error response to the GDB server */
+ bl dbg__runloopTasks /* Execute platform run loop tasks while in ABRT mode */
b dbg__bkpt_waitCMD
@@ -809,17 +811,17 @@ _exit_dbg__proc_brkpt_params:
_dbg__cmd_insert_breakpoint:
stmfd sp!, {lr}
bl __dbg__cmdParamLen
- teq r1, #CMD_BKPT_INSERT_PARAMLEN /* Check for correct length */
- bne __dbg__procCmdParamError /* Unexpected input, report error */
- bl _dbg__proc_brkpt_params /* R0: Breakpoint Address */
+ teq r1, #CMD_BKPT_INSERT_PARAMLEN /* Check for correct length */
+ bne __dbg__procCmdParamError /* Unexpected input, report error */
+ bl _dbg__proc_brkpt_params /* R0: Breakpoint Address */
teq r0, #0
- beq __dbg__procBreakpointAddrError /* Thumb2 instructions, or unknown kind */
- mov r3, r0 /* Keep breakpoint address in R3 */
- mov r0, #0 /* Empty Breakpoint entry */
- bl _dbg_find_breakpoint_slot /* Look for an available breakpoint slot, return index in R0 */
+ beq __dbg__procBreakpointAddrError /* Thumb2 instructions, or unknown kind */
+ mov r3, r0 /* Keep breakpoint address in R3 */
+ mov r0, #0 /* Empty Breakpoint entry */
+ bl _dbg_find_breakpoint_slot /* Look for an available breakpoint slot, return index in R0 */
cmp r0, #CMD_BKPT_NOTFOUND
beq __dbg__procBreakpointAddrError /* No empty slot! */
- mov r1, r3 /* Move breakpoint address to R1 */
+ mov r1, r3 /* Move breakpoint address to R1 */
bl _dbg__install_one_breakpoint /* r0: index, r1: instruction address */
b __dbg__procCmdOk
@@ -834,16 +836,17 @@ _dbg__cmd_insert_breakpoint:
_dbg__cmd_remove_breakpoint:
stmfd sp!, {lr}
bl __dbg__cmdParamLen
- teq r1, #CMD_BKPT_REMOVE_PARAMLEN /* Check for correct length */
- bne __dbg__procCmdParamError /* Unexpected input, report error */
- bl _dbg__proc_brkpt_params /* R0: Breakpoint Address */
+ teq r1, #CMD_BKPT_REMOVE_PARAMLEN /* Check for correct length */
+ bne __dbg__procCmdParamError /* Unexpected input, report error */
+ bl _dbg__proc_brkpt_params /* R0: Breakpoint Address */
teq r0, #0
- beq __dbg__procBreakpointAddrError /* Thumb2 instructions, or unknown kind */
- bl _dbg_find_breakpoint_slot /* Look for matching breakpoint slot, return index in R0 */
+ beq __dbg__procBreakpointAddrError /* Thumb2 instructions, or unknown kind */
+ bl _dbg_find_breakpoint_slot /* Look for matching breakpoint slot, return index in R0 */
cmp r0, #CMD_BKPT_NOTFOUND
- beq __dbg__procBreakpointAddrError /* Specified Breakpoint not found! */
- _index2bkptindex_addr r0, r0 /* Calculate Breakpoint Entry Address */
- bl _dbg__clear_one_breakpoint /* R0: address of breakpoint to clear */
+ beq __dbg__procBreakpointAddrError /* Specified Breakpoint not found! */
+ _index2bkptindex_addr r0, r1 /* Calculate Breakpoint Entry Address */
+ mov r0, r1 /* Move it to R0 for subroutine call */
+ bl _dbg__clear_one_breakpoint /* R0: address of breakpoint to clear */
b __dbg__procCmdOk