| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <QDockWidget> |
| 7 |
|
| 8 |
#include "Common/CommonTypes.h" |
| 9 |
|
| 10 |
class BreakpointWidget; |
| 11 |
class ClickableStatusBar; |
| 12 |
class CodeWidget; |
| 13 |
namespace Core |
| 14 |
{ |
| 15 |
enum class State; |
| 16 |
class System; |
| 17 |
} |
| 18 |
struct JitBlock; |
| 19 |
class JitBlockProxyModel; |
| 20 |
class JitBlockTableModel; |
| 21 |
namespace JitBlockTableModelColumn |
| 22 |
{ |
| 23 |
enum EnumType : int; |
| 24 |
} |
| 25 |
namespace JitBlockTableModelUserRole |
| 26 |
{ |
| 27 |
enum EnumType : int; |
| 28 |
} |
| 29 |
class MemoryWidget; |
| 30 |
class QCloseEvent; |
| 31 |
class QFont; |
| 32 |
class QLineEdit; |
| 33 |
class QMenu; |
| 34 |
class QPlainTextEdit; |
| 35 |
class QPushButton; |
| 36 |
class QShowEvent; |
| 37 |
class QSplitter; |
| 38 |
class QTableView; |
| 39 |
|
| 40 |
class JITWidget final : public QDockWidget |
| 41 |
{ |
| 42 |
Q_OBJECT |
| 43 |
|
| 44 |
using Column = JitBlockTableModelColumn::EnumType; |
| 45 |
using UserRole = JitBlockTableModelUserRole::EnumType; |
| 46 |
|
| 47 |
signals: |
| 48 |
void HideSignal(); |
| 49 |
void ShowSignal(); |
| 50 |
void SetCodeAddress(u32 address); |
| 51 |
|
| 52 |
public: |
| 53 |
explicit JITWidget(Core::System& system, QWidget* parent = nullptr); |
| 54 |
~JITWidget() override; |
| 55 |
|
| 56 |
JITWidget(const JITWidget&) = delete; |
| 57 |
JITWidget(JITWidget&&) = delete; |
| 58 |
JITWidget& operator=(const JITWidget&) = delete; |
| 59 |
JITWidget& operator=(JITWidget&&) = delete; |
| 60 |
|
| 61 |
|
| 62 |
void OnRequestPPCComparison(u32 address, bool translate_address); |
| 63 |
|
| 64 |
private: |
| 65 |
void closeEvent(QCloseEvent* event) override; |
| 66 |
void showEvent(QShowEvent* event) override; |
| 67 |
void hideEvent(QHideEvent* event) override; |
| 68 |
|
| 69 |
void UpdateProfilingButton(); |
| 70 |
void UpdateOtherButtons(Core::State state); |
| 71 |
void UpdateDebugFont(const QFont& font); |
| 72 |
void ClearDisassembly(); |
| 73 |
void ShowFreeMemoryStatus(); |
| 74 |
void UpdateContent(Core::State state); |
| 75 |
void CrossDisassemble(const JitBlock& block); |
| 76 |
void CrossDisassemble(const QModelIndex& index); |
| 77 |
void CrossDisassemble(); |
| 78 |
void TableEraseBlocks(); |
| 79 |
|
| 80 |
|
| 81 |
void LoadQSettings(); |
| 82 |
void SaveQSettings() const; |
| 83 |
void ConnectSlots(); |
| 84 |
void DisconnectSlots(); |
| 85 |
void Show(); |
| 86 |
void Hide(); |
| 87 |
|
| 88 |
|
| 89 |
void OnVisibilityToggled(bool visible); |
| 90 |
void OnDebugModeToggled(bool visible); |
| 91 |
|
| 92 |
|
| 93 |
void OnToggleProfiling(bool enabled); |
| 94 |
void OnClearCache(); |
| 95 |
void OnWipeProfiling(); |
| 96 |
void OnTableCurrentChanged(const QModelIndex& current, const QModelIndex& previous); |
| 97 |
void OnTableDoubleClicked(const QModelIndex& index); |
| 98 |
void OnTableContextMenu(const QPoint& pos); |
| 99 |
void OnTableHeaderContextMenu(const QPoint& pos); |
| 100 |
void OnTableMenuViewCode(); |
| 101 |
void OnTableMenuEraseBlocks(); |
| 102 |
void OnStatusBarPressed(); |
| 103 |
|
| 104 |
|
| 105 |
void OnJitCacheInvalidation(); |
| 106 |
void OnUpdateDisasmDialog(); |
| 107 |
void OnPPCSymbolsUpdated(); |
| 108 |
void OnPPCBreakpointsChanged(); |
| 109 |
void OnConfigChanged(); |
| 110 |
void OnDebugFontChanged(const QFont& font); |
| 111 |
void OnEmulationStateChanged(Core::State state); |
| 112 |
|
| 113 |
Core::System& m_system; |
| 114 |
|
| 115 |
QLineEdit* m_pm_address_covered_line_edit; |
| 116 |
QPushButton* m_clear_cache_button; |
| 117 |
QPushButton* m_toggle_profiling_button; |
| 118 |
QPushButton* m_wipe_profiling_button; |
| 119 |
QTableView* m_table_view; |
| 120 |
JitBlockProxyModel* m_table_proxy; |
| 121 |
JitBlockTableModel* m_table_model; |
| 122 |
QPlainTextEdit* m_ppc_asm_widget; |
| 123 |
QPlainTextEdit* m_host_near_asm_widget; |
| 124 |
QPlainTextEdit* m_host_far_asm_widget; |
| 125 |
QSplitter* m_table_splitter; |
| 126 |
QSplitter* m_disasm_splitter; |
| 127 |
ClickableStatusBar* m_status_bar; |
| 128 |
|
| 129 |
QMenu* m_table_context_menu; |
| 130 |
QMenu* m_column_visibility_menu; |
| 131 |
}; |