Merge pull request #1708 from shygoo/dbg-fix-cmd-syms
[Debugger] Fix symbol display in commands window
This commit is contained in:
commit
28c9118912
|
@ -589,15 +589,16 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput
|
||||||
char* cmdName = strtok((char*)command, "\t");
|
char* cmdName = strtok((char*)command, "\t");
|
||||||
char* cmdArgs = strtok(NULL, "\t");
|
char* cmdArgs = strtok(NULL, "\t");
|
||||||
|
|
||||||
|
CSymbol jalSymbol;
|
||||||
|
|
||||||
// Show subroutine symbol name for JAL target
|
// Show subroutine symbol name for JAL target
|
||||||
if (OpCode.op == R4300i_JAL)
|
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, &jalSymbol))
|
||||||
if (m_Debugger->SymbolTable()->GetSymbolByAddress(targetAddr, &symbol))
|
|
||||||
{
|
{
|
||||||
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;
|
const char* annotation = NULL;
|
||||||
bool bLoadStoreAnnotation = false;
|
bool bLoadStoreAnnotation = false;
|
||||||
|
|
||||||
|
CSymbol memSymbol;
|
||||||
|
|
||||||
if (OpInfo.IsLoadStoreCommand())
|
if (OpInfo.IsLoadStoreCommand())
|
||||||
{
|
{
|
||||||
for (int offset = -4; offset > -24; offset -= 4)
|
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;
|
uint32_t memAddr = (OpCodeTest.immediate << 16) + (short)OpCode.offset;
|
||||||
|
|
||||||
CSymbol symbol;
|
if (m_Debugger->SymbolTable()->GetSymbolByAddress(memAddr, &memSymbol))
|
||||||
if (m_Debugger->SymbolTable()->GetSymbolByAddress(memAddr, &symbol))
|
|
||||||
{
|
{
|
||||||
annotation = symbol.m_Name;
|
annotation = memSymbol.m_Name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -654,10 +656,10 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput
|
||||||
m_CommandList.AddItem(i, CCommandList::COL_PARAMETERS, cmdArgs);
|
m_CommandList.AddItem(i, CCommandList::COL_PARAMETERS, cmdArgs);
|
||||||
|
|
||||||
// Show routine symbol name for this address
|
// Show routine symbol name for this address
|
||||||
CSymbol symbol;
|
CSymbol pcSymbol;
|
||||||
if (m_Debugger->SymbolTable()->GetSymbolByAddress(opAddr, &symbol))
|
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);
|
m_bvAnnotatedLines.push_back(false);
|
||||||
}
|
}
|
||||||
else if (annotation != NULL)
|
else if (annotation != NULL)
|
||||||
|
|
Loading…
Reference in New Issue