summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/debugger/disassembler.hxx
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2014-07-02 21:16:36 +0200
committerTony Wasserka <NeoBrainX@gmail.com>2014-07-02 21:16:36 +0200
commitfd787868288521ae655ddd1ac8000895662eaa77 (patch)
treed8d1b2958ff60d0a209d0268ecfc417f7bb3f45c /src/citra_qt/debugger/disassembler.hxx
parentMerge pull request #22 from bunnei/loader-improvements (diff)
downloadyuzu-fd787868288521ae655ddd1ac8000895662eaa77.tar
yuzu-fd787868288521ae655ddd1ac8000895662eaa77.tar.gz
yuzu-fd787868288521ae655ddd1ac8000895662eaa77.tar.bz2
yuzu-fd787868288521ae655ddd1ac8000895662eaa77.tar.lz
yuzu-fd787868288521ae655ddd1ac8000895662eaa77.tar.xz
yuzu-fd787868288521ae655ddd1ac8000895662eaa77.tar.zst
yuzu-fd787868288521ae655ddd1ac8000895662eaa77.zip
Diffstat (limited to 'src/citra_qt/debugger/disassembler.hxx')
-rw-r--r--src/citra_qt/debugger/disassembler.hxx41
1 files changed, 36 insertions, 5 deletions
diff --git a/src/citra_qt/debugger/disassembler.hxx b/src/citra_qt/debugger/disassembler.hxx
index e668bbbeb..a842da956 100644
--- a/src/citra_qt/debugger/disassembler.hxx
+++ b/src/citra_qt/debugger/disassembler.hxx
@@ -1,3 +1,4 @@
+#include <QAbstractItemModel>
#include <QDockWidget>
#include "ui_disassembler.h"
@@ -5,9 +6,41 @@
#include "common/break_points.h"
class QAction;
-class QStandardItemModel;
class EmuThread;
+class DisassemblerModel : public QAbstractItemModel
+{
+ Q_OBJECT
+
+public:
+ DisassemblerModel(QObject* parent);
+
+ QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex& child) const override;
+ int columnCount(const QModelIndex& parent = QModelIndex()) const override;
+ int rowCount(const QModelIndex& parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
+
+ QModelIndex IndexFromAbsoluteAddress(unsigned int address) const;
+ const BreakPoints& GetBreakPoints() const;
+
+public slots:
+ void ParseFromAddress(unsigned int address);
+ void OnSelectionChanged(const QModelIndex&);
+ void OnSetOrUnsetBreakpoint();
+ void SetNextInstruction(unsigned int address);
+
+private:
+ unsigned int base_address;
+ unsigned int code_size;
+ unsigned int program_counter;
+
+ QModelIndex selection;
+
+ // TODO: Make BreakPoints less crappy (i.e. const-correct) so that this needn't be mutable.
+ mutable BreakPoints breakpoints;
+};
+
class DisassemblerWidget : public QDockWidget
{
Q_OBJECT
@@ -18,7 +51,6 @@ public:
void Init();
public slots:
- void OnSetBreakpoint();
void OnContinue();
void OnStep();
void OnStepInto();
@@ -32,11 +64,10 @@ private:
int SelectedRow();
Ui::DockWidget disasm_ui;
- QStandardItemModel* model;
- u32 base_addr;
+ DisassemblerModel* model;
- BreakPoints* breakpoints;
+ u32 base_addr;
EmuThread& emu_thread;
};