diff options
| author | 2014-04-18 18:30:53 -0400 | |
|---|---|---|
| committer | 2014-04-18 18:34:23 -0400 | |
| commit | e5f09b8be65c06927164428b5d400024e2388dbc (patch) | |
| tree | 0f0fd4035bcc88c0de5a47a7d3c64b4f67453897 | |
| parent | Merge branch 'hle-interface' (diff) | |
| download | yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.gz yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.tar.xz yuzu-e5f09b8be65c06927164428b5d400024e2388dbc.zip | |
UI/debugger changes
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/callstack.cpp | 36 | ||||
| -rw-r--r-- | src/citra_qt/citra_qt.vcxproj | 35 | ||||
| -rw-r--r-- | src/citra_qt/citra_qt.vcxproj.filters | 60 | ||||
| -rw-r--r-- | src/citra_qt/debugger/callstack.cpp | 66 | ||||
| -rw-r--r-- | src/citra_qt/debugger/callstack.hxx (renamed from src/citra_qt/callstack.hxx) | 7 | ||||
| -rw-r--r-- | src/citra_qt/debugger/callstack.ui (renamed from src/citra_qt/callstack.ui) | 0 | ||||
| -rw-r--r-- | src/citra_qt/debugger/disassembler.cpp (renamed from src/citra_qt/disasm.cpp) | 52 | ||||
| -rw-r--r-- | src/citra_qt/debugger/disassembler.hxx (renamed from src/citra_qt/disasm.hxx) | 6 | ||||
| -rw-r--r-- | src/citra_qt/debugger/disassembler.ui | 88 | ||||
| -rw-r--r-- | src/citra_qt/debugger/ramview.cpp (renamed from src/citra_qt/ramview.cpp) | 0 | ||||
| -rw-r--r-- | src/citra_qt/debugger/ramview.hxx (renamed from src/citra_qt/ramview.hxx) | 0 | ||||
| -rw-r--r-- | src/citra_qt/debugger/registers.cpp (renamed from src/citra_qt/cpu_regs.cpp) | 8 | ||||
| -rw-r--r-- | src/citra_qt/debugger/registers.hxx (renamed from src/citra_qt/cpu_regs.hxx) | 8 | ||||
| -rw-r--r-- | src/citra_qt/debugger/registers.ui (renamed from src/citra_qt/cpu_regs.ui) | 0 | ||||
| -rw-r--r-- | src/citra_qt/disasm.ui | 78 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 39 | ||||
| -rw-r--r-- | src/citra_qt/main.hxx | 11 | ||||
| -rw-r--r-- | src/citra_qt/ui_disassembler.h (renamed from src/citra_qt/ui_disasm.h) | 16 | ||||
| -rw-r--r-- | src/citra_qt/ui_registers.h (renamed from src/citra_qt/ui_cpu_regs.h) | 8 |
19 files changed, 285 insertions, 233 deletions
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 @@ | |||
| 1 | #include <QStandardItemModel> | ||
| 2 | #include "callstack.hxx" | ||
| 3 | |||
| 4 | //#include "debugger/debugger.h" | ||
| 5 | |||
| 6 | GCallstackView::GCallstackView(QWidget* parent): QDockWidget(parent) | ||
| 7 | { | ||
| 8 | ui.setupUi(this); | ||
| 9 | |||
| 10 | callstack_model = new QStandardItemModel(this); | ||
| 11 | callstack_model->setColumnCount(3); | ||
| 12 | callstack_model->setHeaderData(0, Qt::Horizontal, "Depth"); | ||
| 13 | callstack_model->setHeaderData(1, Qt::Horizontal, "Address"); | ||
| 14 | callstack_model->setHeaderData(2, Qt::Horizontal, "Function Name"); | ||
| 15 | ui.treeView->setModel(callstack_model); | ||
| 16 | |||
| 17 | // TODO: Make single clicking a callstack entry jump to the corresponding disassembly position | ||
| 18 | } | ||
| 19 | |||
| 20 | void GCallstackView::OnCPUStepped() | ||
| 21 | { | ||
| 22 | /* | ||
| 23 | Debugger::Callstack callstack; | ||
| 24 | Debugger::GetCallstack(callstack); | ||
| 25 | callstack_model->setRowCount(callstack.size()); | ||
| 26 | |||
| 27 | for (int i = 0; i < callstack.size(); ++i) | ||
| 28 | for (Debugger::CallstackIterator it = callstack.begin(); it != callstack.end(); ++it) | ||
| 29 | { | ||
| 30 | Debugger::CallstackEntry entry = callstack[i]; | ||
| 31 | callstack_model->setItem(i, 0, new QStandardItem(QString("%1").arg(i+1))); | ||
| 32 | callstack_model->setItem(i, 1, new QStandardItem(QString("0x%1").arg(entry.addr, 8, 16, QLatin1Char('0')))); | ||
| 33 | callstack_model->setItem(i, 2, new QStandardItem(QString::fromStdString(entry.name))); | ||
| 34 | } | ||
| 35 | */ | ||
| 36 | } \ No newline at end of file | ||
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 @@ | |||
| 127 | <ClCompile Include="..\..\externals\qhexedit\qhexedit.cpp" /> | 127 | <ClCompile Include="..\..\externals\qhexedit\qhexedit.cpp" /> |
| 128 | <ClCompile Include="..\..\externals\qhexedit\qhexedit_p.cpp" /> | 128 | <ClCompile Include="..\..\externals\qhexedit\qhexedit_p.cpp" /> |
| 129 | <ClCompile Include="..\..\externals\qhexedit\xbytearray.cpp" /> | 129 | <ClCompile Include="..\..\externals\qhexedit\xbytearray.cpp" /> |
| 130 | <ClCompile Include="bootmanager.cpp" /> | ||
| 131 | <ClCompile Include="callstack.cpp" /> | ||
| 132 | <ClCompile Include="config\controller_config.cpp" /> | 130 | <ClCompile Include="config\controller_config.cpp" /> |
| 133 | <ClCompile Include="config\controller_config_util.cpp" /> | 131 | <ClCompile Include="config\controller_config_util.cpp" /> |
| 134 | <ClCompile Include="cpu_regs.cpp" /> | 132 | <ClCompile Include="debugger\callstack.cpp" /> |
| 135 | <ClCompile Include="disasm.cpp" /> | 133 | <ClCompile Include="debugger\registers.cpp" /> |
| 134 | <ClCompile Include="debugger\disassembler.cpp" /> | ||
| 135 | <ClCompile Include="debugger\ramview.cpp" /> | ||
| 136 | <ClCompile Include="bootmanager.cpp" /> | ||
| 136 | <ClCompile Include="hotkeys.cpp" /> | 137 | <ClCompile Include="hotkeys.cpp" /> |
| 137 | <ClCompile Include="main.cpp" /> | 138 | <ClCompile Include="main.cpp" /> |
| 138 | <ClCompile Include="ramview.cpp" /> | ||
| 139 | </ItemGroup> | 139 | </ItemGroup> |
| 140 | <ItemGroup> | 140 | <ItemGroup> |
| 141 | <MOC Include="..\..\externals\qhexedit\commands.h" /> | 141 | <MOC Include="..\..\externals\qhexedit\commands.h" /> |
| 142 | <MOC Include="..\..\externals\qhexedit\qhexedit.h" /> | 142 | <MOC Include="..\..\externals\qhexedit\qhexedit.h" /> |
| 143 | <MOC Include="..\..\externals\qhexedit\qhexedit_p.h" /> | 143 | <MOC Include="..\..\externals\qhexedit\qhexedit_p.h" /> |
| 144 | <MOC Include="..\..\externals\qhexedit\xbytearray.h" /> | 144 | <MOC Include="..\..\externals\qhexedit\xbytearray.h" /> |
| 145 | <MOC Include="config\controller_config.hxx" /> | 145 | <MOC Include="debugger\callstack.hxx" /> |
| 146 | <MOC Include="config\controller_config_util.hxx" /> | 146 | <MOC Include="debugger\registers.hxx" /> |
| 147 | <MOC Include="callstack.hxx" /> | 147 | <MOC Include="debugger\disassembler.hxx" /> |
| 148 | <MOC Include="cpu_regs.hxx" /> | 148 | <MOC Include="debugger\ramview.hxx" /> |
| 149 | <MOC Include="disasm.hxx" /> | ||
| 150 | <MOC Include="ramview.hxx" /> | ||
| 151 | <MOC Include="bootmanager.hxx" /> | 149 | <MOC Include="bootmanager.hxx" /> |
| 152 | <MOC Include="hotkeys.hxx" /> | 150 | <MOC Include="hotkeys.hxx" /> |
| 153 | <MOC Include="main.hxx" /> | 151 | <MOC Include="main.hxx" /> |
| @@ -164,25 +162,16 @@ | |||
| 164 | </ProjectReference> | 162 | </ProjectReference> |
| 165 | </ItemGroup> | 163 | </ItemGroup> |
| 166 | <ItemGroup> | 164 | <ItemGroup> |
| 167 | <ClInclude Include="callstack.hxx" /> | ||
| 168 | <ClInclude Include="config\controller_config.hxx" /> | 165 | <ClInclude Include="config\controller_config.hxx" /> |
| 169 | <ClInclude Include="config\controller_config_util.hxx" /> | 166 | <ClInclude Include="config\controller_config_util.hxx" /> |
| 170 | <ClInclude Include="cpu_regs.hxx" /> | ||
| 171 | <ClInclude Include="disasm.hxx" /> | ||
| 172 | <ClInclude Include="ramview.hxx" /> | ||
| 173 | <ClInclude Include="ui_callstack.h" /> | ||
| 174 | <ClInclude Include="ui_controller_config.h" /> | 167 | <ClInclude Include="ui_controller_config.h" /> |
| 175 | <ClInclude Include="ui_cpu_regs.h" /> | ||
| 176 | <ClInclude Include="ui_disasm.h" /> | ||
| 177 | <ClInclude Include="ui_hotkeys.h" /> | ||
| 178 | <ClInclude Include="ui_main.h" /> | ||
| 179 | <ClInclude Include="version.h" /> | 168 | <ClInclude Include="version.h" /> |
| 180 | </ItemGroup> | 169 | </ItemGroup> |
| 181 | <ItemGroup> | 170 | <ItemGroup> |
| 182 | <UIC Include="callstack.ui" /> | ||
| 183 | <UIC Include="config\controller_config.ui" /> | 171 | <UIC Include="config\controller_config.ui" /> |
| 184 | <UIC Include="cpu_regs.ui" /> | 172 | <UIC Include="debugger\callstack.ui" /> |
| 185 | <UIC Include="disasm.ui" /> | 173 | <UIC Include="debugger\registers.ui" /> |
| 174 | <UIC Include="debugger\disassembler.ui" /> | ||
| 186 | <UIC Include="hotkeys.ui" /> | 175 | <UIC Include="hotkeys.ui" /> |
| 187 | <UIC Include="main.ui" /> | 176 | <UIC Include="main.ui" /> |
| 188 | </ItemGroup> | 177 | </ItemGroup> |
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 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 3 | <ItemGroup> | 3 | <ItemGroup> |
| 4 | <Filter Include="debugger"> | ||
| 5 | <UniqueIdentifier>{1b8f77c1-61e8-4a9f-95f8-8d1c53015ad8}</UniqueIdentifier> | ||
| 6 | </Filter> | ||
| 7 | <Filter Include="qhexedit"> | 4 | <Filter Include="qhexedit"> |
| 8 | <UniqueIdentifier>{dede739c-939b-4147-9e72-4a326b97d237}</UniqueIdentifier> | 5 | <UniqueIdentifier>{dede739c-939b-4147-9e72-4a326b97d237}</UniqueIdentifier> |
| 9 | </Filter> | 6 | </Filter> |
| 10 | <Filter Include="config"> | 7 | <Filter Include="config"> |
| 11 | <UniqueIdentifier>{80178741-d3ab-4031-892c-ec58490ea8bf}</UniqueIdentifier> | 8 | <UniqueIdentifier>{80178741-d3ab-4031-892c-ec58490ea8bf}</UniqueIdentifier> |
| 12 | </Filter> | 9 | </Filter> |
| 10 | <Filter Include="debugger"> | ||
| 11 | <UniqueIdentifier>{9495d0e7-87d6-4fe1-92f1-cfa1bbec7025}</UniqueIdentifier> | ||
| 12 | </Filter> | ||
| 13 | </ItemGroup> | 13 | </ItemGroup> |
| 14 | <ItemGroup> | 14 | <ItemGroup> |
| 15 | <ClCompile Include="..\..\externals\qhexedit\commands.cpp"> | 15 | <ClCompile Include="..\..\externals\qhexedit\commands.cpp"> |
| @@ -33,16 +33,16 @@ | |||
| 33 | <ClCompile Include="config\controller_config_util.cpp"> | 33 | <ClCompile Include="config\controller_config_util.cpp"> |
| 34 | <Filter>config</Filter> | 34 | <Filter>config</Filter> |
| 35 | </ClCompile> | 35 | </ClCompile> |
| 36 | <ClCompile Include="cpu_regs.cpp"> | 36 | <ClCompile Include="debugger\callstack.cpp"> |
| 37 | <Filter>debugger</Filter> | 37 | <Filter>debugger</Filter> |
| 38 | </ClCompile> | 38 | </ClCompile> |
| 39 | <ClCompile Include="disasm.cpp"> | 39 | <ClCompile Include="debugger\ramview.cpp"> |
| 40 | <Filter>debugger</Filter> | 40 | <Filter>debugger</Filter> |
| 41 | </ClCompile> | 41 | </ClCompile> |
| 42 | <ClCompile Include="ramview.cpp"> | 42 | <ClCompile Include="debugger\disassembler.cpp"> |
| 43 | <Filter>debugger</Filter> | 43 | <Filter>debugger</Filter> |
| 44 | </ClCompile> | 44 | </ClCompile> |
| 45 | <ClCompile Include="callstack.cpp"> | 45 | <ClCompile Include="debugger\registers.cpp"> |
| 46 | <Filter>debugger</Filter> | 46 | <Filter>debugger</Filter> |
| 47 | </ClCompile> | 47 | </ClCompile> |
| 48 | </ItemGroup> | 48 | </ItemGroup> |
| @@ -59,12 +59,23 @@ | |||
| 59 | <MOC Include="..\..\externals\qhexedit\qhexedit.h"> | 59 | <MOC Include="..\..\externals\qhexedit\qhexedit.h"> |
| 60 | <Filter>qhexedit</Filter> | 60 | <Filter>qhexedit</Filter> |
| 61 | </MOC> | 61 | </MOC> |
| 62 | <MOC Include="bootmanager.hxx" /> | ||
| 63 | <MOC Include="hotkeys.hxx" /> | ||
| 64 | <MOC Include="main.hxx" /> | ||
| 65 | <MOC Include="debugger\callstack.hxx"> | ||
| 66 | <Filter>debugger</Filter> | ||
| 67 | </MOC> | ||
| 68 | <MOC Include="debugger\ramview.hxx"> | ||
| 69 | <Filter>debugger</Filter> | ||
| 70 | </MOC> | ||
| 71 | <MOC Include="debugger\disassembler.hxx"> | ||
| 72 | <Filter>debugger</Filter> | ||
| 73 | </MOC> | ||
| 74 | <MOC Include="debugger\registers.hxx"> | ||
| 75 | <Filter>debugger</Filter> | ||
| 76 | </MOC> | ||
| 62 | </ItemGroup> | 77 | </ItemGroup> |
| 63 | <ItemGroup> | 78 | <ItemGroup> |
| 64 | <ClInclude Include="hotkeys.hxx" /> | ||
| 65 | <ClInclude Include="ui_hotkeys.h" /> | ||
| 66 | <ClInclude Include="main.hxx" /> | ||
| 67 | <ClInclude Include="ui_main.h" /> | ||
| 68 | <ClInclude Include="version.h" /> | 79 | <ClInclude Include="version.h" /> |
| 69 | <ClInclude Include="config\controller_config.hxx"> | 80 | <ClInclude Include="config\controller_config.hxx"> |
| 70 | <Filter>config</Filter> | 81 | <Filter>config</Filter> |
| @@ -72,27 +83,6 @@ | |||
| 72 | <ClInclude Include="config\controller_config_util.hxx"> | 83 | <ClInclude Include="config\controller_config_util.hxx"> |
| 73 | <Filter>config</Filter> | 84 | <Filter>config</Filter> |
| 74 | </ClInclude> | 85 | </ClInclude> |
| 75 | <ClInclude Include="cpu_regs.hxx"> | ||
| 76 | <Filter>debugger</Filter> | ||
| 77 | </ClInclude> | ||
| 78 | <ClInclude Include="disasm.hxx"> | ||
| 79 | <Filter>debugger</Filter> | ||
| 80 | </ClInclude> | ||
| 81 | <ClInclude Include="ramview.hxx"> | ||
| 82 | <Filter>debugger</Filter> | ||
| 83 | </ClInclude> | ||
| 84 | <ClInclude Include="ui_callstack.h"> | ||
| 85 | <Filter>debugger</Filter> | ||
| 86 | </ClInclude> | ||
| 87 | <ClInclude Include="ui_cpu_regs.h"> | ||
| 88 | <Filter>debugger</Filter> | ||
| 89 | </ClInclude> | ||
| 90 | <ClInclude Include="ui_disasm.h"> | ||
| 91 | <Filter>debugger</Filter> | ||
| 92 | </ClInclude> | ||
| 93 | <ClInclude Include="callstack.hxx"> | ||
| 94 | <Filter>debugger</Filter> | ||
| 95 | </ClInclude> | ||
| 96 | <ClInclude Include="ui_controller_config.h"> | 86 | <ClInclude Include="ui_controller_config.h"> |
| 97 | <Filter>config</Filter> | 87 | <Filter>config</Filter> |
| 98 | </ClInclude> | 88 | </ClInclude> |
| @@ -103,13 +93,13 @@ | |||
| 103 | <UIC Include="config\controller_config.ui"> | 93 | <UIC Include="config\controller_config.ui"> |
| 104 | <Filter>config</Filter> | 94 | <Filter>config</Filter> |
| 105 | </UIC> | 95 | </UIC> |
| 106 | <UIC Include="callstack.ui"> | 96 | <UIC Include="debugger\callstack.ui"> |
| 107 | <Filter>debugger</Filter> | 97 | <Filter>debugger</Filter> |
| 108 | </UIC> | 98 | </UIC> |
| 109 | <UIC Include="cpu_regs.ui"> | 99 | <UIC Include="debugger\disassembler.ui"> |
| 110 | <Filter>debugger</Filter> | 100 | <Filter>debugger</Filter> |
| 111 | </UIC> | 101 | </UIC> |
| 112 | <UIC Include="disasm.ui"> | 102 | <UIC Include="debugger\registers.ui"> |
| 113 | <Filter>debugger</Filter> | 103 | <Filter>debugger</Filter> |
| 114 | </UIC> | 104 | </UIC> |
| 115 | </ItemGroup> | 105 | </ItemGroup> |
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 @@ | |||
| 1 | #include <QStandardItemModel> | ||
| 2 | |||
| 3 | #include "callstack.hxx" | ||
| 4 | |||
| 5 | #include "core/core.h" | ||
| 6 | #include "core/arm/arm_interface.h" | ||
| 7 | #include "core/mem_map.h" | ||
| 8 | #include "common/symbols.h" | ||
| 9 | #include "core/arm/disassembler/arm_disasm.h" | ||
| 10 | |||
| 11 | CallstackWidget::CallstackWidget(QWidget* parent): QDockWidget(parent) | ||
| 12 | { | ||
| 13 | ui.setupUi(this); | ||
| 14 | |||
| 15 | callstack_model = new QStandardItemModel(this); | ||
| 16 | callstack_model->setColumnCount(4); | ||
| 17 | callstack_model->setHeaderData(0, Qt::Horizontal, "Stack pointer"); | ||
| 18 | callstack_model->setHeaderData(2, Qt::Horizontal, "Return address"); | ||
| 19 | callstack_model->setHeaderData(1, Qt::Horizontal, "Call address"); | ||
| 20 | callstack_model->setHeaderData(3, Qt::Horizontal, "Function"); | ||
| 21 | ui.treeView->setModel(callstack_model); | ||
| 22 | } | ||
| 23 | |||
| 24 | void CallstackWidget::OnCPUStepped() | ||
| 25 | { | ||
| 26 | ARM_Disasm* disasm = new ARM_Disasm(); | ||
| 27 | ARM_Interface* app_core = Core::g_app_core; | ||
| 28 | |||
| 29 | u32 sp = app_core->GetReg(13); //stack pointer | ||
| 30 | u32 addr, ret_addr, call_addr, func_addr; | ||
| 31 | |||
| 32 | int counter = 0; | ||
| 33 | for (int addr = 0x10000000; addr >= sp; addr -= 4) | ||
| 34 | { | ||
| 35 | ret_addr = Memory::Read32(addr); | ||
| 36 | call_addr = ret_addr - 4; //get call address??? | ||
| 37 | |||
| 38 | /* TODO (mattvail) clean me, move to debugger interface */ | ||
| 39 | u32 insn = Memory::Read32(call_addr); | ||
| 40 | if (disasm->decode(insn) == OP_BL) | ||
| 41 | { | ||
| 42 | std::string name; | ||
| 43 | // ripped from disasm | ||
| 44 | uint8_t cond = (insn >> 28) & 0xf; | ||
| 45 | uint32_t i_offset = insn & 0xffffff; | ||
| 46 | // Sign-extend the 24-bit offset | ||
| 47 | if ((i_offset >> 23) & 1) | ||
| 48 | i_offset |= 0xff000000; | ||
| 49 | |||
| 50 | // Pre-compute the left-shift and the prefetch offset | ||
| 51 | i_offset <<= 2; | ||
| 52 | i_offset += 8; | ||
| 53 | func_addr = call_addr + i_offset; | ||
| 54 | |||
| 55 | callstack_model->setItem(counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0')))); | ||
| 56 | callstack_model->setItem(counter, 1, new QStandardItem(QString("0x%1").arg(ret_addr, 8, 16, QLatin1Char('0')))); | ||
| 57 | callstack_model->setItem(counter, 2, new QStandardItem(QString("0x%1").arg(call_addr, 8, 16, QLatin1Char('0')))); | ||
| 58 | |||
| 59 | name = Symbols::HasSymbol(func_addr) ? Symbols::GetSymbol(func_addr).name : "unknown"; | ||
| 60 | callstack_model->setItem(counter, 3, new QStandardItem(QString("%1_%2").arg(QString::fromStdString(name)) | ||
| 61 | .arg(QString("0x%1").arg(func_addr, 8, 16, QLatin1Char('0'))))); | ||
| 62 | |||
| 63 | counter++; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | } \ No newline at end of file | ||
diff --git a/src/citra_qt/callstack.hxx b/src/citra_qt/debugger/callstack.hxx index 4df1b96d5..3ad2af28b 100644 --- a/src/citra_qt/callstack.hxx +++ b/src/citra_qt/debugger/callstack.hxx | |||
| @@ -1,15 +1,14 @@ | |||
| 1 | #include <QDockWidget> | 1 | #include <QDockWidget> |
| 2 | #include "ui_callstack.h" | 2 | #include "../ui_callstack.h" |
| 3 | #include "common/platform.h" | ||
| 4 | 3 | ||
| 5 | class QStandardItemModel; | 4 | class QStandardItemModel; |
| 6 | 5 | ||
| 7 | class GCallstackView : public QDockWidget | 6 | class CallstackWidget : public QDockWidget |
| 8 | { | 7 | { |
| 9 | Q_OBJECT | 8 | Q_OBJECT |
| 10 | 9 | ||
| 11 | public: | 10 | public: |
| 12 | GCallstackView(QWidget* parent = 0); | 11 | CallstackWidget(QWidget* parent = 0); |
| 13 | 12 | ||
| 14 | public slots: | 13 | public slots: |
| 15 | void OnCPUStepped(); | 14 | void OnCPUStepped(); |
diff --git a/src/citra_qt/callstack.ui b/src/citra_qt/debugger/callstack.ui index b3c4db632..b3c4db632 100644 --- a/src/citra_qt/callstack.ui +++ b/src/citra_qt/debugger/callstack.ui | |||
diff --git a/src/citra_qt/disasm.cpp b/src/citra_qt/debugger/disassembler.cpp index 5f3a6058a..cc4cb13fa 100644 --- a/src/citra_qt/disasm.cpp +++ b/src/citra_qt/debugger/disassembler.cpp | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | #include <QtGui> | 1 | #include <QtGui> |
| 2 | #include "ui_disasm.h" | ||
| 3 | #include "disasm.hxx" | ||
| 4 | 2 | ||
| 5 | #include "bootmanager.hxx" | 3 | #include "disassembler.hxx" |
| 6 | #include "hotkeys.hxx" | 4 | |
| 5 | #include "../bootmanager.hxx" | ||
| 6 | #include "../hotkeys.hxx" | ||
| 7 | 7 | ||
| 8 | #include "common/common.h" | 8 | #include "common/common.h" |
| 9 | #include "core/mem_map.h" | 9 | #include "core/mem_map.h" |
| @@ -14,7 +14,7 @@ | |||
| 14 | #include "core/arm/interpreter/armdefs.h" | 14 | #include "core/arm/interpreter/armdefs.h" |
| 15 | #include "core/arm/disassembler/arm_disasm.h" | 15 | #include "core/arm/disassembler/arm_disasm.h" |
| 16 | 16 | ||
| 17 | GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread) | 17 | DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread& emu_thread) : QDockWidget(parent), base_addr(0), emu_thread(emu_thread) |
| 18 | { | 18 | { |
| 19 | disasm_ui.setupUi(this); | 19 | disasm_ui.setupUi(this); |
| 20 | 20 | ||
| @@ -23,7 +23,7 @@ GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(p | |||
| 23 | model = new QStandardItemModel(this); | 23 | model = new QStandardItemModel(this); |
| 24 | model->setColumnCount(3); | 24 | model->setColumnCount(3); |
| 25 | disasm_ui.treeView->setModel(model); | 25 | disasm_ui.treeView->setModel(model); |
| 26 | 26 | disasm_ui.tableView->setModel(model); | |
| 27 | RegisterHotkey("Disassembler", "Start/Stop", QKeySequence(Qt::Key_F5), Qt::ApplicationShortcut); | 27 | RegisterHotkey("Disassembler", "Start/Stop", QKeySequence(Qt::Key_F5), Qt::ApplicationShortcut); |
| 28 | RegisterHotkey("Disassembler", "Step", QKeySequence(Qt::Key_F10), Qt::ApplicationShortcut); | 28 | RegisterHotkey("Disassembler", "Step", QKeySequence(Qt::Key_F10), Qt::ApplicationShortcut); |
| 29 | RegisterHotkey("Disassembler", "Step into", QKeySequence(Qt::Key_F11), Qt::ApplicationShortcut); | 29 | RegisterHotkey("Disassembler", "Step into", QKeySequence(Qt::Key_F11), Qt::ApplicationShortcut); |
| @@ -40,7 +40,7 @@ GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(p | |||
| 40 | connect(GetHotkey("Disassembler", "Set Breakpoint", this), SIGNAL(activated()), this, SLOT(OnSetBreakpoint())); | 40 | connect(GetHotkey("Disassembler", "Set Breakpoint", this), SIGNAL(activated()), this, SLOT(OnSetBreakpoint())); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | void GDisAsmView::Init() | 43 | void DisassemblerWidget::Init() |
| 44 | { | 44 | { |
| 45 | ARM_Disasm* disasm = new ARM_Disasm(); | 45 | ARM_Disasm* disasm = new ARM_Disasm(); |
| 46 | 46 | ||
| @@ -64,13 +64,20 @@ void GDisAsmView::Init() | |||
| 64 | } | 64 | } |
| 65 | disasm_ui.treeView->resizeColumnToContents(0); | 65 | disasm_ui.treeView->resizeColumnToContents(0); |
| 66 | disasm_ui.treeView->resizeColumnToContents(1); | 66 | disasm_ui.treeView->resizeColumnToContents(1); |
| 67 | 67 | disasm_ui.treeView->resizeColumnToContents(2); | |
| 68 | disasm_ui.tableView->resizeColumnToContents(0); | ||
| 69 | disasm_ui.tableView->resizeColumnToContents(1); | ||
| 70 | disasm_ui.tableView->resizeColumnToContents(2); | ||
| 71 | |||
| 68 | QModelIndex model_index = model->index(0, 0); | 72 | QModelIndex model_index = model->index(0, 0); |
| 69 | disasm_ui.treeView->scrollTo(model_index); | 73 | disasm_ui.treeView->scrollTo(model_index); |
| 70 | disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | 74 | disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); |
| 75 | |||
| 76 | disasm_ui.tableView->scrollTo(model_index); | ||
| 77 | disasm_ui.tableView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | ||
| 71 | } | 78 | } |
| 72 | 79 | ||
| 73 | void GDisAsmView::OnSetBreakpoint() | 80 | void DisassemblerWidget::OnSetBreakpoint() |
| 74 | { | 81 | { |
| 75 | int selected_row = SelectedRow(); | 82 | int selected_row = SelectedRow(); |
| 76 | 83 | ||
| @@ -92,33 +99,33 @@ void GDisAsmView::OnSetBreakpoint() | |||
| 92 | } | 99 | } |
| 93 | } | 100 | } |
| 94 | 101 | ||
| 95 | void GDisAsmView::OnContinue() | 102 | void DisassemblerWidget::OnContinue() |
| 96 | { | 103 | { |
| 97 | emu_thread.SetCpuRunning(true); | 104 | emu_thread.SetCpuRunning(true); |
| 98 | } | 105 | } |
| 99 | 106 | ||
| 100 | void GDisAsmView::OnStep() | 107 | void DisassemblerWidget::OnStep() |
| 101 | { | 108 | { |
| 102 | OnStepInto(); // change later | 109 | OnStepInto(); // change later |
| 103 | } | 110 | } |
| 104 | 111 | ||
| 105 | void GDisAsmView::OnStepInto() | 112 | void DisassemblerWidget::OnStepInto() |
| 106 | { | 113 | { |
| 107 | emu_thread.SetCpuRunning(false); | 114 | emu_thread.SetCpuRunning(false); |
| 108 | emu_thread.ExecStep(); | 115 | emu_thread.ExecStep(); |
| 109 | } | 116 | } |
| 110 | 117 | ||
| 111 | void GDisAsmView::OnPause() | 118 | void DisassemblerWidget::OnPause() |
| 112 | { | 119 | { |
| 113 | emu_thread.SetCpuRunning(false); | 120 | emu_thread.SetCpuRunning(false); |
| 114 | } | 121 | } |
| 115 | 122 | ||
| 116 | void GDisAsmView::OnToggleStartStop() | 123 | void DisassemblerWidget::OnToggleStartStop() |
| 117 | { | 124 | { |
| 118 | emu_thread.SetCpuRunning(!emu_thread.IsCpuRunning()); | 125 | emu_thread.SetCpuRunning(!emu_thread.IsCpuRunning()); |
| 119 | } | 126 | } |
| 120 | 127 | ||
| 121 | void GDisAsmView::OnCPUStepped() | 128 | void DisassemblerWidget::OnCPUStepped() |
| 122 | { | 129 | { |
| 123 | ARMword next_instr = Core::g_app_core->GetPC(); | 130 | ARMword next_instr = Core::g_app_core->GetPC(); |
| 124 | 131 | ||
| @@ -131,13 +138,24 @@ void GDisAsmView::OnCPUStepped() | |||
| 131 | QModelIndex model_index = model->index(index, 0); | 138 | QModelIndex model_index = model->index(index, 0); |
| 132 | disasm_ui.treeView->scrollTo(model_index); | 139 | disasm_ui.treeView->scrollTo(model_index); |
| 133 | disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | 140 | disasm_ui.treeView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); |
| 141 | |||
| 142 | disasm_ui.tableView->scrollTo(model_index); | ||
| 143 | disasm_ui.tableView->selectionModel()->setCurrentIndex(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | ||
| 144 | disasm_ui.tableView->selectionModel()->select(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); | ||
| 134 | } | 145 | } |
| 135 | 146 | ||
| 136 | int GDisAsmView::SelectedRow() | 147 | int DisassemblerWidget::SelectedRow() |
| 137 | { | 148 | { |
| 138 | QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex(); | 149 | QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex(); |
| 139 | if (!index.isValid()) | 150 | if (!index.isValid()) |
| 140 | return -1; | 151 | return -1; |
| 141 | 152 | ||
| 142 | return model->itemFromIndex(disasm_ui.treeView->selectionModel()->currentIndex())->row(); | 153 | return model->itemFromIndex(disasm_ui.treeView->selectionModel()->currentIndex())->row(); |
| 143 | } \ No newline at end of file | 154 | } |
| 155 | /* | ||
| 156 | void DisassemblerWidget::paintEvent() | ||
| 157 | { | ||
| 158 | QPainter painter(this); | ||
| 159 | painter.drawRect(10, 10, 50, 50); | ||
| 160 | } | ||
| 161 | */ \ No newline at end of file | ||
diff --git a/src/citra_qt/disasm.hxx b/src/citra_qt/debugger/disassembler.hxx index 0c5a37cac..e5b152d20 100644 --- a/src/citra_qt/disasm.hxx +++ b/src/citra_qt/debugger/disassembler.hxx | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #include <QDockWidget> | 1 | #include <QDockWidget> |
| 2 | #include "ui_disasm.h" | 2 | #include "../ui_disassembler.h" |
| 3 | 3 | ||
| 4 | #include "common/common.h" | 4 | #include "common/common.h" |
| 5 | #include "common/break_points.h" | 5 | #include "common/break_points.h" |
| @@ -8,12 +8,12 @@ class QAction; | |||
| 8 | class QStandardItemModel; | 8 | class QStandardItemModel; |
| 9 | class EmuThread; | 9 | class EmuThread; |
| 10 | 10 | ||
| 11 | class GDisAsmView : public QDockWidget | 11 | class DisassemblerWidget : public QDockWidget |
| 12 | { | 12 | { |
| 13 | Q_OBJECT | 13 | Q_OBJECT |
| 14 | 14 | ||
| 15 | public: | 15 | public: |
| 16 | GDisAsmView(QWidget* parent, EmuThread& emu_thread); | 16 | DisassemblerWidget(QWidget* parent, EmuThread& emu_thread); |
| 17 | 17 | ||
| 18 | void Init(); | 18 | void Init(); |
| 19 | 19 | ||
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 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>DockWidget</class> | ||
| 4 | <widget class="QDockWidget" name="DockWidget"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>430</width> | ||
| 10 | <height>401</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>Disassembly</string> | ||
| 15 | </property> | ||
| 16 | <widget class="QWidget" name="dockWidgetContents"> | ||
| 17 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
| 18 | <item> | ||
| 19 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
| 20 | <item> | ||
| 21 | <widget class="QPushButton" name="button_step"> | ||
| 22 | <property name="text"> | ||
| 23 | <string>Step</string> | ||
| 24 | </property> | ||
| 25 | </widget> | ||
| 26 | </item> | ||
| 27 | <item> | ||
| 28 | <widget class="QPushButton" name="button_pause"> | ||
| 29 | <property name="text"> | ||
| 30 | <string>Pause</string> | ||
| 31 | </property> | ||
| 32 | </widget> | ||
| 33 | </item> | ||
| 34 | <item> | ||
| 35 | <widget class="QPushButton" name="button_continue"> | ||
| 36 | <property name="text"> | ||
| 37 | <string>Continue</string> | ||
| 38 | </property> | ||
| 39 | </widget> | ||
| 40 | </item> | ||
| 41 | <item> | ||
| 42 | <widget class="QPushButton" name="pushButton"> | ||
| 43 | <property name="text"> | ||
| 44 | <string>Step Into</string> | ||
| 45 | </property> | ||
| 46 | </widget> | ||
| 47 | </item> | ||
| 48 | <item> | ||
| 49 | <widget class="QPushButton" name="button_breakpoint"> | ||
| 50 | <property name="text"> | ||
| 51 | <string>Set Breakpoint</string> | ||
| 52 | </property> | ||
| 53 | </widget> | ||
| 54 | </item> | ||
| 55 | </layout> | ||
| 56 | </item> | ||
| 57 | <item> | ||
| 58 | <widget class="QTreeView" name="treeView"> | ||
| 59 | <property name="alternatingRowColors"> | ||
| 60 | <bool>true</bool> | ||
| 61 | </property> | ||
| 62 | <property name="indentation"> | ||
| 63 | <number>20</number> | ||
| 64 | </property> | ||
| 65 | <property name="rootIsDecorated"> | ||
| 66 | <bool>false</bool> | ||
| 67 | </property> | ||
| 68 | <attribute name="headerVisible"> | ||
| 69 | <bool>false</bool> | ||
| 70 | </attribute> | ||
| 71 | </widget> | ||
| 72 | </item> | ||
| 73 | <item> | ||
| 74 | <widget class="QTableView" name="tableView"> | ||
| 75 | <property name="alternatingRowColors"> | ||
| 76 | <bool>true</bool> | ||
| 77 | </property> | ||
| 78 | <attribute name="headerVisible"> | ||
| 79 | <bool>false</bool> | ||
| 80 | </attribute> | ||
| 81 | </widget> | ||
| 82 | </item> | ||
| 83 | </layout> | ||
| 84 | </widget> | ||
| 85 | </widget> | ||
| 86 | <resources/> | ||
| 87 | <connections/> | ||
| 88 | </ui> | ||
diff --git a/src/citra_qt/ramview.cpp b/src/citra_qt/debugger/ramview.cpp index 3f899b95e..3f899b95e 100644 --- a/src/citra_qt/ramview.cpp +++ b/src/citra_qt/debugger/ramview.cpp | |||
diff --git a/src/citra_qt/ramview.hxx b/src/citra_qt/debugger/ramview.hxx index 1db1546aa..1db1546aa 100644 --- a/src/citra_qt/ramview.hxx +++ b/src/citra_qt/debugger/ramview.hxx | |||
diff --git a/src/citra_qt/cpu_regs.cpp b/src/citra_qt/debugger/registers.cpp index 7e54e18b0..96ceed480 100644 --- a/src/citra_qt/cpu_regs.cpp +++ b/src/citra_qt/debugger/registers.cpp | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | #include "cpu_regs.hxx" | 1 | #include "registers.hxx" |
| 2 | 2 | ||
| 3 | #include "core/core.h" | 3 | #include "core/core.h" |
| 4 | #include "core/arm/interpreter/armdefs.h" | 4 | #include "core/arm/arm_interface.h" |
| 5 | 5 | ||
| 6 | GARM11RegsView::GARM11RegsView(QWidget* parent) : QDockWidget(parent) | 6 | RegistersWidget::RegistersWidget(QWidget* parent) : QDockWidget(parent) |
| 7 | { | 7 | { |
| 8 | cpu_regs_ui.setupUi(this); | 8 | cpu_regs_ui.setupUi(this); |
| 9 | 9 | ||
| @@ -37,7 +37,7 @@ GARM11RegsView::GARM11RegsView(QWidget* parent) : QDockWidget(parent) | |||
| 37 | CSPR->addChild(new QTreeWidgetItem(QStringList("N"))); | 37 | CSPR->addChild(new QTreeWidgetItem(QStringList("N"))); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void GARM11RegsView::OnCPUStepped() | 40 | void RegistersWidget::OnCPUStepped() |
| 41 | { | 41 | { |
| 42 | ARM_Interface* app_core = Core::g_app_core; | 42 | ARM_Interface* app_core = Core::g_app_core; |
| 43 | 43 | ||
diff --git a/src/citra_qt/cpu_regs.hxx b/src/citra_qt/debugger/registers.hxx index 27c194bde..318d95820 100644 --- a/src/citra_qt/cpu_regs.hxx +++ b/src/citra_qt/debugger/registers.hxx | |||
| @@ -1,18 +1,16 @@ | |||
| 1 | #include "ui_cpu_regs.h" | 1 | #include "../ui_registers.h" |
| 2 | 2 | ||
| 3 | #include <QDockWidget> | 3 | #include <QDockWidget> |
| 4 | #include <QTreeWidgetItem> | 4 | #include <QTreeWidgetItem> |
| 5 | 5 | ||
| 6 | //#include "ui_gekko_regs.h" | ||
| 7 | |||
| 8 | class QTreeWidget; | 6 | class QTreeWidget; |
| 9 | 7 | ||
| 10 | class GARM11RegsView : public QDockWidget | 8 | class RegistersWidget : public QDockWidget |
| 11 | { | 9 | { |
| 12 | Q_OBJECT | 10 | Q_OBJECT |
| 13 | 11 | ||
| 14 | public: | 12 | public: |
| 15 | GARM11RegsView(QWidget* parent = NULL); | 13 | RegistersWidget(QWidget* parent = NULL); |
| 16 | 14 | ||
| 17 | public slots: | 15 | public slots: |
| 18 | void OnCPUStepped(); | 16 | void OnCPUStepped(); |
diff --git a/src/citra_qt/cpu_regs.ui b/src/citra_qt/debugger/registers.ui index 6537c9cd6..6537c9cd6 100644 --- a/src/citra_qt/cpu_regs.ui +++ b/src/citra_qt/debugger/registers.ui | |||
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 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>DockWidget</class> | ||
| 4 | <widget class="QDockWidget" name="DockWidget"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>430</width> | ||
| 10 | <height>401</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>Disassembly</string> | ||
| 15 | </property> | ||
| 16 | <widget class="QWidget" name="dockWidgetContents"> | ||
| 17 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
| 18 | <item> | ||
| 19 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
| 20 | <item> | ||
| 21 | <widget class="QPushButton" name="button_step"> | ||
| 22 | <property name="text"> | ||
| 23 | <string>Step</string> | ||
| 24 | </property> | ||
| 25 | </widget> | ||
| 26 | </item> | ||
| 27 | <item> | ||
| 28 | <widget class="QPushButton" name="button_pause"> | ||
| 29 | <property name="text"> | ||
| 30 | <string>Pause</string> | ||
| 31 | </property> | ||
| 32 | </widget> | ||
| 33 | </item> | ||
| 34 | <item> | ||
| 35 | <widget class="QPushButton" name="button_continue"> | ||
| 36 | <property name="text"> | ||
| 37 | <string>Continue</string> | ||
| 38 | </property> | ||
| 39 | </widget> | ||
| 40 | </item> | ||
| 41 | <item> | ||
| 42 | <widget class="QPushButton" name="pushButton"> | ||
| 43 | <property name="text"> | ||
| 44 | <string>Step Into</string> | ||
| 45 | </property> | ||
| 46 | </widget> | ||
| 47 | </item> | ||
| 48 | <item> | ||
| 49 | <widget class="QPushButton" name="button_breakpoint"> | ||
| 50 | <property name="text"> | ||
| 51 | <string>Set Breakpoint</string> | ||
| 52 | </property> | ||
| 53 | </widget> | ||
| 54 | </item> | ||
| 55 | </layout> | ||
| 56 | </item> | ||
| 57 | <item> | ||
| 58 | <widget class="QTreeView" name="treeView"> | ||
| 59 | <property name="alternatingRowColors"> | ||
| 60 | <bool>true</bool> | ||
| 61 | </property> | ||
| 62 | <property name="indentation"> | ||
| 63 | <number>20</number> | ||
| 64 | </property> | ||
| 65 | <property name="rootIsDecorated"> | ||
| 66 | <bool>false</bool> | ||
| 67 | </property> | ||
| 68 | <attribute name="headerVisible"> | ||
| 69 | <bool>false</bool> | ||
| 70 | </attribute> | ||
| 71 | </widget> | ||
| 72 | </item> | ||
| 73 | </layout> | ||
| 74 | </widget> | ||
| 75 | </widget> | ||
| 76 | <resources/> | ||
| 77 | <connections/> | ||
| 78 | </ui> | ||
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 @@ | |||
| 15 | #include "hotkeys.hxx" | 15 | #include "hotkeys.hxx" |
| 16 | 16 | ||
| 17 | //debugger | 17 | //debugger |
| 18 | #include "disasm.hxx" | 18 | #include "debugger/disassembler.hxx" |
| 19 | #include "cpu_regs.hxx" | 19 | #include "debugger/registers.hxx" |
| 20 | #include "callstack.hxx" | 20 | #include "debugger/callstack.hxx" |
| 21 | #include "ramview.hxx" | 21 | #include "debugger/ramview.hxx" |
| 22 | 22 | ||
| 23 | #include "core/system.h" | 23 | #include "core/system.h" |
| 24 | #include "core/loader.h" | 24 | #include "core/loader.h" |
| @@ -36,17 +36,22 @@ GMainWindow::GMainWindow() | |||
| 36 | ui.horizontalLayout->addWidget(render_window); | 36 | ui.horizontalLayout->addWidget(render_window); |
| 37 | //render_window->hide(); | 37 | //render_window->hide(); |
| 38 | 38 | ||
| 39 | disasm = new GDisAsmView(this, render_window->GetEmuThread()); | 39 | disasmWidget = new DisassemblerWidget(this, render_window->GetEmuThread()); |
| 40 | addDockWidget(Qt::BottomDockWidgetArea, disasm); | 40 | addDockWidget(Qt::BottomDockWidgetArea, disasmWidget); |
| 41 | disasm->hide(); | 41 | disasmWidget->hide(); |
| 42 | 42 | ||
| 43 | arm_regs = new GARM11RegsView(this); | 43 | registersWidget = new RegistersWidget(this); |
| 44 | addDockWidget(Qt::RightDockWidgetArea, arm_regs); | 44 | addDockWidget(Qt::RightDockWidgetArea, registersWidget); |
| 45 | arm_regs->hide(); | 45 | registersWidget->hide(); |
| 46 | |||
| 47 | callstackWidget = new CallstackWidget(this); | ||
| 48 | addDockWidget(Qt::RightDockWidgetArea, callstackWidget); | ||
| 49 | callstackWidget->hide(); | ||
| 46 | 50 | ||
| 47 | QMenu* debug_menu = ui.menu_View->addMenu(tr("Debugging")); | 51 | QMenu* debug_menu = ui.menu_View->addMenu(tr("Debugging")); |
| 48 | debug_menu->addAction(disasm->toggleViewAction()); | 52 | debug_menu->addAction(disasmWidget->toggleViewAction()); |
| 49 | debug_menu->addAction(arm_regs->toggleViewAction()); | 53 | debug_menu->addAction(registersWidget->toggleViewAction()); |
| 54 | debug_menu->addAction(callstackWidget->toggleViewAction()); | ||
| 50 | 55 | ||
| 51 | // Set default UI state | 56 | // Set default UI state |
| 52 | // geometry: 55% of the window contents are in the upper screen half, 45% in the lower half | 57 | // geometry: 55% of the window contents are in the upper screen half, 45% in the lower half |
| @@ -78,8 +83,9 @@ GMainWindow::GMainWindow() | |||
| 78 | connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog())); | 83 | connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog())); |
| 79 | 84 | ||
| 80 | // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues | 85 | // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues |
| 81 | connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), disasm, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); | 86 | connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), disasmWidget, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); |
| 82 | connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), arm_regs, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); | 87 | connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), registersWidget, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); |
| 88 | connect(&render_window->GetEmuThread(), SIGNAL(CPUStepped()), callstackWidget, SLOT(OnCPUStepped()), Qt::BlockingQueuedConnection); | ||
| 83 | 89 | ||
| 84 | // Setup hotkeys | 90 | // Setup hotkeys |
| 85 | RegisterHotkey("Main Window", "Load Image", QKeySequence::Open); | 91 | RegisterHotkey("Main Window", "Load Image", QKeySequence::Open); |
| @@ -124,8 +130,9 @@ void GMainWindow::BootGame(const char* filename) | |||
| 124 | ERROR_LOG(BOOT, "Failed to load ROM: %s", error_str.c_str()); | 130 | ERROR_LOG(BOOT, "Failed to load ROM: %s", error_str.c_str()); |
| 125 | } | 131 | } |
| 126 | 132 | ||
| 127 | disasm->Init(); | 133 | disasmWidget->Init(); |
| 128 | arm_regs->OnCPUStepped(); | 134 | registersWidget->OnCPUStepped(); |
| 135 | callstackWidget->OnCPUStepped(); | ||
| 129 | 136 | ||
| 130 | render_window->GetEmuThread().start(); | 137 | render_window->GetEmuThread().start(); |
| 131 | } | 138 | } |
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 @@ | |||
| 7 | 7 | ||
| 8 | class GImageInfo; | 8 | class GImageInfo; |
| 9 | class GRenderWindow; | 9 | class GRenderWindow; |
| 10 | class GDisAsmView; | 10 | class DisassemblerWidget; |
| 11 | class GARM11RegsView; | 11 | class RegistersWidget; |
| 12 | class CallstackWidget; | ||
| 12 | 13 | ||
| 13 | class GMainWindow : public QMainWindow | 14 | class GMainWindow : public QMainWindow |
| 14 | { | 15 | { |
| @@ -44,8 +45,10 @@ private: | |||
| 44 | Ui::MainWindow ui; | 45 | Ui::MainWindow ui; |
| 45 | 46 | ||
| 46 | GRenderWindow* render_window; | 47 | GRenderWindow* render_window; |
| 47 | GDisAsmView* disasm; | 48 | |
| 48 | GARM11RegsView* arm_regs; | 49 | DisassemblerWidget* disasmWidget; |
| 50 | RegistersWidget* registersWidget; | ||
| 51 | CallstackWidget* callstackWidget; | ||
| 49 | }; | 52 | }; |
| 50 | 53 | ||
| 51 | #endif // _CITRA_QT_MAIN_HXX_ | 54 | #endif // _CITRA_QT_MAIN_HXX_ |
diff --git a/src/citra_qt/ui_disasm.h b/src/citra_qt/ui_disassembler.h index 697a224cb..a0230fe9c 100644 --- a/src/citra_qt/ui_disasm.h +++ b/src/citra_qt/ui_disassembler.h | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | /******************************************************************************** | 1 | /******************************************************************************** |
| 2 | ** Form generated from reading UI file 'disasm.ui' | 2 | ** Form generated from reading UI file 'disassembler.ui' |
| 3 | ** | 3 | ** |
| 4 | ** Created by: Qt User Interface Compiler version 4.8.5 | 4 | ** Created by: Qt User Interface Compiler version 4.8.5 |
| 5 | ** | 5 | ** |
| 6 | ** WARNING! All changes made in this file will be lost when recompiling UI file! | 6 | ** WARNING! All changes made in this file will be lost when recompiling UI file! |
| 7 | ********************************************************************************/ | 7 | ********************************************************************************/ |
| 8 | 8 | ||
| 9 | #ifndef UI_DISASM_H | 9 | #ifndef UI_DISASSEMBLER_H |
| 10 | #define UI_DISASM_H | 10 | #define UI_DISASSEMBLER_H |
| 11 | 11 | ||
| 12 | #include <QtCore/QVariant> | 12 | #include <QtCore/QVariant> |
| 13 | #include <QtGui/QAction> | 13 | #include <QtGui/QAction> |
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <QtGui/QHBoxLayout> | 17 | #include <QtGui/QHBoxLayout> |
| 18 | #include <QtGui/QHeaderView> | 18 | #include <QtGui/QHeaderView> |
| 19 | #include <QtGui/QPushButton> | 19 | #include <QtGui/QPushButton> |
| 20 | #include <QtGui/QTableView> | ||
| 20 | #include <QtGui/QTreeView> | 21 | #include <QtGui/QTreeView> |
| 21 | #include <QtGui/QVBoxLayout> | 22 | #include <QtGui/QVBoxLayout> |
| 22 | #include <QtGui/QWidget> | 23 | #include <QtGui/QWidget> |
| @@ -35,6 +36,7 @@ public: | |||
| 35 | QPushButton *pushButton; | 36 | QPushButton *pushButton; |
| 36 | QPushButton *button_breakpoint; | 37 | QPushButton *button_breakpoint; |
| 37 | QTreeView *treeView; | 38 | QTreeView *treeView; |
| 39 | QTableView *tableView; | ||
| 38 | 40 | ||
| 39 | void setupUi(QDockWidget *DockWidget) | 41 | void setupUi(QDockWidget *DockWidget) |
| 40 | { | 42 | { |
| @@ -84,6 +86,12 @@ public: | |||
| 84 | 86 | ||
| 85 | verticalLayout->addWidget(treeView); | 87 | verticalLayout->addWidget(treeView); |
| 86 | 88 | ||
| 89 | tableView = new QTableView(dockWidgetContents); | ||
| 90 | tableView->setObjectName(QString::fromUtf8("tableView")); | ||
| 91 | tableView->setAlternatingRowColors(true); | ||
| 92 | |||
| 93 | verticalLayout->addWidget(tableView); | ||
| 94 | |||
| 87 | DockWidget->setWidget(dockWidgetContents); | 95 | DockWidget->setWidget(dockWidgetContents); |
| 88 | 96 | ||
| 89 | retranslateUi(DockWidget); | 97 | retranslateUi(DockWidget); |
| @@ -109,4 +117,4 @@ namespace Ui { | |||
| 109 | 117 | ||
| 110 | QT_END_NAMESPACE | 118 | QT_END_NAMESPACE |
| 111 | 119 | ||
| 112 | #endif // UI_DISASM_H | 120 | #endif // UI_DISASSEMBLER_H |
diff --git a/src/citra_qt/ui_cpu_regs.h b/src/citra_qt/ui_registers.h index b8a80b3f2..3111cd09e 100644 --- a/src/citra_qt/ui_cpu_regs.h +++ b/src/citra_qt/ui_registers.h | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | /******************************************************************************** | 1 | /******************************************************************************** |
| 2 | ** Form generated from reading UI file 'cpu_regs.ui' | 2 | ** Form generated from reading UI file 'registers.ui' |
| 3 | ** | 3 | ** |
| 4 | ** Created by: Qt User Interface Compiler version 4.8.5 | 4 | ** Created by: Qt User Interface Compiler version 4.8.5 |
| 5 | ** | 5 | ** |
| 6 | ** WARNING! All changes made in this file will be lost when recompiling UI file! | 6 | ** WARNING! All changes made in this file will be lost when recompiling UI file! |
| 7 | ********************************************************************************/ | 7 | ********************************************************************************/ |
| 8 | 8 | ||
| 9 | #ifndef UI_CPU_REGS_H | 9 | #ifndef UI_REGISTERS_H |
| 10 | #define UI_CPU_REGS_H | 10 | #define UI_REGISTERS_H |
| 11 | 11 | ||
| 12 | #include <QtCore/QVariant> | 12 | #include <QtCore/QVariant> |
| 13 | #include <QtGui/QAction> | 13 | #include <QtGui/QAction> |
| @@ -66,4 +66,4 @@ namespace Ui { | |||
| 66 | 66 | ||
| 67 | QT_END_NAMESPACE | 67 | QT_END_NAMESPACE |
| 68 | 68 | ||
| 69 | #endif // UI_CPU_REGS_H | 69 | #endif // UI_REGISTERS_H |