From e5f09b8be65c06927164428b5d400024e2388dbc Mon Sep 17 00:00:00 2001 From: Mathieu Vaillancourt Date: Fri, 18 Apr 2014 18:30:53 -0400 Subject: UI/debugger changes --- src/citra_qt/callstack.cpp | 36 -------- src/citra_qt/callstack.hxx | 20 ---- src/citra_qt/callstack.ui | 36 -------- src/citra_qt/citra_qt.vcxproj | 35 +++---- src/citra_qt/citra_qt.vcxproj.filters | 60 +++++------- src/citra_qt/cpu_regs.cpp | 63 ------------- src/citra_qt/cpu_regs.hxx | 27 ------ src/citra_qt/cpu_regs.ui | 40 -------- src/citra_qt/debugger/callstack.cpp | 66 ++++++++++++++ src/citra_qt/debugger/callstack.hxx | 19 ++++ src/citra_qt/debugger/callstack.ui | 36 ++++++++ src/citra_qt/debugger/disassembler.cpp | 161 +++++++++++++++++++++++++++++++++ src/citra_qt/debugger/disassembler.hxx | 42 +++++++++ src/citra_qt/debugger/disassembler.ui | 88 ++++++++++++++++++ src/citra_qt/debugger/ramview.cpp | 13 +++ src/citra_qt/debugger/ramview.hxx | 12 +++ src/citra_qt/debugger/registers.cpp | 63 +++++++++++++ src/citra_qt/debugger/registers.hxx | 25 +++++ src/citra_qt/debugger/registers.ui | 40 ++++++++ src/citra_qt/disasm.cpp | 143 ----------------------------- src/citra_qt/disasm.hxx | 42 --------- src/citra_qt/disasm.ui | 78 ---------------- src/citra_qt/main.cpp | 39 ++++---- src/citra_qt/main.hxx | 11 ++- src/citra_qt/ramview.cpp | 13 --- src/citra_qt/ramview.hxx | 12 --- src/citra_qt/ui_cpu_regs.h | 69 -------------- src/citra_qt/ui_disasm.h | 112 ----------------------- src/citra_qt/ui_disassembler.h | 120 ++++++++++++++++++++++++ src/citra_qt/ui_registers.h | 69 ++++++++++++++ 30 files changed, 821 insertions(+), 769 deletions(-) delete mode 100644 src/citra_qt/callstack.cpp delete mode 100644 src/citra_qt/callstack.hxx delete mode 100644 src/citra_qt/callstack.ui delete mode 100644 src/citra_qt/cpu_regs.cpp delete mode 100644 src/citra_qt/cpu_regs.hxx delete mode 100644 src/citra_qt/cpu_regs.ui create mode 100644 src/citra_qt/debugger/callstack.cpp create mode 100644 src/citra_qt/debugger/callstack.hxx create mode 100644 src/citra_qt/debugger/callstack.ui create mode 100644 src/citra_qt/debugger/disassembler.cpp create mode 100644 src/citra_qt/debugger/disassembler.hxx create mode 100644 src/citra_qt/debugger/disassembler.ui create mode 100644 src/citra_qt/debugger/ramview.cpp create mode 100644 src/citra_qt/debugger/ramview.hxx create mode 100644 src/citra_qt/debugger/registers.cpp create mode 100644 src/citra_qt/debugger/registers.hxx create mode 100644 src/citra_qt/debugger/registers.ui delete mode 100644 src/citra_qt/disasm.cpp delete mode 100644 src/citra_qt/disasm.hxx delete mode 100644 src/citra_qt/disasm.ui delete mode 100644 src/citra_qt/ramview.cpp delete mode 100644 src/citra_qt/ramview.hxx delete mode 100644 src/citra_qt/ui_cpu_regs.h delete mode 100644 src/citra_qt/ui_disasm.h create mode 100644 src/citra_qt/ui_disassembler.h create mode 100644 src/citra_qt/ui_registers.h diff --git a/src/citra_qt/callstack.cpp b/src/citra_qt/callstack.cpp deleted file mode 100644 index 2d62cb0d0..000000000 --- a/src/citra_qt/callstack.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include "callstack.hxx" - -//#include "debugger/debugger.h" - -GCallstackView::GCallstackView(QWidget* parent): QDockWidget(parent) -{ - ui.setupUi(this); - - callstack_model = new QStandardItemModel(this); - callstack_model->setColumnCount(3); - callstack_model->setHeaderData(0, Qt::Horizontal, "Depth"); - callstack_model->setHeaderData(1, Qt::Horizontal, "Address"); - callstack_model->setHeaderData(2, Qt::Horizontal, "Function Name"); - ui.treeView->setModel(callstack_model); - - // TODO: Make single clicking a callstack entry jump to the corresponding disassembly position -} - -void GCallstackView::OnCPUStepped() -{ - /* - Debugger::Callstack callstack; - Debugger::GetCallstack(callstack); - callstack_model->setRowCount(callstack.size()); - - for (int i = 0; i < callstack.size(); ++i) - for (Debugger::CallstackIterator it = callstack.begin(); it != callstack.end(); ++it) - { - Debugger::CallstackEntry entry = callstack[i]; - callstack_model->setItem(i, 0, new QStandardItem(QString("%1").arg(i+1))); - callstack_model->setItem(i, 1, new QStandardItem(QString("0x%1").arg(entry.addr, 8, 16, QLatin1Char('0')))); - callstack_model->setItem(i, 2, new QStandardItem(QString::fromStdString(entry.name))); - } - */ -} \ No newline at end of file diff --git a/src/citra_qt/callstack.hxx b/src/citra_qt/callstack.hxx deleted file mode 100644 index 4df1b96d5..000000000 --- a/src/citra_qt/callstack.hxx +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include "ui_callstack.h" -#include "common/platform.h" - -class QStandardItemModel; - -class GCallstackView : public QDockWidget -{ - Q_OBJECT - -public: - GCallstackView(QWidget* parent = 0); - -public slots: - void OnCPUStepped(); - -private: - Ui::CallStack ui; - QStandardItemModel* callstack_model; -}; diff --git a/src/citra_qt/callstack.ui b/src/citra_qt/callstack.ui deleted file mode 100644 index b3c4db632..000000000 --- a/src/citra_qt/callstack.ui +++ /dev/null @@ -1,36 +0,0 @@ - - - CallStack - - - - 0 - 0 - 400 - 300 - - - - Call stack - - - - - - - true - - - false - - - false - - - - - - - - - diff --git a/src/citra_qt/citra_qt.vcxproj b/src/citra_qt/citra_qt.vcxproj index 735f06e5b..3f24bbfbf 100644 --- a/src/citra_qt/citra_qt.vcxproj +++ b/src/citra_qt/citra_qt.vcxproj @@ -127,27 +127,25 @@ - - - - + + + + + - - - - - - - + + + + @@ -164,25 +162,16 @@ - - - - - - - - - - - - + + + diff --git a/src/citra_qt/citra_qt.vcxproj.filters b/src/citra_qt/citra_qt.vcxproj.filters index 5b292c120..2b3838e29 100644 --- a/src/citra_qt/citra_qt.vcxproj.filters +++ b/src/citra_qt/citra_qt.vcxproj.filters @@ -1,15 +1,15 @@  - - {1b8f77c1-61e8-4a9f-95f8-8d1c53015ad8} - {dede739c-939b-4147-9e72-4a326b97d237} {80178741-d3ab-4031-892c-ec58490ea8bf} + + {9495d0e7-87d6-4fe1-92f1-cfa1bbec7025} + @@ -33,16 +33,16 @@ config - + debugger - + debugger - + debugger - + debugger @@ -59,12 +59,23 @@ qhexedit + + + + + debugger + + + debugger + + + debugger + + + debugger + - - - - config @@ -72,27 +83,6 @@ config - - debugger - - - debugger - - - debugger - - - debugger - - - debugger - - - debugger - - - debugger - config @@ -103,13 +93,13 @@ config - + debugger - + debugger - + debugger diff --git a/src/citra_qt/cpu_regs.cpp b/src/citra_qt/cpu_regs.cpp deleted file mode 100644 index 7e54e18b0..000000000 --- a/src/citra_qt/cpu_regs.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "cpu_regs.hxx" - -#include "core/core.h" -#include "core/arm/interpreter/armdefs.h" - -GARM11RegsView::GARM11RegsView(QWidget* parent) : QDockWidget(parent) -{ - cpu_regs_ui.setupUi(this); - - tree = cpu_regs_ui.treeWidget; - tree->addTopLevelItem(registers = new QTreeWidgetItem(QStringList("Registers"))); - tree->addTopLevelItem(CSPR = new QTreeWidgetItem(QStringList("CSPR"))); - - registers->setExpanded(true); - CSPR->setExpanded(true); - - for (int i = 0; i < 16; ++i) - { - QTreeWidgetItem* child = new QTreeWidgetItem(QStringList(QString("R[%1]").arg(i, 2, 10, QLatin1Char('0')))); - registers->addChild(child); - } - - CSPR->addChild(new QTreeWidgetItem(QStringList("M"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("T"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("F"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("I"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("A"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("E"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("IT"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("GE"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("DNM"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("J"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("Q"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("V"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("C"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("Z"))); - CSPR->addChild(new QTreeWidgetItem(QStringList("N"))); -} - -void GARM11RegsView::OnCPUStepped() -{ - ARM_Interface* app_core = Core::g_app_core; - - for (int i = 0; i < 16; ++i) - registers->child(i)->setText(1, QString("0x%1").arg(app_core->GetReg(i), 8, 16, QLatin1Char('0'))); - - CSPR->setText(1, QString("0x%1").arg(app_core->GetCPSR(), 8, 16, QLatin1Char('0'))); - CSPR->child(0)->setText(1, QString("b%1").arg(app_core->GetCPSR() & 0x1F, 5, 2, QLatin1Char('0'))); // M - Mode - CSPR->child(1)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 5) & 0x1)); // T - State - CSPR->child(2)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 6) & 0x1)); // F - FIQ disable - CSPR->child(3)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 7) & 0x1)); // I - IRQ disable - CSPR->child(4)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 8) & 0x1)); // A - Imprecise abort - CSPR->child(5)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 9) & 0x1)); // E - Data endianess - CSPR->child(6)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 10) & 0x3F)); // IT - If-Then state (DNM) - CSPR->child(7)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 16) & 0xF)); // GE - Greater-than-or-Equal - CSPR->child(8)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 20) & 0xF)); // DNM - Do not modify - CSPR->child(9)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 24) & 0x1)); // J - Java state - CSPR->child(10)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 27) & 0x1)); // Q - Sticky overflow - CSPR->child(11)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 28) & 0x1)); // V - Overflow - CSPR->child(12)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 29) & 0x1)); // C - Carry/Borrow/Extend - CSPR->child(13)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 30) & 0x1)); // Z - Zero - CSPR->child(14)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 31) & 0x1)); // N - Negative/Less than -} diff --git a/src/citra_qt/cpu_regs.hxx b/src/citra_qt/cpu_regs.hxx deleted file mode 100644 index 27c194bde..000000000 --- a/src/citra_qt/cpu_regs.hxx +++ /dev/null @@ -1,27 +0,0 @@ -#include "ui_cpu_regs.h" - -#include -#include - -//#include "ui_gekko_regs.h" - -class QTreeWidget; - -class GARM11RegsView : public QDockWidget -{ - Q_OBJECT - -public: - GARM11RegsView(QWidget* parent = NULL); - -public slots: - void OnCPUStepped(); - -private: - Ui::ARMRegisters cpu_regs_ui; - - QTreeWidget* tree; - - QTreeWidgetItem* registers; - QTreeWidgetItem* CSPR; -}; diff --git a/src/citra_qt/cpu_regs.ui b/src/citra_qt/cpu_regs.ui deleted file mode 100644 index 6537c9cd6..000000000 --- a/src/citra_qt/cpu_regs.ui +++ /dev/null @@ -1,40 +0,0 @@ - - - ARMRegisters - - - - 0 - 0 - 400 - 300 - - - - ARM registers - - - - - - - true - - - - Register - - - - - Value - - - - - - - - - - diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp new file mode 100644 index 000000000..f59f2d8c8 --- /dev/null +++ b/src/citra_qt/debugger/callstack.cpp @@ -0,0 +1,66 @@ +#include + +#include "callstack.hxx" + +#include "core/core.h" +#include "core/arm/arm_interface.h" +#include "core/mem_map.h" +#include "common/symbols.h" +#include "core/arm/disassembler/arm_disasm.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::OnCPUStepped() +{ + ARM_Disasm* disasm = new ARM_Disasm(); + ARM_Interface* app_core = Core::g_app_core; + + u32 sp = app_core->GetReg(13); //stack pointer + u32 addr, ret_addr, call_addr, func_addr; + + int counter = 0; + for (int addr = 0x10000000; addr >= sp; addr -= 4) + { + ret_addr = Memory::Read32(addr); + call_addr = ret_addr - 4; //get call address??? + + /* TODO (mattvail) clean me, move to debugger interface */ + u32 insn = Memory::Read32(call_addr); + if (disasm->decode(insn) == OP_BL) + { + std::string name; + // ripped from disasm + uint8_t cond = (insn >> 28) & 0xf; + uint32_t 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; + 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++; + } + } +} \ No newline at end of file diff --git a/src/citra_qt/debugger/callstack.hxx b/src/citra_qt/debugger/callstack.hxx new file mode 100644 index 000000000..3ad2af28b --- /dev/null +++ b/src/citra_qt/debugger/callstack.hxx @@ -0,0 +1,19 @@ +#include +#include "../ui_callstack.h" + +class QStandardItemModel; + +class CallstackWidget : public QDockWidget +{ + Q_OBJECT + +public: + CallstackWidget(QWidget* parent = 0); + +public slots: + void OnCPUStepped(); + +private: + Ui::CallStack ui; + QStandardItemModel* callstack_model; +}; diff --git a/src/citra_qt/debugger/callstack.ui b/src/citra_qt/debugger/callstack.ui new file mode 100644 index 000000000..b3c4db632 --- /dev/null +++ b/src/citra_qt/debugger/callstack.ui @@ -0,0 +1,36 @@ + + + CallStack + + + + 0 + 0 + 400 + 300 + + + + Call stack + + + + + + + true + + + false + + + false + + + + + + + + + diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp new file mode 100644 index 000000000..cc4cb13fa --- /dev/null +++ b/src/citra_qt/debugger/disassembler.cpp @@ -0,0 +1,161 @@ +#include + +#include "disassembler.hxx" + +#include "../bootmanager.hxx" +#include "../hotkeys.hxx" + +#include "common/common.h" +#include "core/mem_map.h" + +#include "core/core.h" +#include "common/break_points.h" +#include "common/symbols.h" +#include "core/arm/interpreter/armdefs.h" +#include "core/arm/disassembler/arm_disasm.h" + +DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread) +{ + disasm_ui.setupUi(this); + + breakpoints = new BreakPoints(); + + model = new QStandardItemModel(this); + model->setColumnCount(3); + disasm_ui.treeView->setModel(model); + disasm_ui.tableView->setModel(model); + RegisterHotkey("Disassembler", "Start/Stop", QKeySequence(Qt::Key_F5), Qt::ApplicationShortcut); + RegisterHotkey("Disassembler", "Step", QKeySequence(Qt::Key_F10), Qt::ApplicationShortcut); + RegisterHotkey("Disassembler", "Step into", QKeySequence(Qt::Key_F11), Qt::ApplicationShortcut); + RegisterHotkey("Disassembler", "Set Breakpoint", QKeySequence(Qt::Key_F9), Qt::ApplicationShortcut); + + connect(disasm_ui.button_breakpoint, SIGNAL(clicked()), this, SLOT(OnSetBreakpoint())); + connect(disasm_ui.button_step, SIGNAL(clicked()), this, SLOT(OnStep())); + connect(disasm_ui.button_pause, SIGNAL(clicked()), this, SLOT(OnPause())); + connect(disasm_ui.button_continue, SIGNAL(clicked()), this, SLOT(OnContinue())); + + connect(GetHotkey("Disassembler", "Start/Stop", this), SIGNAL(activated()), this, SLOT(OnToggleStartStop())); + connect(GetHotkey("Disassembler", "Step", this), SIGNAL(activated()), this, SLOT(OnStep())); + connect(GetHotkey("Disassembler", "Step into", this), SIGNAL(activated()), this, SLOT(OnStepInto())); + connect(GetHotkey("Disassembler", "Set Breakpoint", this), SIGNAL(activated()), this, SLOT(OnSetBreakpoint())); +} + +void DisassemblerWidget::Init() +{ + ARM_Disasm* disasm = new ARM_Disasm(); + + base_addr = Core::g_app_core->GetPC(); + unsigned int curInstAddr = base_addr; + char result[255]; + + for (int i = 0; i < 10000; i++) // fixed for now + { + disasm->disasm(curInstAddr, Memory::Read32(curInstAddr), result); + model->setItem(i, 0, new QStandardItem(QString("0x%1").arg((uint)(curInstAddr), 8, 16, QLatin1Char('0')))); + model->setItem(i, 1, new QStandardItem(QString(result))); + if (Symbols::HasSymbol(curInstAddr)) + { + TSymbol symbol = Symbols::GetSymbol(curInstAddr); + model->setItem(i, 2, new QStandardItem(QString("%1 - Size:%2").arg(QString::fromStdString(symbol.name)) + .arg(symbol.size / 4))); // divide by 4 to get instruction count + + } + curInstAddr += 4; + } + disasm_ui.treeView->resizeColumnToContents(0); + disasm_ui.treeView->resizeColumnToContents(1); + disasm_ui.treeView->resizeColumnToContents(2); + disasm_ui.tableView->resizeColumnToContents(0); + disasm_ui.tableView->resizeColumnToContents(1); + disasm_ui.tableView->resizeColumnToContents(2); + + QModelIndex model_index = model->index(0, 0); + disasm_ui.treeView->scrollTo(model_index); + disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + + disasm_ui.tableView->scrollTo(model_index); + disasm_ui.tableView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); +} + +void DisassemblerWidget::OnSetBreakpoint() +{ + int selected_row = SelectedRow(); + + if (selected_row == -1) + return; + + u32 address = base_addr + (selected_row * 4); + if (breakpoints->IsAddressBreakPoint(address)) + { + breakpoints->Remove(address); + model->item(selected_row, 0)->setBackground(QBrush()); + model->item(selected_row, 1)->setBackground(QBrush()); + } + else + { + breakpoints->Add(address); + model->item(selected_row, 0)->setBackground(QBrush(QColor(0xFF, 0x99, 0x99))); + model->item(selected_row, 1)->setBackground(QBrush(QColor(0xFF, 0x99, 0x99))); + } +} + +void DisassemblerWidget::OnContinue() +{ + emu_thread.SetCpuRunning(true); +} + +void DisassemblerWidget::OnStep() +{ + OnStepInto(); // change later +} + +void DisassemblerWidget::OnStepInto() +{ + emu_thread.SetCpuRunning(false); + emu_thread.ExecStep(); +} + +void DisassemblerWidget::OnPause() +{ + emu_thread.SetCpuRunning(false); +} + +void DisassemblerWidget::OnToggleStartStop() +{ + emu_thread.SetCpuRunning(!emu_thread.IsCpuRunning()); +} + +void DisassemblerWidget::OnCPUStepped() +{ + ARMword next_instr = Core::g_app_core->GetPC(); + + if (breakpoints->IsAddressBreakPoint(next_instr)) + { + emu_thread.SetCpuRunning(false); + } + + unsigned int index = (next_instr - base_addr) / 4; + QModelIndex model_index = model->index(index, 0); + disasm_ui.treeView->scrollTo(model_index); + disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + + disasm_ui.tableView->scrollTo(model_index); + disasm_ui.tableView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + disasm_ui.tableView->selectionModel()->select(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); +} + +int DisassemblerWidget::SelectedRow() +{ + QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex(); + if (!index.isValid()) + return -1; + + return model->itemFromIndex(disasm_ui.treeView->selectionModel()->currentIndex())->row(); +} +/* +void DisassemblerWidget::paintEvent() +{ + QPainter painter(this); + painter.drawRect(10, 10, 50, 50); +} +*/ \ No newline at end of file diff --git a/src/citra_qt/debugger/disassembler.hxx b/src/citra_qt/debugger/disassembler.hxx new file mode 100644 index 000000000..e5b152d20 --- /dev/null +++ b/src/citra_qt/debugger/disassembler.hxx @@ -0,0 +1,42 @@ +#include +#include "../ui_disassembler.h" + +#include "common/common.h" +#include "common/break_points.h" + +class QAction; +class QStandardItemModel; +class EmuThread; + +class DisassemblerWidget : public QDockWidget +{ + Q_OBJECT + +public: + DisassemblerWidget(QWidget* parent, EmuThread& emu_thread); + + void Init(); + +public slots: + void OnSetBreakpoint(); + void OnContinue(); + void OnStep(); + void OnStepInto(); + void OnPause(); + void OnToggleStartStop(); + + void OnCPUStepped(); + +private: + // returns -1 if no row is selected + int SelectedRow(); + + Ui::DockWidget disasm_ui; + QStandardItemModel* model; + + u32 base_addr; + + BreakPoints* breakpoints; + + EmuThread& emu_thread; +}; diff --git a/src/citra_qt/debugger/disassembler.ui b/src/citra_qt/debugger/disassembler.ui new file mode 100644 index 000000000..e65b0aa9b --- /dev/null +++ b/src/citra_qt/debugger/disassembler.ui @@ -0,0 +1,88 @@ + + + DockWidget + + + + 0 + 0 + 430 + 401 + + + + Disassembly + + + + + + + + + Step + + + + + + + Pause + + + + + + + Continue + + + + + + + Step Into + + + + + + + Set Breakpoint + + + + + + + + + true + + + 20 + + + false + + + false + + + + + + + true + + + false + + + + + + + + + diff --git a/src/citra_qt/debugger/ramview.cpp b/src/citra_qt/debugger/ramview.cpp new file mode 100644 index 000000000..3f899b95e --- /dev/null +++ b/src/citra_qt/debugger/ramview.cpp @@ -0,0 +1,13 @@ +#include "ramview.hxx" + +#include "common/common.h" +#include "core/mem_map.h" +GRamView::GRamView(QWidget* parent) : QHexEdit(parent) +{ +} + +void GRamView::OnCPUStepped() +{ + // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams... + //setData(QByteArray((const char*)Mem_RAM,sizeof(Mem_RAM)/8)); +} \ No newline at end of file diff --git a/src/citra_qt/debugger/ramview.hxx b/src/citra_qt/debugger/ramview.hxx new file mode 100644 index 000000000..1db1546aa --- /dev/null +++ b/src/citra_qt/debugger/ramview.hxx @@ -0,0 +1,12 @@ +#include "qhexedit.h" + +class GRamView : public QHexEdit +{ + Q_OBJECT + +public: + GRamView(QWidget* parent = NULL); + +public slots: + void OnCPUStepped(); +}; diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp new file mode 100644 index 000000000..96ceed480 --- /dev/null +++ b/src/citra_qt/debugger/registers.cpp @@ -0,0 +1,63 @@ +#include "registers.hxx" + +#include "core/core.h" +#include "core/arm/arm_interface.h" + +RegistersWidget::RegistersWidget(QWidget* parent) : QDockWidget(parent) +{ + cpu_regs_ui.setupUi(this); + + tree = cpu_regs_ui.treeWidget; + tree->addTopLevelItem(registers = new QTreeWidgetItem(QStringList("Registers"))); + tree->addTopLevelItem(CSPR = new QTreeWidgetItem(QStringList("CSPR"))); + + registers->setExpanded(true); + CSPR->setExpanded(true); + + for (int i = 0; i < 16; ++i) + { + QTreeWidgetItem* child = new QTreeWidgetItem(QStringList(QString("R[%1]").arg(i, 2, 10, QLatin1Char('0')))); + registers->addChild(child); + } + + CSPR->addChild(new QTreeWidgetItem(QStringList("M"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("T"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("F"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("I"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("A"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("E"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("IT"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("GE"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("DNM"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("J"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("Q"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("V"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("C"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("Z"))); + CSPR->addChild(new QTreeWidgetItem(QStringList("N"))); +} + +void RegistersWidget::OnCPUStepped() +{ + ARM_Interface* app_core = Core::g_app_core; + + for (int i = 0; i < 16; ++i) + registers->child(i)->setText(1, QString("0x%1").arg(app_core->GetReg(i), 8, 16, QLatin1Char('0'))); + + CSPR->setText(1, QString("0x%1").arg(app_core->GetCPSR(), 8, 16, QLatin1Char('0'))); + CSPR->child(0)->setText(1, QString("b%1").arg(app_core->GetCPSR() & 0x1F, 5, 2, QLatin1Char('0'))); // M - Mode + CSPR->child(1)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 5) & 0x1)); // T - State + CSPR->child(2)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 6) & 0x1)); // F - FIQ disable + CSPR->child(3)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 7) & 0x1)); // I - IRQ disable + CSPR->child(4)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 8) & 0x1)); // A - Imprecise abort + CSPR->child(5)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 9) & 0x1)); // E - Data endianess + CSPR->child(6)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 10) & 0x3F)); // IT - If-Then state (DNM) + CSPR->child(7)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 16) & 0xF)); // GE - Greater-than-or-Equal + CSPR->child(8)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 20) & 0xF)); // DNM - Do not modify + CSPR->child(9)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 24) & 0x1)); // J - Java state + CSPR->child(10)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 27) & 0x1)); // Q - Sticky overflow + CSPR->child(11)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 28) & 0x1)); // V - Overflow + CSPR->child(12)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 29) & 0x1)); // C - Carry/Borrow/Extend + CSPR->child(13)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 30) & 0x1)); // Z - Zero + CSPR->child(14)->setText(1, QString("%1").arg((app_core->GetCPSR() >> 31) & 0x1)); // N - Negative/Less than +} diff --git a/src/citra_qt/debugger/registers.hxx b/src/citra_qt/debugger/registers.hxx new file mode 100644 index 000000000..318d95820 --- /dev/null +++ b/src/citra_qt/debugger/registers.hxx @@ -0,0 +1,25 @@ +#include "../ui_registers.h" + +#include +#include + +class QTreeWidget; + +class RegistersWidget : public QDockWidget +{ + Q_OBJECT + +public: + RegistersWidget(QWidget* parent = NULL); + +public slots: + void OnCPUStepped(); + +private: + Ui::ARMRegisters cpu_regs_ui; + + QTreeWidget* tree; + + QTreeWidgetItem* registers; + QTreeWidgetItem* CSPR; +}; diff --git a/src/citra_qt/debugger/registers.ui b/src/citra_qt/debugger/registers.ui new file mode 100644 index 000000000..6537c9cd6 --- /dev/null +++ b/src/citra_qt/debugger/registers.ui @@ -0,0 +1,40 @@ + + + ARMRegisters + + + + 0 + 0 + 400 + 300 + + + + ARM registers + + + + + + + true + + + + Register + + + + + Value + + + + + + + + + + diff --git a/src/citra_qt/disasm.cpp b/src/citra_qt/disasm.cpp deleted file mode 100644 index 5f3a6058a..000000000 --- a/src/citra_qt/disasm.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include -#include "ui_disasm.h" -#include "disasm.hxx" - -#include "bootmanager.hxx" -#include "hotkeys.hxx" - -#include "common/common.h" -#include "core/mem_map.h" - -#include "core/core.h" -#include "common/break_points.h" -#include "common/symbols.h" -#include "core/arm/interpreter/armdefs.h" -#include "core/arm/disassembler/arm_disasm.h" - -GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread) -{ - disasm_ui.setupUi(this); - - breakpoints = new BreakPoints(); - - model = new QStandardItemModel(this); - model->setColumnCount(3); - disasm_ui.treeView->setModel(model); - - RegisterHotkey("Disassembler", "Start/Stop", QKeySequence(Qt::Key_F5), Qt::ApplicationShortcut); - RegisterHotkey("Disassembler", "Step", QKeySequence(Qt::Key_F10), Qt::ApplicationShortcut); - RegisterHotkey("Disassembler", "Step into", QKeySequence(Qt::Key_F11), Qt::ApplicationShortcut); - RegisterHotkey("Disassembler", "Set Breakpoint", QKeySequence(Qt::Key_F9), Qt::ApplicationShortcut); - - connect(disasm_ui.button_breakpoint, SIGNAL(clicked()), this, SLOT(OnSetBreakpoint())); - connect(disasm_ui.button_step, SIGNAL(clicked()), this, SLOT(OnStep())); - connect(disasm_ui.button_pause, SIGNAL(clicked()), this, SLOT(OnPause())); - connect(disasm_ui.button_continue, SIGNAL(clicked()), this, SLOT(OnContinue())); - - connect(GetHotkey("Disassembler", "Start/Stop", this), SIGNAL(activated()), this, SLOT(OnToggleStartStop())); - connect(GetHotkey("Disassembler", "Step", this), SIGNAL(activated()), this, SLOT(OnStep())); - connect(GetHotkey("Disassembler", "Step into", this), SIGNAL(activated()), this, SLOT(OnStepInto())); - connect(GetHotkey("Disassembler", "Set Breakpoint", this), SIGNAL(activated()), this, SLOT(OnSetBreakpoint())); -} - -void GDisAsmView::Init() -{ - ARM_Disasm* disasm = new ARM_Disasm(); - - base_addr = Core::g_app_core->GetPC(); - unsigned int curInstAddr = base_addr; - char result[255]; - - for (int i = 0; i < 10000; i++) // fixed for now - { - disasm->disasm(curInstAddr, Memory::Read32(curInstAddr), result); - model->setItem(i, 0, new QStandardItem(QString("0x%1").arg((uint)(curInstAddr), 8, 16, QLatin1Char('0')))); - model->setItem(i, 1, new QStandardItem(QString(result))); - if (Symbols::HasSymbol(curInstAddr)) - { - TSymbol symbol = Symbols::GetSymbol(curInstAddr); - model->setItem(i, 2, new QStandardItem(QString("%1 - Size:%2").arg(QString::fromStdString(symbol.name)) - .arg(symbol.size / 4))); // divide by 4 to get instruction count - - } - curInstAddr += 4; - } - disasm_ui.treeView->resizeColumnToContents(0); - disasm_ui.treeView->resizeColumnToContents(1); - - QModelIndex model_index = model->index(0, 0); - disasm_ui.treeView->scrollTo(model_index); - disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); -} - -void GDisAsmView::OnSetBreakpoint() -{ - int selected_row = SelectedRow(); - - if (selected_row == -1) - return; - - u32 address = base_addr + (selected_row * 4); - if (breakpoints->IsAddressBreakPoint(address)) - { - breakpoints->Remove(address); - model->item(selected_row, 0)->setBackground(QBrush()); - model->item(selected_row, 1)->setBackground(QBrush()); - } - else - { - breakpoints->Add(address); - model->item(selected_row, 0)->setBackground(QBrush(QColor(0xFF, 0x99, 0x99))); - model->item(selected_row, 1)->setBackground(QBrush(QColor(0xFF, 0x99, 0x99))); - } -} - -void GDisAsmView::OnContinue() -{ - emu_thread.SetCpuRunning(true); -} - -void GDisAsmView::OnStep() -{ - OnStepInto(); // change later -} - -void GDisAsmView::OnStepInto() -{ - emu_thread.SetCpuRunning(false); - emu_thread.ExecStep(); -} - -void GDisAsmView::OnPause() -{ - emu_thread.SetCpuRunning(false); -} - -void GDisAsmView::OnToggleStartStop() -{ - emu_thread.SetCpuRunning(!emu_thread.IsCpuRunning()); -} - -void GDisAsmView::OnCPUStepped() -{ - ARMword next_instr = Core::g_app_core->GetPC(); - - if (breakpoints->IsAddressBreakPoint(next_instr)) - { - emu_thread.SetCpuRunning(false); - } - - unsigned int index = (next_instr - base_addr) / 4; - QModelIndex model_index = model->index(index, 0); - disasm_ui.treeView->scrollTo(model_index); - disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); -} - -int GDisAsmView::SelectedRow() -{ - QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex(); - if (!index.isValid()) - return -1; - - return model->itemFromIndex(disasm_ui.treeView->selectionModel()->currentIndex())->row(); -} \ No newline at end of file diff --git a/src/citra_qt/disasm.hxx b/src/citra_qt/disasm.hxx deleted file mode 100644 index 0c5a37cac..000000000 --- a/src/citra_qt/disasm.hxx +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include "ui_disasm.h" - -#include "common/common.h" -#include "common/break_points.h" - -class QAction; -class QStandardItemModel; -class EmuThread; - -class GDisAsmView : public QDockWidget -{ - Q_OBJECT - -public: - GDisAsmView(QWidget* parent, EmuThread& emu_thread); - - void Init(); - -public slots: - void OnSetBreakpoint(); - void OnContinue(); - void OnStep(); - void OnStepInto(); - void OnPause(); - void OnToggleStartStop(); - - void OnCPUStepped(); - -private: - // returns -1 if no row is selected - int SelectedRow(); - - Ui::DockWidget disasm_ui; - QStandardItemModel* model; - - u32 base_addr; - - BreakPoints* breakpoints; - - EmuThread& emu_thread; -}; diff --git a/src/citra_qt/disasm.ui b/src/citra_qt/disasm.ui deleted file mode 100644 index fb3845164..000000000 --- a/src/citra_qt/disasm.ui +++ /dev/null @@ -1,78 +0,0 @@ - - - DockWidget - - - - 0 - 0 - 430 - 401 - - - - Disassembly - - - - - - - - - Step - - - - - - - Pause - - - - - - - Continue - - - - - - - Step Into - - - - - - - Set Breakpoint - - - - - - - - - true - - - 20 - - - false - - - false - - - - - - - - - diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 08fd03b24..f9bf6e881 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -15,10 +15,10 @@ #include "hotkeys.hxx" //debugger -#include "disasm.hxx" -#include "cpu_regs.hxx" -#include "callstack.hxx" -#include "ramview.hxx" +#include "debugger/disassembler.hxx" +#include "debugger/registers.hxx" +#include "debugger/callstack.hxx" +#include "debugger/ramview.hxx" #include "core/system.h" #include "core/loader.h" @@ -36,17 +36,22 @@ GMainWindow::GMainWindow() ui.horizontalLayout->addWidget(render_window); //render_window->hide(); - disasm = new GDisAsmView(this, render_window->GetEmuThread()); - addDockWidget(Qt::BottomDockWidgetArea, disasm); - disasm->hide(); + disasmWidget = new DisassemblerWidget(this, render_window->GetEmuThread()); + addDockWidget(Qt::BottomDockWidgetArea, disasmWidget); + disasmWidget->hide(); - arm_regs = new GARM11RegsView(this); - addDockWidget(Qt::RightDockWidgetArea, arm_regs); - arm_regs->hide(); + registersWidget = new RegistersWidget(this); + addDockWidget(Qt::RightDockWidgetArea, registersWidget); + registersWidget->hide(); + + callstackWidget = new CallstackWidget(this); + addDockWidget(Qt::RightDockWidgetArea, callstackWidget); + callstackWidget->hide(); QMenu* debug_menu = ui.menu_View->addMenu(tr("Debugging")); - debug_menu->addAction(disasm->toggleViewAction()); - debug_menu->addAction(arm_regs->toggleViewAction()); + debug_menu->addAction(disasmWidget->toggleViewAction()); + debug_menu->addAction(registersWidget->toggleViewAction()); + debug_menu->addAction(callstackWidget->toggleViewAction()); // Set default UI state // geometry: 55% of the window contents are in the upper screen half, 45% in the lower half @@ -78,8 +83,9 @@ GMainWindow::GMainWindow() connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog())); // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues - connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), disasm, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); - connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), arm_regs, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); + connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), disasmWidget, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); + connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), registersWidget, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); + connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), callstackWidget, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); // Setup hotkeys RegisterHotkey("Main Window", "Load Image", QKeySequence::Open); @@ -124,8 +130,9 @@ void GMainWindow::BootGame(const char* filename) ERROR_LOG(BOOT, "Failed to load ROM: %s", error_str.c_str()); } - disasm->Init(); - arm_regs->OnCPUStepped(); + disasmWidget->Init(); + registersWidget->OnCPUStepped(); + callstackWidget->OnCPUStepped(); render_window->GetEmuThread().start(); } diff --git a/src/citra_qt/main.hxx b/src/citra_qt/main.hxx index 401705698..77d08f072 100644 --- a/src/citra_qt/main.hxx +++ b/src/citra_qt/main.hxx @@ -7,8 +7,9 @@ class GImageInfo; class GRenderWindow; -class GDisAsmView; -class GARM11RegsView; +class DisassemblerWidget; +class RegistersWidget; +class CallstackWidget; class GMainWindow : public QMainWindow { @@ -44,8 +45,10 @@ private: Ui::MainWindow ui; GRenderWindow* render_window; - GDisAsmView* disasm; - GARM11RegsView* arm_regs; + + DisassemblerWidget* disasmWidget; + RegistersWidget* registersWidget; + CallstackWidget* callstackWidget; }; #endif // _CITRA_QT_MAIN_HXX_ diff --git a/src/citra_qt/ramview.cpp b/src/citra_qt/ramview.cpp deleted file mode 100644 index 3f899b95e..000000000 --- a/src/citra_qt/ramview.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "ramview.hxx" - -#include "common/common.h" -#include "core/mem_map.h" -GRamView::GRamView(QWidget* parent) : QHexEdit(parent) -{ -} - -void GRamView::OnCPUStepped() -{ - // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams... - //setData(QByteArray((const char*)Mem_RAM,sizeof(Mem_RAM)/8)); -} \ No newline at end of file diff --git a/src/citra_qt/ramview.hxx b/src/citra_qt/ramview.hxx deleted file mode 100644 index 1db1546aa..000000000 --- a/src/citra_qt/ramview.hxx +++ /dev/null @@ -1,12 +0,0 @@ -#include "qhexedit.h" - -class GRamView : public QHexEdit -{ - Q_OBJECT - -public: - GRamView(QWidget* parent = NULL); - -public slots: - void OnCPUStepped(); -}; diff --git a/src/citra_qt/ui_cpu_regs.h b/src/citra_qt/ui_cpu_regs.h deleted file mode 100644 index b8a80b3f2..000000000 --- a/src/citra_qt/ui_cpu_regs.h +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'cpu_regs.ui' -** -** Created by: Qt User Interface Compiler version 4.8.5 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_CPU_REGS_H -#define UI_CPU_REGS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_ARMRegisters -{ -public: - QWidget *dockWidgetContents; - QVBoxLayout *verticalLayout; - QTreeWidget *treeWidget; - - void setupUi(QDockWidget *ARMRegisters) - { - if (ARMRegisters->objectName().isEmpty()) - ARMRegisters->setObjectName(QString::fromUtf8("ARMRegisters")); - ARMRegisters->resize(400, 300); - dockWidgetContents = new QWidget(); - dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents")); - verticalLayout = new QVBoxLayout(dockWidgetContents); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); - treeWidget = new QTreeWidget(dockWidgetContents); - treeWidget->setObjectName(QString::fromUtf8("treeWidget")); - treeWidget->setAlternatingRowColors(true); - - verticalLayout->addWidget(treeWidget); - - ARMRegisters->setWidget(dockWidgetContents); - - retranslateUi(ARMRegisters); - - QMetaObject::connectSlotsByName(ARMRegisters); - } // setupUi - - void retranslateUi(QDockWidget *ARMRegisters) - { - ARMRegisters->setWindowTitle(QApplication::translate("ARMRegisters", "ARM registers", 0, QApplication::UnicodeUTF8)); - QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem(); - ___qtreewidgetitem->setText(1, QApplication::translate("ARMRegisters", "Value", 0, QApplication::UnicodeUTF8)); - ___qtreewidgetitem->setText(0, QApplication::translate("ARMRegisters", "Register", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class ARMRegisters: public Ui_ARMRegisters {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_CPU_REGS_H diff --git a/src/citra_qt/ui_disasm.h b/src/citra_qt/ui_disasm.h deleted file mode 100644 index 697a224cb..000000000 --- a/src/citra_qt/ui_disasm.h +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'disasm.ui' -** -** Created by: Qt User Interface Compiler version 4.8.5 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_DISASM_H -#define UI_DISASM_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_DockWidget -{ -public: - QWidget *dockWidgetContents; - QVBoxLayout *verticalLayout; - QHBoxLayout *horizontalLayout; - QPushButton *button_step; - QPushButton *button_pause; - QPushButton *button_continue; - QPushButton *pushButton; - QPushButton *button_breakpoint; - QTreeView *treeView; - - void setupUi(QDockWidget *DockWidget) - { - if (DockWidget->objectName().isEmpty()) - DockWidget->setObjectName(QString::fromUtf8("DockWidget")); - DockWidget->resize(430, 401); - dockWidgetContents = new QWidget(); - dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents")); - verticalLayout = new QVBoxLayout(dockWidgetContents); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); - button_step = new QPushButton(dockWidgetContents); - button_step->setObjectName(QString::fromUtf8("button_step")); - - horizontalLayout->addWidget(button_step); - - button_pause = new QPushButton(dockWidgetContents); - button_pause->setObjectName(QString::fromUtf8("button_pause")); - - horizontalLayout->addWidget(button_pause); - - button_continue = new QPushButton(dockWidgetContents); - button_continue->setObjectName(QString::fromUtf8("button_continue")); - - horizontalLayout->addWidget(button_continue); - - pushButton = new QPushButton(dockWidgetContents); - pushButton->setObjectName(QString::fromUtf8("pushButton")); - - horizontalLayout->addWidget(pushButton); - - button_breakpoint = new QPushButton(dockWidgetContents); - button_breakpoint->setObjectName(QString::fromUtf8("button_breakpoint")); - - horizontalLayout->addWidget(button_breakpoint); - - - verticalLayout->addLayout(horizontalLayout); - - treeView = new QTreeView(dockWidgetContents); - treeView->setObjectName(QString::fromUtf8("treeView")); - treeView->setAlternatingRowColors(true); - treeView->setIndentation(20); - treeView->setRootIsDecorated(false); - treeView->header()->setVisible(false); - - verticalLayout->addWidget(treeView); - - DockWidget->setWidget(dockWidgetContents); - - retranslateUi(DockWidget); - - QMetaObject::connectSlotsByName(DockWidget); - } // setupUi - - void retranslateUi(QDockWidget *DockWidget) - { - DockWidget->setWindowTitle(QApplication::translate("DockWidget", "Disassembly", 0, QApplication::UnicodeUTF8)); - button_step->setText(QApplication::translate("DockWidget", "Step", 0, QApplication::UnicodeUTF8)); - button_pause->setText(QApplication::translate("DockWidget", "Pause", 0, QApplication::UnicodeUTF8)); - button_continue->setText(QApplication::translate("DockWidget", "Continue", 0, QApplication::UnicodeUTF8)); - pushButton->setText(QApplication::translate("DockWidget", "Step Into", 0, QApplication::UnicodeUTF8)); - button_breakpoint->setText(QApplication::translate("DockWidget", "Set Breakpoint", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class DockWidget: public Ui_DockWidget {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_DISASM_H diff --git a/src/citra_qt/ui_disassembler.h b/src/citra_qt/ui_disassembler.h new file mode 100644 index 000000000..a0230fe9c --- /dev/null +++ b/src/citra_qt/ui_disassembler.h @@ -0,0 +1,120 @@ +/******************************************************************************** +** Form generated from reading UI file 'disassembler.ui' +** +** Created by: Qt User Interface Compiler version 4.8.5 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_DISASSEMBLER_H +#define UI_DISASSEMBLER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_DockWidget +{ +public: + QWidget *dockWidgetContents; + QVBoxLayout *verticalLayout; + QHBoxLayout *horizontalLayout; + QPushButton *button_step; + QPushButton *button_pause; + QPushButton *button_continue; + QPushButton *pushButton; + QPushButton *button_breakpoint; + QTreeView *treeView; + QTableView *tableView; + + void setupUi(QDockWidget *DockWidget) + { + if (DockWidget->objectName().isEmpty()) + DockWidget->setObjectName(QString::fromUtf8("DockWidget")); + DockWidget->resize(430, 401); + dockWidgetContents = new QWidget(); + dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents")); + verticalLayout = new QVBoxLayout(dockWidgetContents); + verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + horizontalLayout = new QHBoxLayout(); + horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + button_step = new QPushButton(dockWidgetContents); + button_step->setObjectName(QString::fromUtf8("button_step")); + + horizontalLayout->addWidget(button_step); + + button_pause = new QPushButton(dockWidgetContents); + button_pause->setObjectName(QString::fromUtf8("button_pause")); + + horizontalLayout->addWidget(button_pause); + + button_continue = new QPushButton(dockWidgetContents); + button_continue->setObjectName(QString::fromUtf8("button_continue")); + + horizontalLayout->addWidget(button_continue); + + pushButton = new QPushButton(dockWidgetContents); + pushButton->setObjectName(QString::fromUtf8("pushButton")); + + horizontalLayout->addWidget(pushButton); + + button_breakpoint = new QPushButton(dockWidgetContents); + button_breakpoint->setObjectName(QString::fromUtf8("button_breakpoint")); + + horizontalLayout->addWidget(button_breakpoint); + + + verticalLayout->addLayout(horizontalLayout); + + treeView = new QTreeView(dockWidgetContents); + treeView->setObjectName(QString::fromUtf8("treeView")); + treeView->setAlternatingRowColors(true); + treeView->setIndentation(20); + treeView->setRootIsDecorated(false); + treeView->header()->setVisible(false); + + verticalLayout->addWidget(treeView); + + tableView = new QTableView(dockWidgetContents); + tableView->setObjectName(QString::fromUtf8("tableView")); + tableView->setAlternatingRowColors(true); + + verticalLayout->addWidget(tableView); + + DockWidget->setWidget(dockWidgetContents); + + retranslateUi(DockWidget); + + QMetaObject::connectSlotsByName(DockWidget); + } // setupUi + + void retranslateUi(QDockWidget *DockWidget) + { + DockWidget->setWindowTitle(QApplication::translate("DockWidget", "Disassembly", 0, QApplication::UnicodeUTF8)); + button_step->setText(QApplication::translate("DockWidget", "Step", 0, QApplication::UnicodeUTF8)); + button_pause->setText(QApplication::translate("DockWidget", "Pause", 0, QApplication::UnicodeUTF8)); + button_continue->setText(QApplication::translate("DockWidget", "Continue", 0, QApplication::UnicodeUTF8)); + pushButton->setText(QApplication::translate("DockWidget", "Step Into", 0, QApplication::UnicodeUTF8)); + button_breakpoint->setText(QApplication::translate("DockWidget", "Set Breakpoint", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class DockWidget: public Ui_DockWidget {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_DISASSEMBLER_H diff --git a/src/citra_qt/ui_registers.h b/src/citra_qt/ui_registers.h new file mode 100644 index 000000000..3111cd09e --- /dev/null +++ b/src/citra_qt/ui_registers.h @@ -0,0 +1,69 @@ +/******************************************************************************** +** Form generated from reading UI file 'registers.ui' +** +** Created by: Qt User Interface Compiler version 4.8.5 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_REGISTERS_H +#define UI_REGISTERS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_ARMRegisters +{ +public: + QWidget *dockWidgetContents; + QVBoxLayout *verticalLayout; + QTreeWidget *treeWidget; + + void setupUi(QDockWidget *ARMRegisters) + { + if (ARMRegisters->objectName().isEmpty()) + ARMRegisters->setObjectName(QString::fromUtf8("ARMRegisters")); + ARMRegisters->resize(400, 300); + dockWidgetContents = new QWidget(); + dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents")); + verticalLayout = new QVBoxLayout(dockWidgetContents); + verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + treeWidget = new QTreeWidget(dockWidgetContents); + treeWidget->setObjectName(QString::fromUtf8("treeWidget")); + treeWidget->setAlternatingRowColors(true); + + verticalLayout->addWidget(treeWidget); + + ARMRegisters->setWidget(dockWidgetContents); + + retranslateUi(ARMRegisters); + + QMetaObject::connectSlotsByName(ARMRegisters); + } // setupUi + + void retranslateUi(QDockWidget *ARMRegisters) + { + ARMRegisters->setWindowTitle(QApplication::translate("ARMRegisters", "ARM registers", 0, QApplication::UnicodeUTF8)); + QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem(); + ___qtreewidgetitem->setText(1, QApplication::translate("ARMRegisters", "Value", 0, QApplication::UnicodeUTF8)); + ___qtreewidgetitem->setText(0, QApplication::translate("ARMRegisters", "Register", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class ARMRegisters: public Ui_ARMRegisters {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_REGISTERS_H -- cgit v1.2.3