From b5d2ac17bca226b60d0efa89519ca686c583b319 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Mon, 21 Mar 2011 11:07:11 +0800 Subject: added eol to last command line --- Host/gdb-commands.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Host/gdb-commands.txt b/Host/gdb-commands.txt index 03f72a1..9b52613 100644 --- a/Host/gdb-commands.txt +++ b/Host/gdb-commands.txt @@ -25,4 +25,4 @@ $m00201D74,0010#FC $M00201D74,0002:AA55#03 # Write 2 bytes of memory to 0x00201d74 (padding bytes after debug_mode) -$M00201D74,0002:9966#F5 \ No newline at end of file +$M00201D74,0002:9966#F5 -- cgit v1.2.3 From 257213e9adff1f8ef4e57ca3c563b3abf8a87cfd Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Mon, 21 Mar 2011 15:53:04 +0800 Subject: fixed comments for breakpoint command support --- Debugger/debug_stub.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index 168fd80..bef3dfa 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -99,7 +99,7 @@ * 4: access watchpoint * k: 2 (16-bit Thumb), 3 (32-bit Thumb2) * or 4 (32-bit ARM) for t=[0,1] - * Num. bytes to watch for t=[3,4] + * Num. bytes to watch for t=[2,4] * * All commands and responses are sent with a packet which includes a * checksum. A packet consists of @@ -121,6 +121,9 @@ ****************************************************************************/ /* Modified GDB Server Remote Protocol definition from GDB's sparc-stub.c Comment Header included above * Additional commands from GDB Reference Appendix D.2 + * + * Note: ARMDEBUG can only implement Memory Breakpoints t=0. Hardware breakpoints requires a JTAG debugger. + * Currently, watchpoints are not implemented as they require hardware support as well (need verification). */ #define __ASSEMBLY__ -- cgit v1.2.3 From d989c3e9adcc8c016bbefcc69b0d7ebfbdd2ff18 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Tue, 22 Mar 2011 07:29:01 +0800 Subject: cleaned up error message handlers --- Debugger/debug_macros.h | 29 ++++++++++++++++++++--------- Debugger/debug_stub.S | 33 ++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/Debugger/debug_macros.h b/Debugger/debug_macros.h index 5af75fd..b7f4ea1 100644 --- a/Debugger/debug_macros.h +++ b/Debugger/debug_macros.h @@ -148,18 +148,18 @@ _dbg_stpcpy r0, r1, r2 .endm -/* _dbg_outputMsgStatusErr +/* __dbg_outputErrMsg + * Internal Routine called to generate error messages * Return Message with Error ('-$ENN') status * On entry: - * R0: error code + * R1: error code * On exit: * R0: Pointer to Output Buffer ASCIIZ location * R1: destroyed * R2: destroyed * R3: destroyed */ - .macro _dbg_outputMsgStatusErr - mov r1, r0 + .macro __dbg_outputErrMsg ldr r0, =debug_OutMsgBuf ldr r2, =debug_ErrorResponsePrefix _dbg_stpcpy r0, r2, r3 @@ -167,6 +167,21 @@ _asciiz r0, r1 .endm +/* _dbg_outputMsgStatusErr + * Return Message with Error ('-$ENN') status + * On entry: + * R0: error code + * On exit: + * R0: Pointer to Output Buffer ASCIIZ location + * R1: destroyed + * R2: destroyed + * R3: destroyed + */ + .macro _dbg_outputMsgStatusErr + mov r1, r0 + __dbg_outputErrMsg + .endm + /* _dbg_outputMsgStatusErrCode * Return Message with Error ('-$ENN') status * On exit: @@ -175,12 +190,8 @@ * R2: destroyed */ .macro _dbg_outputMsgStatusErrCode errcode - ldr r0, =debug_OutMsgBuf - ldr r1, =debug_ErrorResponsePrefix - _dbg_stpcpy r0, r1, r2 mov r1, #\errcode - bl byte2ascii /* R0 points to buffer position after byte value */ - _asciiz r0, r1 + __dbg_outputErrMsg .endm /* _dbg_outputMsgStatusSig diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index c9b9ad7..942d56c 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -661,9 +661,8 @@ __dbg__procCmdOk: * */ __dbg__procCmdParamError: - _dbg_outputMsgStatusErrCode MSG_UNKNOWNPARAM - b __dbg__sendDebugMsgExit - + mov r1, #MSG_UNKNOWNPARAM + b __dbg__procErrorMsg /* __dbg__procCmdReturnInputLengthError * Common subroutine exit stub to handle Command Input Length Error for Command Handlers @@ -671,8 +670,8 @@ __dbg__procCmdParamError: * */ __dbg__procCmdReturnInputLengthError: - _dbg_outputMsgStatusErrCode MSG_ERRINLENGTH - b __dbg__sendDebugMsgExit + mov r1, #MSG_ERRINLENGTH + b __dbg__procErrorMsg /* __dbg__procCmdReturnOutputLengthError * Common subroutine exit stub to handle Command Return Output Error for Command Handlers @@ -680,8 +679,8 @@ __dbg__procCmdReturnInputLengthError: * */ __dbg__procCmdReturnOutputLengthError: - _dbg_outputMsgStatusErrCode MSG_ERROUTLENGTH - b __dbg__sendDebugMsgExit + mov r1, #MSG_ERROUTLENGTH + b __dbg__procErrorMsg /* __dbg__procBreakpointAddrError * Common subroutine exit stub to handle Breakpoint Address Error for Breakpoint Insert/Remove Handlers @@ -689,7 +688,21 @@ __dbg__procCmdReturnOutputLengthError: * */ __dbg__procBreakpointAddrError: - _dbg_outputMsgStatusErrCode MSG_UNKNOWNBRKPT + mov r1, #MSG_UNKNOWNBRKPT + b __dbg__procErrorMsg + +/* __dbg__procUnimplementedError + * Common subroutine exit stub to handle Unimplemented GDB Command Error + * DO NOT CALL THIS STUB DIRECTLY! It Assumes that the return address is in the stack. + * + */ +__dbg__procUnimplementedError: + mov r1, #MSG_ERRIMPL + /* b __dbg__procErrorMsg */ + +__dbg__procErrorMsg: + __dbg_outputErrMsg + /* b __dbg__sendDebugMsgExit */ __dbg__sendDebugMsgExit: bl dbg__putDebugMsg /* Send error response to the GDB server */ @@ -844,9 +857,7 @@ _dbg__cmd_SetAllRegs: */ _dbg__nop: stmfd sp!, {lr} - _dbg_outputMsgStatusErrCode MSG_ERRIMPL /* Stub, not implemented yet */ - bl dbg__putDebugMsg /* Send error response to the GDB server */ - ldmfd sp!, {pc} + b __dbg__procUnimplementedError /* _dbg__cmd_ReadMem * Read Memory Contents Command Handler -- cgit v1.2.3