diff --git a/docs/Debugger_Changelog.txt b/docs/Debugger_Changelog.txt index 0e1ca133..83174e5b 100644 --- a/docs/Debugger_Changelog.txt +++ b/docs/Debugger_Changelog.txt @@ -1,4 +1,7 @@ /* + + .1 Fixe: Symbolic Targets > 20 chars no longer overflow into register window + 2.8.0.0 Released with AppleWin 1.25 2.7.0.# diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 6c58a52a..92b7e7f9 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -47,7 +47,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define ALLOW_INPUT_LOWERCASE 1 // See /docs/Debugger_Changelog.txt for full details - const int DEBUGGER_VERSION = MAKE_VERSION(2,8,0,0); + const int DEBUGGER_VERSION = MAKE_VERSION(2,8,0,1); // Public _________________________________________________________________________________________ diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index 431f7e63..e0b88ed1 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -2041,6 +2041,8 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress ) } char *pTarget = line.sTarget; + int nLen = strlen( pTarget ); + if (*pTarget == '$') { pTarget++; @@ -2068,6 +2070,24 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress ) } } } + + // https://github.com/AppleWin/AppleWin/issues/227 + // (Debugger)[1.25] AppleSoft symbol: COPY.FAC.TO.ARG.ROUNDED overflows into registers + // Repro: + // UEA39 + // 2.8.0.1 Clamp excessive symbol target to not overflow + // SYM COPY.FAC.TO.ARG.ROUNDED = EB63 + // If opcodes aren't showing then length can be longer! + // FormatOpcodeBytes() uses 3 chars/MAX_OPCODES. i.e. "## " + int nMaxLen = g_bConfigDisasmOpcodesView ? MAX_TARGET_LEN : MAX_TARGET_LEN + (MAX_OPCODES*3); + if( nLen >= nMaxLen ) + { +#if _DEBUG + // TODO: Warn on import about long symbol/target names +#endif + pTarget[ nMaxLen ] = 0; + } + PrintTextCursorX( pTarget, linerect ); // PrintTextCursorX( " ", linerect ); diff --git a/source/Debugger/Debugger_Types.h b/source/Debugger/Debugger_Types.h index 8ceffeab..c3871396 100644 --- a/source/Debugger/Debugger_Types.h +++ b/source/Debugger/Debugger_Types.h @@ -886,12 +886,13 @@ , NUM_DISASM_TARGET_TYPES }; - enum DisasmText_e + enum DisasmDisplay_e // TODO: Prefix enums with DISASM_DISPLAY_ { MAX_ADDRESS_LEN = 40, - MAX_OPCODES = 3, // only display 3 opcode bytes + MAX_OPCODES = 3, // only display 3 opcode bytes -- See FormatOpcodeBytes() // TODO: FIX when showing data hex CHARS_FOR_ADDRESS = 8, // 4 digits + end-of-string + padding MAX_IMMEDIATE_LEN = 20, // Data Disassembly + MAX_TARGET_LEN = MAX_IMMEDIATE_LEN, // Debugger Display: pTarget = line.sTarget }; struct DisasmLine_t