Play-/Source/ui_qt/DebugSupport/QtDebugger.h

161 lines
4.8 KiB
C
Raw Permalink Normal View History

2019-08-31 12:33:24 -04:00
#pragma once
#include <QMainWindow>
#include <QCloseEvent>
2019-12-09 20:16:11 +00:00
#include "DebugView.h"
#include "CallStackWnd.h"
2019-12-10 12:31:00 +00:00
#include "FunctionsView.h"
2023-08-21 20:36:41 -04:00
#include "CommentsView.h"
2023-08-12 10:31:28 -04:00
#include "VariablesView.h"
#include "KernelObjectListView.h"
#include "AddressListViewWnd.h"
2019-08-31 12:33:24 -04:00
#include "PS2VM.h"
2019-12-21 18:36:40 +00:00
#include "ELFView.h"
2019-08-31 12:33:24 -04:00
// Predeclares to avoid headers
class CDebugView;
2019-12-19 21:37:47 +00:00
namespace Ui
{
class QtDebugger;
}
class QtDebugger : public QMainWindow
2019-08-31 12:33:24 -04:00
{
Q_OBJECT
2019-08-31 12:33:24 -04:00
public:
explicit QtDebugger(CPS2VM&);
~QtDebugger();
protected:
void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE;
private slots:
void on_actionResume_triggered();
void on_actionStep_CPU_triggered();
void on_actionAssemble_JAL_triggered();
void on_actionReanalyse_ee_triggered();
void on_actionFind_Functions_triggered();
void on_actionCascade_triggered();
void on_actionTile_triggered();
void on_actionLayout_1024x768_triggered();
2022-04-02 13:01:42 -04:00
void on_actionLayout_1280x800_triggered();
void on_actionLayout_1280x1024_triggered();
void on_actionLayout_1600x1200_triggered();
2019-12-10 00:10:44 +00:00
void on_actionfind_word_value_triggered();
void on_actionFind_Word_Half_Value_triggered();
2019-12-10 00:44:54 +00:00
void on_actionCall_Stack_triggered();
void on_actionFunctions_triggered();
2023-08-21 20:36:41 -04:00
void on_actionComments_triggered();
2023-08-12 10:31:28 -04:00
void on_actionVariables_triggered();
2022-04-05 10:40:34 -04:00
void on_actionELF_File_Information_triggered();
void on_actionViewKernelObject_triggered();
2019-12-12 01:44:55 +00:00
void on_actionView_Disassmebly_triggered();
2019-12-12 12:55:58 +00:00
void on_actionView_Registers_triggered();
2019-12-19 11:58:52 +00:00
void on_actionMemory_triggered();
2019-12-10 00:44:54 +00:00
2019-12-10 01:11:56 +00:00
void on_actionEmotionEngine_View_triggered();
void on_actionVector_Unit_0_triggered();
2019-12-19 21:36:33 +00:00
void on_actionVector_Unit_1_triggered();
2019-12-10 01:11:56 +00:00
void on_actionIOP_View_triggered();
signals:
void OnExecutableChange();
void OnExecutableUnloading();
void OnMachineStateChange();
void OnRunningStateChange();
2019-08-31 12:33:24 -04:00
private:
2019-12-19 21:37:47 +00:00
Ui::QtDebugger* ui;
2019-08-31 12:33:24 -04:00
enum DEBUGVIEW
{
DEBUGVIEW_EE = 0,
DEBUGVIEW_VU0,
DEBUGVIEW_VU1,
DEBUGVIEW_IOP,
DEBUGVIEW_MAX,
};
void RegisterPreferences();
void UpdateTitle();
void LoadSettings();
void SaveSettings();
void SerializeWindowGeometry(QWidget*, const char*, const char*, const char*, const char*, const char*);
void UnserializeWindowGeometry(QWidget*, const char*, const char*, const char*, const char*, const char*);
2019-08-31 12:33:24 -04:00
void Resume();
void StepCPU();
void FindWordValue(uint32);
void AssembleJAL();
void ReanalyzeEe();
void FindEeFunctions();
2022-04-02 13:00:23 -04:00
void Layout1024x768();
2022-04-02 13:01:42 -04:00
void Layout1280x800();
2022-04-02 13:00:23 -04:00
void Layout1280x1024();
void Layout1600x1200();
2019-08-31 12:33:24 -04:00
void LoadDebugTags();
void SaveDebugTags();
//View related functions
void ActivateView(unsigned int);
void LoadViewLayout();
void SaveViewLayout();
void LoadBytesPerLine();
void SaveBytesPerLine();
CDebugView* GetCurrentView();
2019-12-11 14:52:12 +00:00
CDisAsmWnd* GetDisassemblyWindow();
2019-12-19 11:58:52 +00:00
CMemoryViewMIPSWnd* GetMemoryViewWindow();
2019-12-09 20:16:11 +00:00
CRegViewWnd* GetRegisterViewWindow();
CCallStackWnd* GetCallStackWindow();
2019-08-31 12:33:24 -04:00
//Search functions
static std::vector<uint32> FindCallers(CMIPS*, uint32);
static std::vector<uint32> FindWordValueRefs(CMIPS*, uint32, uint32);
//Event handlers
2023-08-21 20:36:41 -04:00
void OnFunctionsCommentsViewItemDblClick(uint32);
void OnFunctionsCommentsViewStateChange();
2023-08-12 10:31:28 -04:00
void OnVariablesViewVariableDblClick(uint32);
void OnKernelObjectsViewAddressDblClick(uint32);
void OnExecutableChangeMsg();
void OnExecutableUnloadingMsg();
void OnMachineStateChangeMsg();
void OnRunningStateChangeMsg();
2019-08-31 12:33:24 -04:00
void OnFindCallersRequested(uint32);
void OnFindCallersAddressDblClick(uint32);
Framework::CSignal<void(uint32)>::Connection m_OnFunctionDblClickConnection;
Framework::CSignal<void()>::Connection m_OnFunctionsStateChangeConnection;
2023-08-21 20:36:41 -04:00
Framework::CSignal<void(uint32)>::Connection m_OnCommentDblClickConnection;
Framework::CSignal<void()>::Connection m_OnCommentsStateChangeConnection;
2023-08-12 10:31:28 -04:00
Framework::CSignal<void(uint32)>::Connection m_OnVariablesDblClickConnection;
2022-09-10 12:23:26 -04:00
CKernelObjectListView::OnGotoAddressSignal::Connection m_OnGotoAddressConnection;
CKernelObjectListView::OnObjectTypeChangedSignal::Connection m_OnKernelObjectListViewTypeChangedConnection;
2019-08-31 12:33:24 -04:00
2019-12-10 00:37:53 +00:00
CAddressListViewWnd::AddressSelectedEvent::Connection m_AddressSelectedConnection;
2019-08-31 12:33:24 -04:00
Framework::CSignal<void()>::Connection m_OnExecutableChangeConnection;
Framework::CSignal<void()>::Connection m_OnExecutableUnloadingConnection;
2022-01-18 17:45:57 +00:00
CVirtualMachine::MachineStateChangeEvent::Connection m_OnMachineStateChangeConnection;
2022-01-14 15:02:49 +00:00
CVirtualMachine::RunningStateChangeEvent::Connection m_OnRunningStateChangeConnection;
2019-08-31 12:33:24 -04:00
2019-12-19 22:20:32 +00:00
CDisAsmWnd::FindCallersRequestedEvent::Connection m_findCallersRequestConnection;
2019-08-31 12:33:24 -04:00
CELFView<CELF32>* m_pELFView = nullptr;
2019-12-10 12:31:00 +00:00
CFunctionsView* m_pFunctionsView = nullptr;
2023-08-21 20:36:41 -04:00
CCommentsView* m_pCommentsView = nullptr;
2023-08-12 10:31:28 -04:00
CVariablesView* m_pVariablesView = nullptr;
CKernelObjectListView* m_kernelObjectListView = nullptr;
QMdiSubWindow* m_kernelObjectListViewWnd = nullptr;
2023-03-05 13:01:45 -05:00
CDebugView* m_pView[DEBUGVIEW_MAX] = {};
CAddressListViewWnd* m_addressListView = nullptr;
2019-08-31 12:33:24 -04:00
unsigned int m_nCurrentView;
CPS2VM& m_virtualMachine;
};