diff --git a/docs/Debugger_Changelog.txt b/docs/Debugger_Changelog.txt index 7d94edb2..d80756b3 100644 --- a/docs/Debugger_Changelog.txt +++ b/docs/Debugger_Changelog.txt @@ -1,4 +1,5 @@ /* +.9 Continuation of 2.8.0.8: Fix overflowing disassembly pane for long symbols .8 Fixed: Inactive Language Card bank now grayed out, main memory no longer double inverse. .7 Fixed: Memory softswitches are now in chronological order, and their background is a dark grey .6 Added: Read/Write for Main/Aux memory now shown diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 45718325..2a439081 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -49,7 +49,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,9,0,8); + const int DEBUGGER_VERSION = MAKE_VERSION(2,9,0,9); // Public _________________________________________________________________________________________ diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index 3df95596..5e5472af 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -2129,12 +2129,53 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress ) if ( !g_bConfigDisasmOpcodesView ) nMaxLen += (MAX_OPCODES*3); - if( nLen >= nMaxLen ) + // 2.9.0.9 Continuation of 2.8.0.8: Fix overflowing disassembly pane for long symbols + int nOverflow = 0; + if (bDisasmFormatFlags & DISASM_FORMAT_OFFSET) + { + if (line.nTargetOffset != 0) + nOverflow++; + + nOverflow += strlen( line.sTargetOffset ); + } + + if (line.bTargetIndirect || line.bTargetX || line.bTargetY) + { + if (line.bTargetX) + nOverflow += 2; + else + if ((line.bTargetY) && (! line.bTargetIndirect)) + nOverflow += 2; + } + + if (line.bTargetIndexed || line.bTargetIndirect) + nOverflow++; + + if (line.bTargetIndexed) + { + if (line.bTargetY) + nOverflow += 2; + } + + if (bDisasmFormatFlags & DISASM_FORMAT_TARGET_POINTER) + { + nOverflow += strlen( line.sTargetPointer ); // '####' + nOverflow ++ ; // ':' + nOverflow += 2; // '##' + nOverflow ++ ; // ' ' + } + + if (bDisasmFormatFlags & DISASM_FORMAT_CHAR) + { + nOverflow += strlen( line.sImmediate ); + } + + if (nLen >= (nMaxLen - nOverflow)) { #if _DEBUG // TODO: Warn on import about long symbol/target names #endif - pTarget[ nMaxLen ] = 0; + pTarget[ nMaxLen - nOverflow ] = 0; } // TODO: FIXME: 2.8.0.7: Allow ctrl characters to show as inverse; i.e. ASC 400:40F