|
|
|
@ -29,18 +29,16 @@ CallstackWidget::CallstackWidget(QWidget* parent): QDockWidget(parent)
|
|
|
|
|
|
|
|
|
|
void CallstackWidget::OnDebugModeEntered()
|
|
|
|
|
{
|
|
|
|
|
ARM_Interface* app_core = Core::g_app_core;
|
|
|
|
|
|
|
|
|
|
u32 sp = app_core->GetReg(13); //stack pointer
|
|
|
|
|
u32 ret_addr, call_addr, func_addr;
|
|
|
|
|
// Stack pointer
|
|
|
|
|
const u32 sp = Core::g_app_core->GetReg(13);
|
|
|
|
|
|
|
|
|
|
Clear();
|
|
|
|
|
|
|
|
|
|
int counter = 0;
|
|
|
|
|
for (u32 addr = 0x10000000; addr >= sp; addr -= 4)
|
|
|
|
|
{
|
|
|
|
|
ret_addr = Memory::Read32(addr);
|
|
|
|
|
call_addr = ret_addr - 4; //get call address???
|
|
|
|
|
const u32 ret_addr = Memory::Read32(addr);
|
|
|
|
|
const u32 call_addr = ret_addr - 4; //get call address???
|
|
|
|
|
|
|
|
|
|
if (Memory::GetPointer(call_addr) == nullptr)
|
|
|
|
|
break;
|
|
|
|
@ -60,7 +58,7 @@ void CallstackWidget::OnDebugModeEntered()
|
|
|
|
|
// Pre-compute the left-shift and the prefetch offset
|
|
|
|
|
i_offset <<= 2;
|
|
|
|
|
i_offset += 8;
|
|
|
|
|
func_addr = call_addr + i_offset;
|
|
|
|
|
const u32 func_addr = call_addr + i_offset;
|
|
|
|
|
|
|
|
|
|
callstack_model->setItem(counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0'))));
|
|
|
|
|
callstack_model->setItem(counter, 1, new QStandardItem(QString("0x%1").arg(ret_addr, 8, 16, QLatin1Char('0'))));
|
|
|
|
|