From c459f880d4a63516664434c0da480905e4481400 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Wed, 20 Jul 2011 11:43:49 +0800 Subject: refactoring of message copying macros Cleaned up macros used to copy debug messages to output buffers --- Debugger/debug_stub.S | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'Debugger/debug_stub.S') diff --git a/Debugger/debug_stub.S b/Debugger/debug_stub.S index 1b0ef8c..cbb253a 100644 --- a/Debugger/debug_stub.S +++ b/Debugger/debug_stub.S @@ -254,6 +254,11 @@ debug_OkResponse: debug_ThreadIDResponse: .byte '+','$','Q','C','0',0 /* 0: Any thread */ +debug_FirstThreadInfoResponse: + .byte '+','$','m','0',0 /* 0: One default thread */ +debug_SubsequentThreadInfoResponse: + .byte '+','$','l',0 /* End of Thread List */ + /* The CmdIndexTable and CmdJumpTable must be kept in sync */ debug_cmdIndexTable: .byte 'g','G','p','P','m','M','D','c','s','k','z','Z','?','q','Q',0 @@ -693,11 +698,11 @@ __dbg__procCmdReturnOutputLengthError: */ __dbg__procBreakpointAddrError: mov r1, #MSG_UNKNOWNBRKPT - b __dbg__procErrorMsg +/* b __dbg__procErrorMsg */ __dbg__procErrorMsg: - __dbg_outputErrMsg + _dbg_outputMsgStatusErr /* b __dbg__sendDebugMsgExit */ __dbg__sendDebugMsgExit: @@ -743,15 +748,31 @@ _dbg__cmd_Query: _dbg_setstate DBG_CONFIGURED /* We have exchanged query messages with the GDB server */ ldmfd sp!, {r0, r1} /* Restore parameters needed for subsequent processing */ bl __dbg__cmdParamLen - cmp r1, #CMD_QUERY_CURRTID_PARAMLEN - bne _dbg__cmd_Query_default + cmp r1, #CMD_QUERY_MINPARAMLEN + beq _dbg__cmd_Query_default -_dbg__cmd_Query_check: ldrb r2, [r0] /* Get First Query Param Char */ +_dbg__cmd_Query_check_C: teq r2, #CMD_QUERY_CURRTID_CHAR /* Handle Current Thread ID Query */ + bne _dbg__cmd_Query_check_fThreadInfo + cmp r1, #CMD_QUERY_CURRTID_PARAMLEN bne _dbg__cmd_Query_default _dbg_outputMsgCurrTID b __dbg__sendDebugMsgExit +_dbg__cmd_Query_check_fThreadInfo: + teq r2, #CMD_QUERY_FTINFO_CHAR /* Handle fThreadInfo Query */ + bne _dbg__cmd_Query_check_sThreadInfo + cmp r1, #CMD_QUERY_FTINFO_PARAMLEN + bne _dbg__cmd_Query_default + _dbg_outputMsgFirstThreadInfo + b __dbg__sendDebugMsgExit +_dbg__cmd_Query_check_sThreadInfo: + teq r2, #CMD_QUERY_STINFO_CHAR /* Handle sThreadInfo ID Query */ + bne _dbg__cmd_Query_default + cmp r1, #CMD_QUERY_STINFO_PARAMLEN + bne _dbg__cmd_Query_default + _dbg_outputMsgSubsequentThreadInfo + b __dbg__sendDebugMsgExit _dbg__cmd_Query_default: b __dbg__procUnimplementedError /* FIXME: return an empty message to GDB (no modifiable settings) */ -- cgit v1.2.3