From cf7de38720599b333a7b4b0331756bb490793c47 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Mon, 1 Sep 2014 12:47:43 -0700 Subject: [PATCH] 2.7.0.36 Fixed: empty command was re-triggering previous command. Example: DW 6062, // test --- docs/Debugger_Changelog.txt | 1 + source/Debugger/Debug.cpp | 5 ++++- source/Debugger/Debugger_Parser.cpp | 31 +++++++++++++++++++---------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/docs/Debugger_Changelog.txt b/docs/Debugger_Changelog.txt index 0a31df27..0e1ca133 100644 --- a/docs/Debugger_Changelog.txt +++ b/docs/Debugger_Changelog.txt @@ -2,6 +2,7 @@ 2.8.0.0 Released with AppleWin 1.25 2.7.0.# +.36 Fixed: empty command was re-triggering previous command. Example: DW 6062, // test .35 Added: DW address -- round the length up to even number for convenience. Example: DW 6062 is equivalent to: DW 6062:6063 .34 Fixed: Unified auto-defined name: B_, W_, T_ for byte, word, or text respectively .33 Fixed: ASC range -- auto-define symbol name: T_#### diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index f39dce33..71b6984f 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -6999,7 +6999,6 @@ Update_t ExecuteCommand (int nArgs) int nFound = FindCommand( pCommand, pFunction ); // int nCookMask = (1 << NUM_TOKENS) - 1; // ArgToken_e used as bit mask! - // BUGFIX: commands that are also valid hex addresses // ####:# [#] @@ -7008,6 +7007,8 @@ Update_t ExecuteCommand (int nArgs) if ((! nFound) || (nLen < 6)) { + // 2.7.0.36 Fixed: empty command was re-triggering previous command. Example: DW 6062, // test + if ( nLen > 0 ) { // verify pCommand[ 0 .. (nLen-1) ] are hex digits bool bIsHex = true; @@ -7175,6 +7176,8 @@ Update_t ExecuteCommand (int nArgs) // addr1 [addr2] -> display byte at address // MDB memory display byte (is deprecated, so can be re-used) } + } else { + return UPDATE_CONSOLE_DISPLAY; } } diff --git a/source/Debugger/Debugger_Parser.cpp b/source/Debugger/Debugger_Parser.cpp index 4fcd9d7a..d1f537f0 100644 --- a/source/Debugger/Debugger_Parser.cpp +++ b/source/Debugger/Debugger_Parser.cpp @@ -168,24 +168,33 @@ int _Args_Insert( int iSrc, int iEnd, int nLen ) } +static void ClearArg( Arg_t *pArg ) +{ + pArg->sArg[0] = 0; + pArg->nArgLen = 0; + pArg->bSymbol = false; + pArg->eDevice = NUM_DEVICES; // none + pArg->eToken = NO_TOKEN ; // none + pArg->bType = TYPE_STRING; + pArg->nValue = 0; +#if DEBUG_VAL_2 + pArg->nVal2 = 0; +#endif +} + //=========================================================================== void ArgsClear () { Arg_t *pArg = &g_aArgs[0]; + Arg_t *pRaw = &g_aArgRaw[0]; for (int iArg = 0; iArg < MAX_ARGS; iArg++ ) { - pArg->bSymbol = false; - pArg->eDevice = NUM_DEVICES; // none - pArg->eToken = NO_TOKEN ; // none - pArg->bType = TYPE_STRING; - pArg->nValue = 0; -#if DEBUG_VAL_2 - pArg->nVal2 = 0; -#endif - pArg->sArg[0] = 0; + ClearArg( pArg ); + ClearArg( pRaw ); pArg++; + pRaw++; } } @@ -219,7 +228,7 @@ bool ArgsGetImmediateValue ( Arg_t *pArg, WORD * pAddressValue_ ) return false; } -// Processes the raw args, turning them into tokens and types. +// Read console input, process the raw args, turning them into tokens and types. //=========================================================================== int ArgsGet ( TCHAR * pInput ) { @@ -262,7 +271,7 @@ int ArgsGet ( TCHAR * pInput ) } if (iTokenSrc == TOKEN_COMMENT_EOL) - break; + break; //pArg->eToken = iTokenSrc; if (iTokenSrc == NO_TOKEN) {