Skip to content

Commit

Permalink
Debugger: 2.9.1.8 Changed: Disassembly window now lists symbol labels…
Browse files Browse the repository at this point in the history
… and symbol target address from User2 in orange.
  • Loading branch information
Michaelangel007 committed Jan 4, 2022
1 parent 17686df commit 18b4581
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
10 changes: 9 additions & 1 deletion docs/Debugger_Changelog.txt
@@ -1,6 +1,14 @@
/*

2.9.1.6 Added: Branch instructions now show target address
2.9.1.8 Changed: Disassembly window now lists symbol labels and symbol target address from User2 in orange.
Example:
U 300
SYM @ = 303
300: 20 03 03
2.9.1.7 Added: Extended SYM command to auto-generate symbol names when reverse engineering. NOTE: These symbols will be placed in User2.
Example:
SYM @ = 800 // Alias for: SYM _0800 = 0800
2.9.1.6 Added: Branch instructions now show target address.
2.9.1.5 Added: Disassembly window now shows signed decimal values for immediate values.
2.9.1.4 Changed: Show symbol warnings in Orange, and length of symbols in light blue.
2.9.1.3 Added: DB commanoptionally supports =
Expand Down
2 changes: 1 addition & 1 deletion source/Debugger/Debug.cpp
Expand Up @@ -51,7 +51,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,1,7);
const int DEBUGGER_VERSION = MAKE_VERSION(2,9,1,8);


// Public _________________________________________________________________________________________
Expand Down
6 changes: 3 additions & 3 deletions source/Debugger/Debugger_Disassembler.cpp
Expand Up @@ -275,7 +275,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
const char* pTarget = NULL;
const char* pSymbol = 0;

pSymbol = FindSymbolFromAddress(nTarget);
pSymbol = FindSymbolFromAddress(nTarget, &line_.iTargetTable);

// Data Assembler
if (pData && (!pData->bSymbolLookup))
Expand All @@ -290,7 +290,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)

if (!(bDisasmFormatFlags & DISASM_FORMAT_SYMBOL))
{
pSymbol = FindSymbolFromAddress(nTarget - 1);
pSymbol = FindSymbolFromAddress(nTarget - 1, &line_.iTargetTable);
if (pSymbol)
{
bDisasmFormatFlags |= DISASM_FORMAT_SYMBOL;
Expand All @@ -312,7 +312,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
// nSecondTarget = g_bDebugConfig_DisasmMatchSymbolOffsetMinus1First ? nTarget+1 : nTarget-1;
if (!(bDisasmFormatFlags & DISASM_FORMAT_SYMBOL) || pData)
{
pSymbol = FindSymbolFromAddress(nTarget + 1);
pSymbol = FindSymbolFromAddress(nTarget + 1,&line_.iTargetTable);
if (pSymbol)
{
bDisasmFormatFlags |= DISASM_FORMAT_SYMBOL;
Expand Down
16 changes: 13 additions & 3 deletions source/Debugger/Debugger_Display.cpp
Expand Up @@ -1330,7 +1330,9 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress )
int iOpmode;
int nOpbyte;
DisasmLine_t line;
const char* pSymbol = FindSymbolFromAddress( nBaseAddress );

int iTable = NUM_SYMBOL_TABLES;
const char* pSymbol = FindSymbolFromAddress( nBaseAddress, &iTable );
const char* pMnemonic = NULL;

// Data Disassembler
Expand Down Expand Up @@ -1557,7 +1559,12 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress )
if (pSymbol)
{
if (! bCursorLine)
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_SYMBOL ) );
{
if (iTable == SYMBOLS_USER_2)
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_ADDRESS ) ); // Show user symbols 2 in different color for organization when reverse engineering. Table 1 = known, Table 2 = unknown.
else
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_SYMBOL ) );
}
PrintTextCursorX( pSymbol, linerect );
}

Expand Down Expand Up @@ -1606,7 +1613,10 @@ WORD DrawDisassemblyLine ( int iLine, const WORD nBaseAddress )
{
if (bDisasmFormatFlags & DISASM_FORMAT_SYMBOL)
{
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_SYMBOL ) );
if (line.iTargetTable == SYMBOLS_USER_2)
DebuggerSetColorFG( DebuggerGetColor( FG_INFO_ADDRESS ) ); // Show user symbols 2 in different color for organization when reverse engineering. Table 1 = known, Table 2 = unknown.
else
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_SYMBOL ) );
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions source/Debugger/Debugger_Types.h
Expand Up @@ -960,6 +960,8 @@ const DisasmData_t* pDisasmData; // If != NULL then bytes are marked up as data
char sTargetValue [ CHARS_FOR_ADDRESS ];
// char sTargetAddress[ CHARS_FOR_ADDRESS ];

int iTargetTable; // Which symbol table this appears in if any. See: SYMBOLS_USER_2, DrawDisassemblyLine(), GetDisassemblyLine(), FindSymbolFromAddress()

char sImmediateSignedDec[ 6 ]; // "-128" .. "+127"
char sImmediate[ 4 ]; // 'c'
char nImmediate;
Expand Down

0 comments on commit 18b4581

Please sign in to comment.