[Debugger] Fix symbol display in commands window

This commit is contained in:
shygoo 2020-02-23 11:28:25 -06:00
parent 617db96317
commit 65b2ecb3bd
1 changed files with 12 additions and 10 deletions

View File

@ -555,15 +555,16 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput
char* cmdName = strtok((char*)command, "\t");
char* cmdArgs = strtok(NULL, "\t");
CSymbol jalSymbol;
// Show subroutine symbol name for JAL target
if (OpCode.op == R4300i_JAL)
{
uint32_t targetAddr = (0x80000000 | (OpCode.target << 2));
uint32_t targetAddr = (m_StartAddress & 0xF0000000) | (OpCode.target << 2);
CSymbol symbol;
if (m_Debugger->SymbolTable()->GetSymbolByAddress(targetAddr, &symbol))
if (m_Debugger->SymbolTable()->GetSymbolByAddress(targetAddr, &jalSymbol))
{
cmdArgs = (char*)symbol.m_Name;
cmdArgs = (char*)jalSymbol.m_Name;
}
}
@ -571,6 +572,8 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput
const char* annotation = NULL;
bool bLoadStoreAnnotation = false;
CSymbol memSymbol;
if (OpInfo.IsLoadStoreCommand())
{
for (int offset = -4; offset > -24; offset -= 4)
@ -594,10 +597,9 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput
uint32_t memAddr = (OpCodeTest.immediate << 16) + (short)OpCode.offset;
CSymbol symbol;
if (m_Debugger->SymbolTable()->GetSymbolByAddress(memAddr, &symbol))
if (m_Debugger->SymbolTable()->GetSymbolByAddress(memAddr, &memSymbol))
{
annotation = symbol.m_Name;
annotation = memSymbol.m_Name;
}
else
{
@ -620,10 +622,10 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput
m_CommandList.AddItem(i, CCommandList::COL_PARAMETERS, cmdArgs);
// Show routine symbol name for this address
CSymbol symbol;
if (m_Debugger->SymbolTable()->GetSymbolByAddress(opAddr, &symbol))
CSymbol pcSymbol;
if (m_Debugger->SymbolTable()->GetSymbolByAddress(opAddr, &pcSymbol))
{
m_CommandList.AddItem(i, CCommandList::COL_SYMBOL, symbol.m_Name);
m_CommandList.AddItem(i, CCommandList::COL_SYMBOL, pcSymbol.m_Name);
m_bvAnnotatedLines.push_back(false);
}
else if (annotation != NULL)