forked from ShuriZma/suyu
1
0
Fork 0

citra-qt: Remove callstack widget

Appears to be currently broken, and given the complexity of doing this
for ARM code without debugging information, should probably be left to
an external tool or library. Use the GDB stub instead.

Closes #586
This commit is contained in:
Yuri Kunde Schlesner 2017-05-07 14:44:43 -07:00
parent 47e806b084
commit 4af2a1a3d7
6 changed files with 0 additions and 168 deletions

View File

@ -11,7 +11,6 @@ set(SRCS
configuration/configure_graphics.cpp
configuration/configure_input.cpp
configuration/configure_system.cpp
debugger/callstack.cpp
debugger/graphics/graphics.cpp
debugger/graphics/graphics_breakpoint_observer.cpp
debugger/graphics/graphics_breakpoints.cpp
@ -42,7 +41,6 @@ set(HEADERS
configuration/configure_graphics.h
configuration/configure_input.h
configuration/configure_system.h
debugger/callstack.h
debugger/graphics/graphics.h
debugger/graphics/graphics_breakpoint_observer.h
debugger/graphics/graphics_breakpoints.h
@ -72,7 +70,6 @@ set(UIS
configuration/configure_graphics.ui
configuration/configure_input.ui
configuration/configure_system.ui
debugger/callstack.ui
debugger/registers.ui
hotkeys.ui
main.ui

View File

@ -1,85 +0,0 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <QStandardItemModel>
#include "citra_qt/debugger/callstack.h"
#include "common/common_types.h"
#include "common/symbols.h"
#include "core/arm/arm_interface.h"
#include "core/arm/disassembler/arm_disasm.h"
#include "core/core.h"
#include "core/memory.h"
CallstackWidget::CallstackWidget(QWidget* parent) : QDockWidget(parent) {
ui.setupUi(this);
callstack_model = new QStandardItemModel(this);
callstack_model->setColumnCount(4);
callstack_model->setHeaderData(0, Qt::Horizontal, "Stack Pointer");
callstack_model->setHeaderData(2, Qt::Horizontal, "Return Address");
callstack_model->setHeaderData(1, Qt::Horizontal, "Call Address");
callstack_model->setHeaderData(3, Qt::Horizontal, "Function");
ui.treeView->setModel(callstack_model);
}
void CallstackWidget::OnDebugModeEntered() {
// Stack pointer
const u32 sp = Core::CPU().GetReg(13);
Clear();
int counter = 0;
for (u32 addr = 0x10000000; addr >= sp; addr -= 4) {
if (!Memory::IsValidVirtualAddress(addr))
break;
const u32 ret_addr = Memory::Read32(addr);
const u32 call_addr = ret_addr - 4; // get call address???
if (!Memory::IsValidVirtualAddress(call_addr))
break;
/* TODO (mattvail) clean me, move to debugger interface */
u32 insn = Memory::Read32(call_addr);
if (ARM_Disasm::Decode(insn) == OP_BL) {
std::string name;
// ripped from disasm
u32 i_offset = insn & 0xffffff;
// Sign-extend the 24-bit offset
if ((i_offset >> 23) & 1)
i_offset |= 0xff000000;
// Pre-compute the left-shift and the prefetch offset
i_offset <<= 2;
i_offset += 8;
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'))));
callstack_model->setItem(counter, 2, new QStandardItem(QString("0x%1").arg(
call_addr, 8, 16, QLatin1Char('0'))));
name = Symbols::HasSymbol(func_addr) ? Symbols::GetSymbol(func_addr).name : "unknown";
callstack_model->setItem(
counter, 3, new QStandardItem(
QString("%1_%2")
.arg(QString::fromStdString(name))
.arg(QString("0x%1").arg(func_addr, 8, 16, QLatin1Char('0')))));
counter++;
}
}
}
void CallstackWidget::OnDebugModeLeft() {}
void CallstackWidget::Clear() {
for (int row = 0; row < callstack_model->rowCount(); row++) {
for (int column = 0; column < callstack_model->columnCount(); column++) {
callstack_model->setItem(row, column, new QStandardItem());
}
}
}

View File

@ -1,28 +0,0 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <QDockWidget>
#include "ui_callstack.h"
class QStandardItemModel;
class CallstackWidget : public QDockWidget {
Q_OBJECT
public:
explicit CallstackWidget(QWidget* parent = nullptr);
public slots:
void OnDebugModeEntered();
void OnDebugModeLeft();
private:
Ui::CallStack ui;
QStandardItemModel* callstack_model;
/// Clears the callstack widget while keeping the column widths the same
void Clear();
};

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CallStack</class>
<widget class="QDockWidget" name="CallStack">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Call Stack</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTreeView" name="treeView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -16,7 +16,6 @@
#include "citra_qt/bootmanager.h"
#include "citra_qt/configuration/config.h"
#include "citra_qt/configuration/configure_dialog.h"
#include "citra_qt/debugger/callstack.h"
#include "citra_qt/debugger/graphics/graphics.h"
#include "citra_qt/debugger/graphics/graphics_breakpoints.h"
#include "citra_qt/debugger/graphics/graphics_cmdlists.h"
@ -138,11 +137,6 @@ void GMainWindow::InitializeDebugWidgets() {
connect(this, &GMainWindow::EmulationStopping, registersWidget,
&RegistersWidget::OnEmulationStopping);
callstackWidget = new CallstackWidget(this);
addDockWidget(Qt::RightDockWidgetArea, callstackWidget);
callstackWidget->hide();
debug_menu->addAction(callstackWidget->toggleViewAction());
graphicsWidget = new GPUCommandStreamWidget(this);
addDockWidget(Qt::RightDockWidgetArea, graphicsWidget);
graphicsWidget->hide();
@ -383,20 +377,15 @@ void GMainWindow::BootGame(const QString& filename) {
// before the CPU continues
connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget,
SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
connect(emu_thread.get(), SIGNAL(DebugModeEntered()), callstackWidget,
SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
connect(emu_thread.get(), SIGNAL(DebugModeEntered()), waitTreeWidget,
SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
connect(emu_thread.get(), SIGNAL(DebugModeLeft()), registersWidget, SLOT(OnDebugModeLeft()),
Qt::BlockingQueuedConnection);
connect(emu_thread.get(), SIGNAL(DebugModeLeft()), callstackWidget, SLOT(OnDebugModeLeft()),
Qt::BlockingQueuedConnection);
connect(emu_thread.get(), SIGNAL(DebugModeLeft()), waitTreeWidget, SLOT(OnDebugModeLeft()),
Qt::BlockingQueuedConnection);
// Update the GUI
registersWidget->OnDebugModeEntered();
callstackWidget->OnDebugModeEntered();
if (ui.action_Single_Window_Mode->isChecked()) {
game_list->hide();
}

View File

@ -10,7 +10,6 @@
#include <QTimer>
#include "ui_main.h"
class CallstackWidget;
class Config;
class EmuThread;
class GameList;
@ -152,7 +151,6 @@ private:
ProfilerWidget* profilerWidget;
MicroProfileDialog* microProfileDialog;
RegistersWidget* registersWidget;
CallstackWidget* callstackWidget;
GPUCommandStreamWidget* graphicsWidget;
GPUCommandListWidget* graphicsCommandsWidget;
GraphicsBreakPointsWidget* graphicsBreakpointsWidget;