From b66fd09e34c9a720acd5367eb7658456417a8c3b Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Tue, 22 Mar 2011 16:50:25 +0800 Subject: continue command wip Work in Progress, for implementing continue command --- Debugger/debug_stub.S | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'Debugger/debug_stub.S') diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index 796de04..b0d7fed 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -224,7 +224,7 @@ debug_cmdJumpTable: .word _dbg__cmd_SetOneReg /* 'P' */ .word _dbg__cmd_ReadMem /* 'm' */ .word _dbg__cmd_WriteMem /* 'M' */ - .word _dbg__nop /* 'c' */ + .word _dbg__cmd_Continue /* 'c' */ .word _dbg__nop /* 's' */ .word _dbg__nop /* 'k' */ .word _dbg__cmd_remove_breakpoint /* 'z' */ @@ -947,6 +947,34 @@ _dbg__cmd_WriteMem: bne 1b b __dbg__procCmdOk +/* _dbg__cmd_Continue + * Continue User Program Execution Command Handler + * On entry: + * r0: parameter buffer pointer (contents after '$' and '') + * Optional: AA..AA + * On exit: + * r0, r1, r2, r3, r4: destroyed + */ +_dbg__cmd_Continue: + stmfd sp!, {lr} + bl __dbg__cmdParamLen + cmp r1, #CMD_REG_CONTINUE_PARAMLEN /* Check for correct parameter length */ + beq _dbg__cmd_processContinue /* Continue from current PC */ + cmp r1, #CMD_REG_CONTINUEFROM_PARAMLEN /* Check for correct parameter length */ + bne __dbg__procCmdParamError /* Unexpected input, report error */ + /* Continue from Specified Address */ + bl ascii2word /* convert ASCII address location to Hex (in R0), R1 has address of next buffer char */ + mov r1, #DBGSTACK_NEXTINSTR_INDEX /* The Next Instruction Pointer for Resume is in index 0 of the Debug Stack */ + _setdbgregisterfromindex r1, r0, r2 /* Set Register contents in R0, using index in R2, and scratch register R3 */ + +_dbg__cmd_processContinue: +@@@@@ + /* Switch mode to Previous Mode, reload all the registers (except for PC) */ + /* Switch back to ABORT, resume with PC and SPSR */ + b __dbg__procCmdOk + + + /* _dbg__proc_brkpt_params * Process Breakpoint Parameters * On entry: -- cgit v1.2.3