Merge pull request #1708 from shygoo/dbg-fix-cmd-syms

[Debugger] Fix symbol display in commands window
This commit is contained in:
zilmar 2020-02-24 09:59:01 +10:30 committed by GitHub
commit 28c9118912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 10 deletions

View File

@ -589,15 +589,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;
}
}
@ -605,6 +606,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)
@ -628,10 +631,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
{
@ -654,10 +656,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)