summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/callstack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/debugger/callstack.cpp')
-rw-r--r--src/citra_qt/debugger/callstack.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp
index d45eed179..793944639 100644
--- a/src/citra_qt/debugger/callstack.cpp
+++ b/src/citra_qt/debugger/callstack.cpp
@@ -29,18 +29,16 @@ CallstackWidget::CallstackWidget(QWidget* parent): QDockWidget(parent)
29 29
30void CallstackWidget::OnDebugModeEntered() 30void CallstackWidget::OnDebugModeEntered()
31{ 31{
32 ARM_Interface* app_core = Core::g_app_core; 32 // Stack pointer
33 33 const u32 sp = Core::g_app_core->GetReg(13);
34 u32 sp = app_core->GetReg(13); //stack pointer
35 u32 ret_addr, call_addr, func_addr;
36 34
37 Clear(); 35 Clear();
38 36
39 int counter = 0; 37 int counter = 0;
40 for (u32 addr = 0x10000000; addr >= sp; addr -= 4) 38 for (u32 addr = 0x10000000; addr >= sp; addr -= 4)
41 { 39 {
42 ret_addr = Memory::Read32(addr); 40 const u32 ret_addr = Memory::Read32(addr);
43 call_addr = ret_addr - 4; //get call address??? 41 const u32 call_addr = ret_addr - 4; //get call address???
44 42
45 if (Memory::GetPointer(call_addr) == nullptr) 43 if (Memory::GetPointer(call_addr) == nullptr)
46 break; 44 break;
@@ -60,7 +58,7 @@ void CallstackWidget::OnDebugModeEntered()
60 // Pre-compute the left-shift and the prefetch offset 58 // Pre-compute the left-shift and the prefetch offset
61 i_offset <<= 2; 59 i_offset <<= 2;
62 i_offset += 8; 60 i_offset += 8;
63 func_addr = call_addr + i_offset; 61 const u32 func_addr = call_addr + i_offset;
64 62
65 callstack_model->setItem(counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0')))); 63 callstack_model->setItem(counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0'))));
66 callstack_model->setItem(counter, 1, new QStandardItem(QString("0x%1").arg(ret_addr, 8, 16, QLatin1Char('0')))); 64 callstack_model->setItem(counter, 1, new QStandardItem(QString("0x%1").arg(ret_addr, 8, 16, QLatin1Char('0'))));