[User Interface] Clean up Debugger-Commands.h
This commit is contained in:
parent
188d6ae6d1
commit
30e180104a
|
@ -8,7 +8,6 @@
|
||||||
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||||
* *
|
* *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "OpInfo.h"
|
#include "OpInfo.h"
|
||||||
|
@ -18,10 +17,12 @@
|
||||||
|
|
||||||
#include <Project64/UserInterface/WTLControls/TooltipDialog.h>
|
#include <Project64/UserInterface/WTLControls/TooltipDialog.h>
|
||||||
|
|
||||||
class CCommandList : public CWindowImpl<CCommandList, CListViewCtrl>
|
class CCommandList :
|
||||||
|
public CWindowImpl<CCommandList, CListViewCtrl>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum {
|
enum
|
||||||
|
{
|
||||||
COL_ARROWS,
|
COL_ARROWS,
|
||||||
COL_ADDRESS,
|
COL_ADDRESS,
|
||||||
COL_COMMAND,
|
COL_COMMAND,
|
||||||
|
@ -85,119 +86,6 @@ public:
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CBreakpoints* m_Breakpoints;
|
|
||||||
vector<uint32_t> m_History;
|
|
||||||
int m_HistoryIndex;
|
|
||||||
|
|
||||||
CAddBreakpointDlg m_AddBreakpointDlg;
|
|
||||||
CAddSymbolDlg m_AddSymbolDlg;
|
|
||||||
|
|
||||||
DWORD m_StartAddress;
|
|
||||||
CRect m_DefaultWindowRect;
|
|
||||||
|
|
||||||
CEditNumber32 m_PCEdit;
|
|
||||||
bool m_bIgnorePCChange;
|
|
||||||
|
|
||||||
CEditNumber32 m_AddressEdit;
|
|
||||||
bool m_bIgnoreAddrChange;
|
|
||||||
|
|
||||||
CCommandList m_CommandList;
|
|
||||||
int m_CommandListRows;
|
|
||||||
CListBox m_BreakpointList;
|
|
||||||
CScrollBar m_Scrollbar;
|
|
||||||
|
|
||||||
CRegisterTabs m_RegisterTabs;
|
|
||||||
|
|
||||||
CButton m_BackButton;
|
|
||||||
CButton m_ForwardButton;
|
|
||||||
|
|
||||||
CButton m_ViewPCButton;
|
|
||||||
CButton m_StepButton;
|
|
||||||
CButton m_SkipButton;
|
|
||||||
CButton m_GoButton;
|
|
||||||
|
|
||||||
bool m_bEditing;
|
|
||||||
CEditOp m_OpEdit;
|
|
||||||
|
|
||||||
uint32_t m_SelectedAddress;
|
|
||||||
COpInfo m_SelectedOpInfo;
|
|
||||||
OPCODE& m_SelectedOpCode = m_SelectedOpInfo.m_OpCode;
|
|
||||||
|
|
||||||
uint32_t m_FollowAddress;
|
|
||||||
uint32_t m_RowHeight;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint32_t address;
|
|
||||||
uint32_t originalOp;
|
|
||||||
} EditedOp;
|
|
||||||
|
|
||||||
vector<EditedOp> m_EditedOps;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int startPos;
|
|
||||||
int endPos;
|
|
||||||
int startMargin;
|
|
||||||
int endMargin;
|
|
||||||
int margin;
|
|
||||||
} BRANCHARROW;
|
|
||||||
|
|
||||||
vector<BRANCHARROW> m_BranchArrows;
|
|
||||||
void AddBranchArrow(int startPos, int endPos);
|
|
||||||
void ClearBranchArrows();
|
|
||||||
void DrawBranchArrows(HDC listDC);
|
|
||||||
|
|
||||||
vector<bool> m_bvAnnotatedLines;
|
|
||||||
|
|
||||||
void ClearEditedOps();
|
|
||||||
void EditOp(uint32_t address, uint32_t op);
|
|
||||||
void RestoreOp(uint32_t address);
|
|
||||||
void RestoreAllOps();
|
|
||||||
BOOL IsOpEdited(uint32_t address);
|
|
||||||
void BeginOpEdit(uint32_t address);
|
|
||||||
void EndOpEdit();
|
|
||||||
|
|
||||||
void GotoEnteredAddress();
|
|
||||||
void CheckCPUType();
|
|
||||||
void RefreshBreakpointList();
|
|
||||||
void RemoveSelectedBreakpoints();
|
|
||||||
|
|
||||||
bool AddressSafe(uint32_t vaddr);
|
|
||||||
|
|
||||||
void HistoryPushState();
|
|
||||||
void ToggleHistoryButtons();
|
|
||||||
|
|
||||||
static CDebugCommandsView* _this;
|
|
||||||
static HHOOK hWinMessageHook;
|
|
||||||
static LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
|
||||||
void InterceptKeyDown(WPARAM wParam, LPARAM lParam);
|
|
||||||
void InterceptMouseWheel(WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
static const char* GetCodeAddressNotes(uint32_t vAddr);
|
|
||||||
static const char* GetDataAddressNotes(uint32_t vAddr);
|
|
||||||
|
|
||||||
void CPUSkip();
|
|
||||||
void CPUStepInto();
|
|
||||||
void CPUResume();
|
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
||||||
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
||||||
LRESULT OnSizing(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
||||||
LRESULT OnScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
||||||
LRESULT OnMeasureItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
||||||
LRESULT OnAddrChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
|
||||||
LRESULT OnPCChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
|
||||||
LRESULT OnListBoxClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
|
||||||
|
|
||||||
LRESULT OnOpKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
||||||
|
|
||||||
LRESULT OnCommandListClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnCommandListDblClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnCommandListRightClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnRegisterTabChange(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnCustomDrawList(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnDestroy(void);
|
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDebugCommandsView)
|
BEGIN_MSG_MAP_EX(CDebugCommandsView)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
||||||
|
@ -250,4 +138,118 @@ private:
|
||||||
TOOLTIP(IDC_BP_LIST, "Active breakpoints")
|
TOOLTIP(IDC_BP_LIST, "Active breakpoints")
|
||||||
TOOLTIP(IDC_SYMBOLS_BTN, "Symbols...")
|
TOOLTIP(IDC_SYMBOLS_BTN, "Symbols...")
|
||||||
END_TOOLTIP_MAP()
|
END_TOOLTIP_MAP()
|
||||||
|
|
||||||
|
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
LRESULT OnSizing(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
LRESULT OnScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
LRESULT OnMeasureItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
LRESULT OnAddrChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
|
LRESULT OnPCChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
|
LRESULT OnListBoxClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
|
|
||||||
|
LRESULT OnOpKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
|
||||||
|
LRESULT OnCommandListClicked(NMHDR* pNMHDR);
|
||||||
|
LRESULT OnCommandListDblClicked(NMHDR* pNMHDR);
|
||||||
|
LRESULT OnCommandListRightClicked(NMHDR* pNMHDR);
|
||||||
|
LRESULT OnRegisterTabChange(NMHDR* pNMHDR);
|
||||||
|
LRESULT OnCustomDrawList(NMHDR* pNMHDR);
|
||||||
|
LRESULT OnDestroy(void);
|
||||||
|
|
||||||
|
void ClearEditedOps();
|
||||||
|
void EditOp(uint32_t address, uint32_t op);
|
||||||
|
void RestoreOp(uint32_t address);
|
||||||
|
void RestoreAllOps();
|
||||||
|
BOOL IsOpEdited(uint32_t address);
|
||||||
|
void BeginOpEdit(uint32_t address);
|
||||||
|
void EndOpEdit();
|
||||||
|
|
||||||
|
void GotoEnteredAddress();
|
||||||
|
void CheckCPUType();
|
||||||
|
void RefreshBreakpointList();
|
||||||
|
void RemoveSelectedBreakpoints();
|
||||||
|
|
||||||
|
bool AddressSafe(uint32_t vaddr);
|
||||||
|
|
||||||
|
void HistoryPushState();
|
||||||
|
void ToggleHistoryButtons();
|
||||||
|
|
||||||
|
static CDebugCommandsView* _this;
|
||||||
|
static HHOOK hWinMessageHook;
|
||||||
|
static LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||||
|
void InterceptKeyDown(WPARAM wParam, LPARAM lParam);
|
||||||
|
void InterceptMouseWheel(WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
|
static const char* GetCodeAddressNotes(uint32_t vAddr);
|
||||||
|
static const char* GetDataAddressNotes(uint32_t vAddr);
|
||||||
|
|
||||||
|
void CPUSkip();
|
||||||
|
void CPUStepInto();
|
||||||
|
void CPUResume();
|
||||||
|
|
||||||
|
void AddBranchArrow(int startPos, int endPos);
|
||||||
|
void ClearBranchArrows();
|
||||||
|
void DrawBranchArrows(HDC listDC);
|
||||||
|
|
||||||
|
CBreakpoints* m_Breakpoints;
|
||||||
|
vector<uint32_t> m_History;
|
||||||
|
int m_HistoryIndex;
|
||||||
|
|
||||||
|
CAddBreakpointDlg m_AddBreakpointDlg;
|
||||||
|
CAddSymbolDlg m_AddSymbolDlg;
|
||||||
|
|
||||||
|
DWORD m_StartAddress;
|
||||||
|
CRect m_DefaultWindowRect;
|
||||||
|
|
||||||
|
CEditNumber32 m_PCEdit;
|
||||||
|
bool m_bIgnorePCChange;
|
||||||
|
|
||||||
|
CEditNumber32 m_AddressEdit;
|
||||||
|
bool m_bIgnoreAddrChange;
|
||||||
|
|
||||||
|
CCommandList m_CommandList;
|
||||||
|
int m_CommandListRows;
|
||||||
|
CListBox m_BreakpointList;
|
||||||
|
CScrollBar m_Scrollbar;
|
||||||
|
|
||||||
|
CRegisterTabs m_RegisterTabs;
|
||||||
|
|
||||||
|
CButton m_BackButton;
|
||||||
|
CButton m_ForwardButton;
|
||||||
|
|
||||||
|
CButton m_ViewPCButton;
|
||||||
|
CButton m_StepButton;
|
||||||
|
CButton m_SkipButton;
|
||||||
|
CButton m_GoButton;
|
||||||
|
|
||||||
|
bool m_bEditing;
|
||||||
|
CEditOp m_OpEdit;
|
||||||
|
|
||||||
|
uint32_t m_SelectedAddress;
|
||||||
|
COpInfo m_SelectedOpInfo;
|
||||||
|
OPCODE& m_SelectedOpCode = m_SelectedOpInfo.m_OpCode;
|
||||||
|
|
||||||
|
uint32_t m_FollowAddress;
|
||||||
|
uint32_t m_RowHeight;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint32_t address;
|
||||||
|
uint32_t originalOp;
|
||||||
|
} EditedOp;
|
||||||
|
|
||||||
|
vector<EditedOp> m_EditedOps;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int startPos;
|
||||||
|
int endPos;
|
||||||
|
int startMargin;
|
||||||
|
int endMargin;
|
||||||
|
int margin;
|
||||||
|
} BRANCHARROW;
|
||||||
|
|
||||||
|
vector<BRANCHARROW> m_BranchArrows;
|
||||||
|
vector<bool> m_bvAnnotatedLines;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue