summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/disassembler.h
diff options
context:
space:
mode:
authorGravatar bunnei2015-01-06 12:43:08 -0500
committerGravatar bunnei2015-01-06 12:43:08 -0500
commit0bf5a0bfc47cebb64dc2740c475a631d6fb13a2f (patch)
tree3a173741994c239c4cd41727868ef7676acb26e3 /src/citra_qt/debugger/disassembler.h
parentMerge pull request #417 from kevinhartman/exclusive-tag-fix (diff)
parentcitra-qt: Renamed all .hxx headers to .h (diff)
downloadyuzu-0bf5a0bfc47cebb64dc2740c475a631d6fb13a2f.tar.gz
yuzu-0bf5a0bfc47cebb64dc2740c475a631d6fb13a2f.tar.xz
yuzu-0bf5a0bfc47cebb64dc2740c475a631d6fb13a2f.zip
Merge pull request #402 from chrisvj/master
Renamed all .hxx headers to .h
Diffstat (limited to 'src/citra_qt/debugger/disassembler.h')
-rw-r--r--src/citra_qt/debugger/disassembler.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/citra_qt/debugger/disassembler.h b/src/citra_qt/debugger/disassembler.h
new file mode 100644
index 000000000..6d3cef108
--- /dev/null
+++ b/src/citra_qt/debugger/disassembler.h
@@ -0,0 +1,77 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <QAbstractItemModel>
6#include <QDockWidget>
7#include "ui_disassembler.h"
8
9#include "common/common.h"
10#include "common/break_points.h"
11
12class QAction;
13class EmuThread;
14
15class DisassemblerModel : public QAbstractItemModel
16{
17 Q_OBJECT
18
19public:
20 DisassemblerModel(QObject* parent);
21
22 QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
23 QModelIndex parent(const QModelIndex& child) const override;
24 int columnCount(const QModelIndex& parent = QModelIndex()) const override;
25 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
26 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
27
28 QModelIndex IndexFromAbsoluteAddress(unsigned int address) const;
29 const BreakPoints& GetBreakPoints() const;
30
31public slots:
32 void ParseFromAddress(unsigned int address);
33 void OnSelectionChanged(const QModelIndex&);
34 void OnSetOrUnsetBreakpoint();
35 void SetNextInstruction(unsigned int address);
36
37private:
38 unsigned int base_address;
39 unsigned int code_size;
40 unsigned int program_counter;
41
42 QModelIndex selection;
43
44 // TODO: Make BreakPoints less crappy (i.e. const-correct) so that this needn't be mutable.
45 mutable BreakPoints breakpoints;
46};
47
48class DisassemblerWidget : public QDockWidget
49{
50 Q_OBJECT
51
52public:
53 DisassemblerWidget(QWidget* parent, EmuThread& emu_thread);
54
55 void Init();
56
57public slots:
58 void OnContinue();
59 void OnStep();
60 void OnStepInto();
61 void OnPause();
62 void OnToggleStartStop();
63
64 void OnCPUStepped();
65
66private:
67 // returns -1 if no row is selected
68 int SelectedRow();
69
70 Ui::DockWidget disasm_ui;
71
72 DisassemblerModel* model;
73
74 u32 base_addr;
75
76 EmuThread& emu_thread;
77};