[Project64] clean up debugger code
This commit is contained in:
parent
b645ef908f
commit
7bb70c2a49
|
@ -2,31 +2,29 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
||||||
typedef void(*SYNTAX)(uint32_t* opcode);
|
typedef void(*SYNTAX)(uint32_t* opcode);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char* name;
|
const char* name;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
uint32_t(*base)(uint32_t val); // value shift
|
uint32_t(*base)(uint32_t val); // value shift
|
||||||
SYNTAX* syntax; // arguments
|
SYNTAX* syntax; // arguments
|
||||||
} INSTRUCTION;
|
} INSTRUCTION;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char* name;
|
const char* name;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
} REGISTER;
|
} REGISTER;
|
||||||
|
|
||||||
enum ParseError
|
enum ParseError
|
||||||
{
|
{
|
||||||
ERR_NONE,
|
ERR_NONE,
|
||||||
ERR_EXPECTED_REG,
|
ERR_EXPECTED_REG,
|
||||||
ERR_INVALID_REG,
|
ERR_INVALID_REG,
|
||||||
ERR_EXPECTED_VAL
|
ERR_EXPECTED_VAL
|
||||||
};
|
};
|
||||||
|
|
||||||
class CAssembler {
|
class CAssembler {
|
||||||
public:
|
public:
|
||||||
static bool AssembleLine(char* line, uint32_t* opcode, uint32_t address = 0x00000000);
|
static bool AssembleLine(char* line, uint32_t* opcode, uint32_t address = 0x00000000);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -15,129 +15,128 @@
|
||||||
|
|
||||||
class CBreakpoints {
|
class CBreakpoints {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t address;
|
uint32_t address;
|
||||||
bool bTemporary;
|
bool bTemporary;
|
||||||
} BREAKPOINT;
|
} BREAKPOINT;
|
||||||
|
|
||||||
enum BPSTATE {
|
enum BPSTATE {
|
||||||
BP_NOT_SET = FALSE,
|
BP_NOT_SET = FALSE,
|
||||||
BP_SET,
|
BP_SET,
|
||||||
BP_SET_TEMP
|
BP_SET_TEMP
|
||||||
};
|
};
|
||||||
|
|
||||||
CBreakpoints();
|
CBreakpoints();
|
||||||
|
|
||||||
BOOL m_Debugging;
|
BOOL m_Debugging;
|
||||||
BOOL m_Skipping;
|
BOOL m_Skipping;
|
||||||
|
|
||||||
std::vector<BREAKPOINT> m_RBP;
|
std::vector<BREAKPOINT> m_RBP;
|
||||||
std::vector<BREAKPOINT> m_WBP;
|
std::vector<BREAKPOINT> m_WBP;
|
||||||
std::vector<BREAKPOINT> m_EBP;
|
std::vector<BREAKPOINT> m_EBP;
|
||||||
|
|
||||||
int m_nRBP;
|
int m_nRBP;
|
||||||
int m_nWBP;
|
int m_nWBP;
|
||||||
int m_nEBP;
|
int m_nEBP;
|
||||||
|
|
||||||
void Pause();
|
void Pause();
|
||||||
void Resume();
|
void Resume();
|
||||||
void Skip();
|
void Skip();
|
||||||
|
|
||||||
BOOL isDebugging();
|
BOOL isDebugging();
|
||||||
void KeepDebugging();
|
void KeepDebugging();
|
||||||
void StopDebugging();
|
void StopDebugging();
|
||||||
inline BOOL isSkipping()
|
inline BOOL isSkipping()
|
||||||
{
|
{
|
||||||
BOOL ret = m_Skipping;
|
BOOL ret = m_Skipping;
|
||||||
m_Skipping = FALSE;
|
m_Skipping = FALSE;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RBPAdd(uint32_t address, bool bTemporary = false);
|
bool RBPAdd(uint32_t address, bool bTemporary = false);
|
||||||
void RBPRemove(uint32_t address);
|
void RBPRemove(uint32_t address);
|
||||||
void RBPToggle(uint32_t address, bool bTemporary = false);
|
void RBPToggle(uint32_t address, bool bTemporary = false);
|
||||||
void RBPClear();
|
void RBPClear();
|
||||||
|
|
||||||
bool WBPAdd(uint32_t address, bool bTemporary = false);
|
bool WBPAdd(uint32_t address, bool bTemporary = false);
|
||||||
void WBPRemove(uint32_t address);
|
void WBPRemove(uint32_t address);
|
||||||
void WBPToggle(uint32_t address, bool bTemporary = false);
|
void WBPToggle(uint32_t address, bool bTemporary = false);
|
||||||
void WBPClear();
|
void WBPClear();
|
||||||
|
|
||||||
bool EBPAdd(uint32_t address, bool bTemporary = false);
|
bool EBPAdd(uint32_t address, bool bTemporary = false);
|
||||||
void EBPRemove(uint32_t address);
|
void EBPRemove(uint32_t address);
|
||||||
void EBPToggle(uint32_t address, bool bTemporary = false);
|
void EBPToggle(uint32_t address, bool bTemporary = false);
|
||||||
void EBPClear();
|
void EBPClear();
|
||||||
|
|
||||||
void BPClear();
|
|
||||||
|
|
||||||
// inlines
|
void BPClear();
|
||||||
|
|
||||||
inline BPSTATE RBPExists(uint32_t address, bool bRemoveTemp = false)
|
// inlines
|
||||||
{
|
|
||||||
for (int i = 0; i < m_nRBP; i++)
|
|
||||||
{
|
|
||||||
if (m_RBP[i].address != address)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_RBP[i].bTemporary)
|
inline BPSTATE RBPExists(uint32_t address, bool bRemoveTemp = false)
|
||||||
{
|
{
|
||||||
if (bRemoveTemp)
|
for (int i = 0; i < m_nRBP; i++)
|
||||||
{
|
{
|
||||||
RBPRemove(address);
|
if (m_RBP[i].address != address)
|
||||||
}
|
{
|
||||||
return BP_SET_TEMP;
|
continue;
|
||||||
}
|
}
|
||||||
return BP_SET;
|
|
||||||
}
|
|
||||||
return BP_NOT_SET;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline BPSTATE WBPExists(uint32_t address, bool bRemoveTemp = false)
|
if (m_RBP[i].bTemporary)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_nWBP; i++)
|
if (bRemoveTemp)
|
||||||
{
|
{
|
||||||
if (m_WBP[i].address != address)
|
RBPRemove(address);
|
||||||
{
|
}
|
||||||
continue;
|
return BP_SET_TEMP;
|
||||||
}
|
}
|
||||||
|
return BP_SET;
|
||||||
|
}
|
||||||
|
return BP_NOT_SET;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_WBP[i].bTemporary)
|
inline BPSTATE WBPExists(uint32_t address, bool bRemoveTemp = false)
|
||||||
{
|
{
|
||||||
if (bRemoveTemp)
|
for (int i = 0; i < m_nWBP; i++)
|
||||||
{
|
{
|
||||||
WBPRemove(address);
|
if (m_WBP[i].address != address)
|
||||||
}
|
{
|
||||||
return BP_SET_TEMP;
|
continue;
|
||||||
}
|
}
|
||||||
return BP_SET;
|
|
||||||
}
|
|
||||||
return BP_NOT_SET;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline BPSTATE EBPExists(uint32_t address, bool bRemoveTemp = false)
|
if (m_WBP[i].bTemporary)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_nEBP; i++)
|
if (bRemoveTemp)
|
||||||
{
|
{
|
||||||
if (m_EBP[i].address != address)
|
WBPRemove(address);
|
||||||
{
|
}
|
||||||
continue;
|
return BP_SET_TEMP;
|
||||||
}
|
}
|
||||||
|
return BP_SET;
|
||||||
|
}
|
||||||
|
return BP_NOT_SET;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_EBP[i].bTemporary)
|
inline BPSTATE EBPExists(uint32_t address, bool bRemoveTemp = false)
|
||||||
{
|
{
|
||||||
if (bRemoveTemp)
|
for (int i = 0; i < m_nEBP; i++)
|
||||||
{
|
{
|
||||||
EBPRemove(address);
|
if (m_EBP[i].address != address)
|
||||||
}
|
{
|
||||||
return BP_SET_TEMP;
|
continue;
|
||||||
}
|
}
|
||||||
return BP_SET;
|
|
||||||
}
|
|
||||||
return BP_NOT_SET;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (m_EBP[i].bTemporary)
|
||||||
|
{
|
||||||
|
if (bRemoveTemp)
|
||||||
|
{
|
||||||
|
EBPRemove(address);
|
||||||
|
}
|
||||||
|
return BP_SET_TEMP;
|
||||||
|
}
|
||||||
|
return BP_SET;
|
||||||
|
}
|
||||||
|
return BP_NOT_SET;
|
||||||
|
}
|
||||||
};
|
};
|
|
@ -14,23 +14,23 @@
|
||||||
|
|
||||||
struct DMALOGENTRY
|
struct DMALOGENTRY
|
||||||
{
|
{
|
||||||
uint32_t romAddr;
|
uint32_t romAddr;
|
||||||
uint32_t ramAddr;
|
uint32_t ramAddr;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CDMALog
|
class CDMALog
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
vector<DMALOGENTRY> m_Log;
|
vector<DMALOGENTRY> m_Log;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void AddEntry(uint32_t romAddr, uint32_t ramAddr, uint32_t length);
|
void AddEntry(uint32_t romAddr, uint32_t ramAddr, uint32_t length);
|
||||||
void ClearEntries();
|
void ClearEntries();
|
||||||
size_t GetNumEntries();
|
size_t GetNumEntries();
|
||||||
DMALOGENTRY* GetEntryByIndex(uint32_t index);
|
DMALOGENTRY* GetEntryByIndex(uint32_t index);
|
||||||
DMALOGENTRY* GetEntryByRamAddress(uint32_t ramAddr);
|
DMALOGENTRY* GetEntryByRamAddress(uint32_t ramAddr);
|
||||||
DMALOGENTRY* GetEntryByRamAddress(uint32_t ramAddr, uint32_t* lpRomAddr, uint32_t* lpOffset);
|
DMALOGENTRY* GetEntryByRamAddress(uint32_t ramAddr, uint32_t* lpRomAddr, uint32_t* lpOffset);
|
||||||
DMALOGENTRY* GetEntryByRomAddress(uint32_t romAddr);
|
DMALOGENTRY* GetEntryByRomAddress(uint32_t romAddr);
|
||||||
DMALOGENTRY* GetEntryByRomAddress(uint32_t romAddr, uint32_t* lpRamAddr, uint32_t* lpOffset);
|
DMALOGENTRY* GetEntryByRomAddress(uint32_t romAddr, uint32_t* lpRamAddr, uint32_t* lpOffset);
|
||||||
};
|
};
|
|
@ -16,32 +16,32 @@
|
||||||
class CAddBreakpointDlg : public CDialogImpl<CAddBreakpointDlg>
|
class CAddBreakpointDlg : public CDialogImpl<CAddBreakpointDlg>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_AddBreakpoint };
|
enum { IDD = IDD_Debugger_AddBreakpoint };
|
||||||
|
|
||||||
INT_PTR CAddBreakpointDlg::DoModal(CDebuggerUI* debugger)
|
INT_PTR CAddBreakpointDlg::DoModal(CDebuggerUI* debugger)
|
||||||
{
|
{
|
||||||
m_Debugger = debugger;
|
m_Debugger = debugger;
|
||||||
return CDialogImpl<CAddBreakpointDlg>::DoModal();
|
return CDialogImpl<CAddBreakpointDlg>::DoModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CDebuggerUI* m_Debugger;
|
CDebuggerUI* m_Debugger;
|
||||||
|
|
||||||
CButton m_ReadCheck;
|
CButton m_ReadCheck;
|
||||||
CButton m_WriteCheck;
|
CButton m_WriteCheck;
|
||||||
CButton m_ExecuteCheck;
|
CButton m_ExecuteCheck;
|
||||||
CEdit m_AddressEdit;
|
CEdit m_AddressEdit;
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
LRESULT OnDestroy(void)
|
LRESULT OnDestroy(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CAddBreakpointDlg)
|
BEGIN_MSG_MAP_EX(CAddBreakpointDlg)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
MSG_WM_DESTROY(OnDestroy)
|
MSG_WM_DESTROY(OnDestroy)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
};
|
};
|
|
@ -16,35 +16,35 @@
|
||||||
class CAddSymbolDlg : public CDialogImpl<CAddSymbolDlg>
|
class CAddSymbolDlg : public CDialogImpl<CAddSymbolDlg>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_AddSymbol };
|
enum { IDD = IDD_Debugger_AddSymbol };
|
||||||
|
|
||||||
|
INT_PTR DoModal(CDebuggerUI* debugger);
|
||||||
|
INT_PTR DoModal(CDebuggerUI* debugger, uint32_t initAddress);
|
||||||
|
INT_PTR DoModal(CDebuggerUI* debugger, uint32_t initAddress, int initType);
|
||||||
|
|
||||||
INT_PTR DoModal(CDebuggerUI* debugger);
|
|
||||||
INT_PTR DoModal(CDebuggerUI* debugger, uint32_t initAddress);
|
|
||||||
INT_PTR DoModal(CDebuggerUI* debugger, uint32_t initAddress, int initType);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CDebuggerUI* m_Debugger;
|
CDebuggerUI* m_Debugger;
|
||||||
|
|
||||||
bool m_bHaveAddress;
|
bool m_bHaveAddress;
|
||||||
bool m_bHaveType;
|
bool m_bHaveType;
|
||||||
uint32_t m_InitAddress;
|
uint32_t m_InitAddress;
|
||||||
int m_InitType;
|
int m_InitType;
|
||||||
|
|
||||||
CEditNumber m_AddressEdit;
|
CEditNumber m_AddressEdit;
|
||||||
CComboBox m_TypeComboBox;
|
CComboBox m_TypeComboBox;
|
||||||
CEdit m_NameEdit;
|
CEdit m_NameEdit;
|
||||||
CEdit m_DescriptionEdit;
|
CEdit m_DescriptionEdit;
|
||||||
|
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
|
||||||
LRESULT OnDestroy(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CAddSymbolDlg)
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
LRESULT OnDestroy(void)
|
||||||
MSG_WM_DESTROY(OnDestroy)
|
{
|
||||||
END_MSG_MAP()
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_MSG_MAP_EX(CAddSymbolDlg)
|
||||||
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
|
MSG_WM_DESTROY(OnDestroy)
|
||||||
|
END_MSG_MAP()
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,37 +21,37 @@
|
||||||
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,
|
||||||
COL_PARAMETERS,
|
COL_PARAMETERS,
|
||||||
COL_SYMBOL
|
COL_SYMBOL
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ROW_HEIGHT = 13,
|
ROW_HEIGHT = 13,
|
||||||
};
|
};
|
||||||
|
|
||||||
void Attach(HWND hWndNew)
|
void Attach(HWND hWndNew)
|
||||||
{
|
{
|
||||||
CListViewCtrl::Attach(hWndNew);
|
CListViewCtrl::Attach(hWndNew);
|
||||||
ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
|
ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
|
||||||
SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP);
|
SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP);
|
||||||
AddColumn("", COL_ARROWS);
|
AddColumn("", COL_ARROWS);
|
||||||
AddColumn("Address", COL_ADDRESS);
|
AddColumn("Address", COL_ADDRESS);
|
||||||
AddColumn("Command", COL_COMMAND);
|
AddColumn("Command", COL_COMMAND);
|
||||||
AddColumn("Parameters", COL_PARAMETERS);
|
AddColumn("Parameters", COL_PARAMETERS);
|
||||||
AddColumn("Symbol", COL_SYMBOL);
|
AddColumn("Symbol", COL_SYMBOL);
|
||||||
SetColumnWidth(COL_ARROWS, 30);
|
SetColumnWidth(COL_ARROWS, 30);
|
||||||
SetColumnWidth(COL_ADDRESS, 65);
|
SetColumnWidth(COL_ADDRESS, 65);
|
||||||
SetColumnWidth(COL_COMMAND, 60);
|
SetColumnWidth(COL_COMMAND, 60);
|
||||||
SetColumnWidth(COL_PARAMETERS, 120);
|
SetColumnWidth(COL_PARAMETERS, 120);
|
||||||
SetColumnWidth(COL_SYMBOL, 140);
|
SetColumnWidth(COL_SYMBOL, 140);
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CCommandsList)
|
BEGIN_MSG_MAP_EX(CCommandsList)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
class CEditOp;
|
class CEditOp;
|
||||||
|
@ -60,212 +60,212 @@ class CDebugCommandsView;
|
||||||
class CEditOp : public CWindowImpl<CEditOp, CEdit>
|
class CEditOp : public CWindowImpl<CEditOp, CEdit>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CDebugCommandsView* m_CommandsWindow;
|
CDebugCommandsView* m_CommandsWindow;
|
||||||
|
|
||||||
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
LRESULT OnKeyUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
LRESULT OnKeyUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||||
{
|
{
|
||||||
if (wParam == VK_RETURN || wParam == VK_ESCAPE)
|
if (wParam == VK_RETURN || wParam == VK_ESCAPE)
|
||||||
{
|
{
|
||||||
bHandled = TRUE;
|
bHandled = TRUE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
bHandled = FALSE;
|
bHandled = FALSE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CEditOp)
|
BEGIN_MSG_MAP_EX(CEditOp)
|
||||||
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
|
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
|
||||||
MESSAGE_HANDLER(WM_KEYUP, OnKeyUp)
|
MESSAGE_HANDLER(WM_KEYUP, OnKeyUp)
|
||||||
MESSAGE_HANDLER(WM_CHAR, OnKeyUp)
|
MESSAGE_HANDLER(WM_CHAR, OnKeyUp)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void SetCommandsWindow(CDebugCommandsView* commandsWindow);
|
void SetCommandsWindow(CDebugCommandsView* commandsWindow);
|
||||||
BOOL Attach(HWND hWndNew);
|
BOOL Attach(HWND hWndNew);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CDebugCommandsView :
|
class CDebugCommandsView :
|
||||||
public CDebugDialog<CDebugCommandsView>,
|
public CDebugDialog<CDebugCommandsView>,
|
||||||
public CDialogResize<CDebugCommandsView>,
|
public CDialogResize<CDebugCommandsView>,
|
||||||
public CToolTipDialog<CDebugCommandsView>
|
public CToolTipDialog<CDebugCommandsView>
|
||||||
{
|
{
|
||||||
friend class CEditOp;
|
friend class CEditOp;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_Commands };
|
enum { IDD = IDD_Debugger_Commands };
|
||||||
|
|
||||||
CDebugCommandsView(CDebuggerUI * debugger);
|
CDebugCommandsView(CDebuggerUI * debugger);
|
||||||
virtual ~CDebugCommandsView(void);
|
virtual ~CDebugCommandsView(void);
|
||||||
|
|
||||||
void ShowAddress(DWORD address, BOOL top);
|
void ShowAddress(DWORD address, BOOL top);
|
||||||
void ShowPIRegTab();
|
void ShowPIRegTab();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CBreakpoints* m_Breakpoints;
|
CBreakpoints* m_Breakpoints;
|
||||||
vector<uint32_t> m_History;
|
vector<uint32_t> m_History;
|
||||||
int m_HistoryIndex;
|
int m_HistoryIndex;
|
||||||
|
|
||||||
CAddBreakpointDlg m_AddBreakpointDlg;
|
CAddBreakpointDlg m_AddBreakpointDlg;
|
||||||
CAddSymbolDlg m_AddSymbolDlg;
|
CAddSymbolDlg m_AddSymbolDlg;
|
||||||
|
|
||||||
DWORD m_StartAddress;
|
DWORD m_StartAddress;
|
||||||
CRect m_DefaultWindowRect;
|
CRect m_DefaultWindowRect;
|
||||||
|
|
||||||
CEditNumber m_PCEdit;
|
CEditNumber m_PCEdit;
|
||||||
bool m_bIgnorePCChange;
|
bool m_bIgnorePCChange;
|
||||||
|
|
||||||
CEditNumber m_AddressEdit;
|
CEditNumber m_AddressEdit;
|
||||||
bool m_bIgnoreAddrChange;
|
bool m_bIgnoreAddrChange;
|
||||||
|
|
||||||
CCommandList m_CommandList;
|
CCommandList m_CommandList;
|
||||||
int m_CommandListRows;
|
int m_CommandListRows;
|
||||||
CListBox m_BreakpointList;
|
CListBox m_BreakpointList;
|
||||||
CScrollBar m_Scrollbar;
|
CScrollBar m_Scrollbar;
|
||||||
|
|
||||||
CRegisterTabs m_RegisterTabs;
|
CRegisterTabs m_RegisterTabs;
|
||||||
|
|
||||||
CButton m_BackButton;
|
CButton m_BackButton;
|
||||||
CButton m_ForwardButton;
|
CButton m_ForwardButton;
|
||||||
|
|
||||||
CButton m_ViewPCButton;
|
CButton m_ViewPCButton;
|
||||||
CButton m_StepButton;
|
CButton m_StepButton;
|
||||||
CButton m_SkipButton;
|
CButton m_SkipButton;
|
||||||
CButton m_GoButton;
|
CButton m_GoButton;
|
||||||
|
|
||||||
bool m_bEditing;
|
bool m_bEditing;
|
||||||
CEditOp m_OpEdit;
|
CEditOp m_OpEdit;
|
||||||
|
|
||||||
uint32_t m_SelectedAddress;
|
uint32_t m_SelectedAddress;
|
||||||
COpInfo m_SelectedOpInfo;
|
COpInfo m_SelectedOpInfo;
|
||||||
OPCODE& m_SelectedOpCode = m_SelectedOpInfo.m_OpCode;
|
OPCODE& m_SelectedOpCode = m_SelectedOpInfo.m_OpCode;
|
||||||
|
|
||||||
uint32_t m_FollowAddress;
|
uint32_t m_FollowAddress;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t address;
|
uint32_t address;
|
||||||
uint32_t originalOp;
|
uint32_t originalOp;
|
||||||
} EditedOp;
|
} EditedOp;
|
||||||
|
|
||||||
vector<EditedOp> m_EditedOps;
|
vector<EditedOp> m_EditedOps;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int startPos;
|
int startPos;
|
||||||
int endPos;
|
int endPos;
|
||||||
int startMargin;
|
int startMargin;
|
||||||
int endMargin;
|
int endMargin;
|
||||||
int margin;
|
int margin;
|
||||||
} BRANCHARROW;
|
} BRANCHARROW;
|
||||||
|
|
||||||
vector<BRANCHARROW> m_BranchArrows;
|
vector<BRANCHARROW> m_BranchArrows;
|
||||||
void AddBranchArrow(int startPos, int endPos);
|
void AddBranchArrow(int startPos, int endPos);
|
||||||
void ClearBranchArrows();
|
void ClearBranchArrows();
|
||||||
void DrawBranchArrows(HDC listDC);
|
void DrawBranchArrows(HDC listDC);
|
||||||
|
|
||||||
vector<bool> m_bvAnnotatedLines;
|
vector<bool> m_bvAnnotatedLines;
|
||||||
|
|
||||||
void ClearEditedOps();
|
void ClearEditedOps();
|
||||||
void EditOp(uint32_t address, uint32_t op);
|
void EditOp(uint32_t address, uint32_t op);
|
||||||
void RestoreOp(uint32_t address);
|
void RestoreOp(uint32_t address);
|
||||||
void RestoreAllOps();
|
void RestoreAllOps();
|
||||||
BOOL IsOpEdited(uint32_t address);
|
BOOL IsOpEdited(uint32_t address);
|
||||||
void BeginOpEdit(uint32_t address);
|
void BeginOpEdit(uint32_t address);
|
||||||
void EndOpEdit();
|
void EndOpEdit();
|
||||||
|
|
||||||
void GotoEnteredAddress();
|
void GotoEnteredAddress();
|
||||||
void CheckCPUType();
|
void CheckCPUType();
|
||||||
void RefreshBreakpointList();
|
void RefreshBreakpointList();
|
||||||
void RemoveSelectedBreakpoints();
|
void RemoveSelectedBreakpoints();
|
||||||
|
|
||||||
bool AddressSafe(uint32_t vaddr);
|
|
||||||
|
|
||||||
void HistoryPushState();
|
bool AddressSafe(uint32_t vaddr);
|
||||||
void ToggleHistoryButtons();
|
|
||||||
|
|
||||||
static CDebugCommandsView* _this;
|
void HistoryPushState();
|
||||||
static HHOOK hWinMessageHook;
|
void ToggleHistoryButtons();
|
||||||
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 CDebugCommandsView* _this;
|
||||||
static const char* GetDataAddressNotes(uint32_t vAddr);
|
static HHOOK hWinMessageHook;
|
||||||
|
static LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||||
void CPUSkip();
|
void InterceptKeyDown(WPARAM wParam, LPARAM lParam);
|
||||||
void CPUStepInto();
|
void InterceptMouseWheel(WPARAM wParam, LPARAM lParam);
|
||||||
void CPUResume();
|
|
||||||
|
|
||||||
LRESULT OnInitDialog (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
static const char* GetCodeAddressNotes(uint32_t vAddr);
|
||||||
LRESULT OnActivate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
static const char* GetDataAddressNotes(uint32_t vAddr);
|
||||||
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);
|
void CPUSkip();
|
||||||
|
void CPUStepInto();
|
||||||
LRESULT OnCommandListClicked(NMHDR* pNMHDR);
|
void CPUResume();
|
||||||
LRESULT OnCommandListDblClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnCommandListRightClicked (NMHDR* pNMHDR);
|
|
||||||
LRESULT OnRegisterTabChange (NMHDR* pNMHDR);
|
|
||||||
LRESULT OnCustomDrawList (NMHDR* pNMHDR);
|
|
||||||
LRESULT OnDestroy (void);
|
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDebugCommandsView)
|
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
LRESULT OnSizing(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
MESSAGE_HANDLER(WM_SIZING, OnSizing)
|
LRESULT OnScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
MESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo)
|
LRESULT OnMeasureItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
MESSAGE_HANDLER(WM_VSCROLL, OnScroll)
|
LRESULT OnAddrChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
MESSAGE_HANDLER(WM_MEASUREITEM, OnMeasureItem)
|
LRESULT OnPCChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
COMMAND_HANDLER(IDC_ADDR_EDIT, EN_CHANGE, OnAddrChanged)
|
LRESULT OnListBoxClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
COMMAND_HANDLER(IDC_PC_EDIT, EN_CHANGE, OnPCChanged)
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
COMMAND_CODE_HANDLER(LBN_DBLCLK, OnListBoxClicked)
|
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_CLICK, OnCommandListClicked)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_DBLCLK, OnCommandListDblClicked)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_RCLICK, OnCommandListRightClicked)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_REG_TABS, TCN_SELCHANGE, OnRegisterTabChange)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_CUSTOMDRAW, OnCustomDrawList)
|
|
||||||
MSG_WM_DESTROY(OnDestroy)
|
|
||||||
CHAIN_MSG_MAP(CDialogResize<CDebugCommandsView>)
|
|
||||||
END_MSG_MAP()
|
|
||||||
|
|
||||||
BEGIN_DLGRESIZE_MAP(CDebugCommandsView)
|
LRESULT OnOpKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
DLGRESIZE_CONTROL(IDC_GO_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_STEP_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_SKIP_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_ADDR_EDIT, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_SYMBOLS_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_OPCODE_BOX, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_BP_LIST, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_ADDBP_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_RMBP_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_CLEARBP_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_REG_TABS, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_BACK_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_FORWARD_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_PC_STATIC, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_PC_EDIT, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_VIEWPC_BTN, DLSZ_MOVE_X)
|
|
||||||
DLGRESIZE_CONTROL(IDC_CMD_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
|
||||||
DLGRESIZE_CONTROL(IDC_SCRL_BAR, DLSZ_MOVE_X | DLSZ_SIZE_Y)
|
|
||||||
END_DLGRESIZE_MAP()
|
|
||||||
|
|
||||||
BEGIN_TOOLTIP_MAP()
|
LRESULT OnCommandListClicked(NMHDR* pNMHDR);
|
||||||
TOOLTIP(IDC_SKIP_BTN, "Skip (F1)")
|
LRESULT OnCommandListDblClicked(NMHDR* pNMHDR);
|
||||||
TOOLTIP(IDC_STEP_BTN, "Step (F2)")
|
LRESULT OnCommandListRightClicked(NMHDR* pNMHDR);
|
||||||
TOOLTIP(IDC_GO_BTN, "Go (F4)")
|
LRESULT OnRegisterTabChange(NMHDR* pNMHDR);
|
||||||
TOOLTIP(IDC_ADDBP_BTN, "Add breakpoint...")
|
LRESULT OnCustomDrawList(NMHDR* pNMHDR);
|
||||||
TOOLTIP(IDC_RMBP_BTN, "Remove selected breakpoint")
|
LRESULT OnDestroy(void);
|
||||||
TOOLTIP(IDC_CLEARBP_BTN, "Remove all breakpoints")
|
|
||||||
TOOLTIP(IDC_VIEWPC_BTN, "Jump to program counter")
|
BEGIN_MSG_MAP_EX(CDebugCommandsView)
|
||||||
TOOLTIP(IDC_BP_LIST, "Active breakpoints")
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
TOOLTIP(IDC_SYMBOLS_BTN, "Symbols...")
|
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
||||||
END_TOOLTIP_MAP()
|
MESSAGE_HANDLER(WM_SIZING, OnSizing)
|
||||||
|
MESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo)
|
||||||
|
MESSAGE_HANDLER(WM_VSCROLL, OnScroll)
|
||||||
|
MESSAGE_HANDLER(WM_MEASUREITEM, OnMeasureItem)
|
||||||
|
COMMAND_HANDLER(IDC_ADDR_EDIT, EN_CHANGE, OnAddrChanged)
|
||||||
|
COMMAND_HANDLER(IDC_PC_EDIT, EN_CHANGE, OnPCChanged)
|
||||||
|
COMMAND_CODE_HANDLER(LBN_DBLCLK, OnListBoxClicked)
|
||||||
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
|
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_CLICK, OnCommandListClicked)
|
||||||
|
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_DBLCLK, OnCommandListDblClicked)
|
||||||
|
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_RCLICK, OnCommandListRightClicked)
|
||||||
|
NOTIFY_HANDLER_EX(IDC_REG_TABS, TCN_SELCHANGE, OnRegisterTabChange)
|
||||||
|
NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_CUSTOMDRAW, OnCustomDrawList)
|
||||||
|
MSG_WM_DESTROY(OnDestroy)
|
||||||
|
CHAIN_MSG_MAP(CDialogResize<CDebugCommandsView>)
|
||||||
|
END_MSG_MAP()
|
||||||
|
|
||||||
|
BEGIN_DLGRESIZE_MAP(CDebugCommandsView)
|
||||||
|
DLGRESIZE_CONTROL(IDC_GO_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_STEP_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_SKIP_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_ADDR_EDIT, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_SYMBOLS_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_OPCODE_BOX, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_BP_LIST, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_ADDBP_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_RMBP_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_CLEARBP_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_REG_TABS, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_BACK_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_FORWARD_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_PC_STATIC, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_PC_EDIT, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_VIEWPC_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_CMD_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_SCRL_BAR, DLSZ_MOVE_X | DLSZ_SIZE_Y)
|
||||||
|
END_DLGRESIZE_MAP()
|
||||||
|
|
||||||
|
BEGIN_TOOLTIP_MAP()
|
||||||
|
TOOLTIP(IDC_SKIP_BTN, "Skip (F1)")
|
||||||
|
TOOLTIP(IDC_STEP_BTN, "Step (F2)")
|
||||||
|
TOOLTIP(IDC_GO_BTN, "Go (F4)")
|
||||||
|
TOOLTIP(IDC_ADDBP_BTN, "Add breakpoint...")
|
||||||
|
TOOLTIP(IDC_RMBP_BTN, "Remove selected breakpoint")
|
||||||
|
TOOLTIP(IDC_CLEARBP_BTN, "Remove all breakpoints")
|
||||||
|
TOOLTIP(IDC_VIEWPC_BTN, "Jump to program counter")
|
||||||
|
TOOLTIP(IDC_BP_LIST, "Active breakpoints")
|
||||||
|
TOOLTIP(IDC_SYMBOLS_BTN, "Symbols...")
|
||||||
|
END_TOOLTIP_MAP()
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,66 +14,66 @@
|
||||||
#include "DebuggerUI.h"
|
#include "DebuggerUI.h"
|
||||||
|
|
||||||
class CDebugDMALogView :
|
class CDebugDMALogView :
|
||||||
public CDebugDialog<CDebugDMALogView>,
|
public CDebugDialog<CDebugDMALogView>,
|
||||||
public CDialogResize<CDebugDMALogView>
|
public CDialogResize<CDebugDMALogView>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_DMALog };
|
enum { IDD = IDD_Debugger_DMALog };
|
||||||
|
|
||||||
CDebugDMALogView(CDebuggerUI * debugger);
|
CDebugDMALogView(CDebuggerUI * debugger);
|
||||||
virtual ~CDebugDMALogView(void);
|
virtual ~CDebugDMALogView(void);
|
||||||
|
|
||||||
void RefreshList();
|
void RefreshList();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CDMALog* m_DMALog;
|
CDMALog* m_DMALog;
|
||||||
|
|
||||||
int m_nLastStartIndex;
|
int m_nLastStartIndex;
|
||||||
bool m_bConvertingAddress;
|
bool m_bConvertingAddress;
|
||||||
|
|
||||||
bool m_bUniqueRomAddresses;
|
bool m_bUniqueRomAddresses;
|
||||||
bool m_bFilterChanged;
|
bool m_bFilterChanged;
|
||||||
|
|
||||||
HANDLE m_AutoRefreshThread;
|
|
||||||
static DWORD WINAPI AutoRefreshProc(void* _this);
|
|
||||||
|
|
||||||
// Return true if entry meets requirements
|
HANDLE m_AutoRefreshThread;
|
||||||
bool FilterEntry(int dmaLogIndex);
|
static DWORD WINAPI AutoRefreshProc(void* _this);
|
||||||
|
|
||||||
CListViewCtrl m_DMAList;
|
|
||||||
CEdit m_DMARamEdit;
|
|
||||||
CEdit m_DMARomEdit;
|
|
||||||
CStatic m_BlockInfo;
|
|
||||||
|
|
||||||
bool m_bCustomDrawClrNext;
|
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
// Return true if entry meets requirements
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
bool FilterEntry(int dmaLogIndex);
|
||||||
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
||||||
LRESULT OnRamAddrChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
|
||||||
LRESULT OnRomAddrChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
|
||||||
LRESULT OnCustomDrawList(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnDestroy(void);
|
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDebugDMALogView)
|
CListViewCtrl m_DMAList;
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
CEdit m_DMARamEdit;
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
CEdit m_DMARomEdit;
|
||||||
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
CStatic m_BlockInfo;
|
||||||
COMMAND_HANDLER(IDC_DMA_RAM_EDIT, EN_CHANGE, OnRamAddrChanged)
|
|
||||||
COMMAND_HANDLER(IDC_DMA_ROM_EDIT, EN_CHANGE, OnRomAddrChanged)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_DMA_LIST, NM_CUSTOMDRAW, OnCustomDrawList)
|
|
||||||
CHAIN_MSG_MAP(CDialogResize<CDebugDMALogView>)
|
|
||||||
END_MSG_MAP()
|
|
||||||
|
|
||||||
BEGIN_DLGRESIZE_MAP(CDebugDMALogView)
|
bool m_bCustomDrawClrNext;
|
||||||
DLGRESIZE_CONTROL(IDC_DMA_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
|
||||||
DLGRESIZE_CONTROL(IDC_TRACE_STATIC, DLSZ_MOVE_Y)
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||||
DLGRESIZE_CONTROL(IDC_BLOCK_INFO, DLSZ_MOVE_Y)
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
||||||
DLGRESIZE_CONTROL(IDC_RAM_STATIC, DLSZ_MOVE_Y)
|
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
DLGRESIZE_CONTROL(IDC_ROM_STATIC, DLSZ_MOVE_Y)
|
LRESULT OnRamAddrChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
DLGRESIZE_CONTROL(IDC_DMA_ROM_EDIT, DLSZ_MOVE_Y)
|
LRESULT OnRomAddrChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
DLGRESIZE_CONTROL(IDC_DMA_RAM_EDIT, DLSZ_MOVE_Y)
|
LRESULT OnCustomDrawList(NMHDR* pNMHDR);
|
||||||
DLGRESIZE_CONTROL(IDC_CLEAR_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
LRESULT OnDestroy(void);
|
||||||
DLGRESIZE_CONTROL(IDC_BUTTON1, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
|
||||||
END_DLGRESIZE_MAP()
|
BEGIN_MSG_MAP_EX(CDebugDMALogView)
|
||||||
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
|
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
||||||
|
COMMAND_HANDLER(IDC_DMA_RAM_EDIT, EN_CHANGE, OnRamAddrChanged)
|
||||||
|
COMMAND_HANDLER(IDC_DMA_ROM_EDIT, EN_CHANGE, OnRomAddrChanged)
|
||||||
|
NOTIFY_HANDLER_EX(IDC_DMA_LIST, NM_CUSTOMDRAW, OnCustomDrawList)
|
||||||
|
CHAIN_MSG_MAP(CDialogResize<CDebugDMALogView>)
|
||||||
|
END_MSG_MAP()
|
||||||
|
|
||||||
|
BEGIN_DLGRESIZE_MAP(CDebugDMALogView)
|
||||||
|
DLGRESIZE_CONTROL(IDC_DMA_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_TRACE_STATIC, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_BLOCK_INFO, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_RAM_STATIC, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_ROM_STATIC, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_DMA_ROM_EDIT, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_DMA_RAM_EDIT, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_CLEAR_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_BUTTON1, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
||||||
|
END_DLGRESIZE_MAP()
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,20 +27,20 @@ private:
|
||||||
enum DumpFormat
|
enum DumpFormat
|
||||||
{
|
{
|
||||||
DisassemblyWithPC,
|
DisassemblyWithPC,
|
||||||
RawBigEndian
|
RawBigEndian
|
||||||
};
|
};
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDumpMemory)
|
BEGIN_MSG_MAP_EX(CDumpMemory)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
||||||
|
|
||||||
bool DumpMemory(LPCSTR FileName, DumpFormat Format, DWORD StartPC, DWORD EndPC, DWORD DumpPC);
|
bool DumpMemory(LPCSTR FileName, DumpFormat Format, DWORD StartPC, DWORD EndPC, DWORD DumpPC);
|
||||||
|
|
||||||
CComboBox m_FormatList;
|
CComboBox m_FormatList;
|
||||||
CEdit m_FileName;
|
CEdit m_FileName;
|
||||||
CEditNumber m_StartAddress, m_EndAddress, m_PC;
|
CEditNumber m_StartAddress, m_EndAddress, m_PC;
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,36 +53,36 @@ private:
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
NOTIFY_HANDLER_EX(IDC_LST_RESULTS, NM_RCLICK, OnResultRClick)
|
NOTIFY_HANDLER_EX(IDC_LST_RESULTS, NM_RCLICK, OnResultRClick)
|
||||||
NOTIFY_HANDLER_EX(IDC_LST_RESULTS, NM_DBLCLK, OnResultDblClick)
|
NOTIFY_HANDLER_EX(IDC_LST_RESULTS, NM_DBLCLK, OnResultDblClick)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
||||||
LRESULT OnResultRClick(LPNMHDR lpnmh);
|
LRESULT OnResultRClick(LPNMHDR lpnmh);
|
||||||
LRESULT OnResultDblClick(LPNMHDR lpnmh);
|
LRESULT OnResultDblClick(LPNMHDR lpnmh);
|
||||||
|
|
||||||
void EnableUnknownOptions(bool Enable);
|
void EnableUnknownOptions(bool Enable);
|
||||||
void EnableValueOptions(bool Enable);
|
void EnableValueOptions(bool Enable);
|
||||||
void EnableTextOptions(bool Enable);
|
void EnableTextOptions(bool Enable);
|
||||||
void EnableJalOptions(bool Enable);
|
void EnableJalOptions(bool Enable);
|
||||||
void AddAlignmentOptions(CComboBox & ctrl);
|
void AddAlignmentOptions(CComboBox & ctrl);
|
||||||
|
|
||||||
CEditNumber m_PAddrStart, m_SearchLen, m_SearchValue, m_MaxSearch;
|
CEditNumber m_PAddrStart, m_SearchLen, m_SearchValue, m_MaxSearch;
|
||||||
CComboBox m_UnknownOptions, m_ValueSize, m_UnknownSize;
|
CComboBox m_UnknownOptions, m_ValueSize, m_UnknownSize;
|
||||||
CListViewCtrl m_SearchResults;
|
CListViewCtrl m_SearchResults;
|
||||||
SearchResult m_SearchResult;
|
SearchResult m_SearchResult;
|
||||||
bool m_HaveResults;
|
bool m_HaveResults;
|
||||||
|
|
||||||
//Searching memory
|
//Searching memory
|
||||||
BYTE * m_MemoryState;
|
BYTE * m_MemoryState;
|
||||||
DWORD m_MemoryStateSize;
|
DWORD m_MemoryStateSize;
|
||||||
|
|
||||||
void FixUnknownOptions(bool Reset);
|
void FixUnknownOptions(bool Reset);
|
||||||
void SearchForUnknown(void);
|
void SearchForUnknown(void);
|
||||||
void SearchForValue(void);
|
void SearchForValue(void);
|
||||||
void SearchForText(void);
|
void SearchForText(void);
|
||||||
void Reset(void);
|
void Reset(void);
|
||||||
bool SearchSetBaseForChanges(void);
|
bool SearchSetBaseForChanges(void);
|
||||||
bool SearchForChanges(SearchMemChangeState SearchType, MemorySize Size, DWORD &StartAddress, DWORD &Len, DWORD &OldValue, DWORD &NewValue);
|
bool SearchForChanges(SearchMemChangeState SearchType, MemorySize Size, DWORD &StartAddress, DWORD &Len, DWORD &OldValue, DWORD &NewValue);
|
||||||
bool SearchForValue(DWORD Value, MemorySize Size, DWORD &StartAddress, DWORD &Len);
|
bool SearchForValue(DWORD Value, MemorySize Size, DWORD &StartAddress, DWORD &Len);
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,268 +15,267 @@
|
||||||
#include "Breakpoints.h"
|
#include "Breakpoints.h"
|
||||||
|
|
||||||
#ifndef COUNT_OF
|
#ifndef COUNT_OF
|
||||||
#define COUNT_OF(a) (sizeof(a) / sizeof(a[0]))
|
#define COUNT_OF(a) (sizeof(a) / sizeof(a[0]))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class CEditReg64 : public CWindowImpl<CEditReg64, CEdit>
|
class CEditReg64 : public CWindowImpl<CEditReg64, CEdit>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static uint64_t ParseValue(char* wordPair);
|
static uint64_t ParseValue(char* wordPair);
|
||||||
BOOL Attach(HWND hWndNew);
|
BOOL Attach(HWND hWndNew);
|
||||||
LRESULT OnChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
LRESULT OnChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
LRESULT OnLostFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
LRESULT OnLostFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
uint64_t GetValue();
|
uint64_t GetValue();
|
||||||
void SetValue(uint32_t h, uint32_t l);
|
void SetValue(uint32_t h, uint32_t l);
|
||||||
void SetValue(uint64_t value);
|
void SetValue(uint64_t value);
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CRegEdit64)
|
BEGIN_MSG_MAP_EX(CRegEdit64)
|
||||||
MESSAGE_HANDLER(WM_CHAR, OnChar)
|
MESSAGE_HANDLER(WM_CHAR, OnChar)
|
||||||
MESSAGE_HANDLER(WM_KILLFOCUS, OnLostFocus)
|
MESSAGE_HANDLER(WM_KILLFOCUS, OnLostFocus)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
class CRegisterTabs : public CTabCtrl
|
class CRegisterTabs : public CTabCtrl
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
uint32_t intval;
|
uint32_t intval;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
unsigned : 2;
|
unsigned : 2;
|
||||||
unsigned exceptionCode : 5;
|
unsigned exceptionCode : 5;
|
||||||
unsigned : 1;
|
unsigned : 1;
|
||||||
unsigned pendingInterrupts : 8;
|
unsigned pendingInterrupts : 8;
|
||||||
unsigned : 12;
|
unsigned : 12;
|
||||||
unsigned coprocessor : 2;
|
unsigned coprocessor : 2;
|
||||||
unsigned : 1;
|
unsigned : 1;
|
||||||
unsigned fromDelaySlot : 1;
|
unsigned fromDelaySlot : 1;
|
||||||
};
|
};
|
||||||
|
} CAUSE;
|
||||||
|
|
||||||
} CAUSE;
|
enum TAB_ID {
|
||||||
|
TabDefault,
|
||||||
|
TabGPR,
|
||||||
|
TabFPR
|
||||||
|
};
|
||||||
|
|
||||||
enum TAB_ID {
|
static constexpr DWORD GPREditIds[] = {
|
||||||
TabDefault,
|
IDC_R0_EDIT, IDC_R1_EDIT, IDC_R2_EDIT, IDC_R3_EDIT,
|
||||||
TabGPR,
|
IDC_R4_EDIT, IDC_R5_EDIT, IDC_R6_EDIT, IDC_R7_EDIT,
|
||||||
TabFPR
|
IDC_R8_EDIT, IDC_R9_EDIT, IDC_R10_EDIT, IDC_R11_EDIT,
|
||||||
};
|
IDC_R12_EDIT, IDC_R13_EDIT, IDC_R14_EDIT, IDC_R15_EDIT,
|
||||||
|
IDC_R16_EDIT, IDC_R17_EDIT, IDC_R18_EDIT, IDC_R19_EDIT,
|
||||||
static constexpr DWORD GPREditIds[] = {
|
IDC_R20_EDIT, IDC_R21_EDIT, IDC_R22_EDIT, IDC_R23_EDIT,
|
||||||
IDC_R0_EDIT, IDC_R1_EDIT, IDC_R2_EDIT, IDC_R3_EDIT,
|
IDC_R24_EDIT, IDC_R25_EDIT, IDC_R26_EDIT, IDC_R27_EDIT,
|
||||||
IDC_R4_EDIT, IDC_R5_EDIT, IDC_R6_EDIT, IDC_R7_EDIT,
|
IDC_R28_EDIT, IDC_R29_EDIT, IDC_R30_EDIT, IDC_R31_EDIT,
|
||||||
IDC_R8_EDIT, IDC_R9_EDIT, IDC_R10_EDIT, IDC_R11_EDIT,
|
0
|
||||||
IDC_R12_EDIT, IDC_R13_EDIT, IDC_R14_EDIT, IDC_R15_EDIT,
|
};
|
||||||
IDC_R16_EDIT, IDC_R17_EDIT, IDC_R18_EDIT, IDC_R19_EDIT,
|
|
||||||
IDC_R20_EDIT, IDC_R21_EDIT, IDC_R22_EDIT, IDC_R23_EDIT,
|
|
||||||
IDC_R24_EDIT, IDC_R25_EDIT, IDC_R26_EDIT, IDC_R27_EDIT,
|
|
||||||
IDC_R28_EDIT, IDC_R29_EDIT, IDC_R30_EDIT, IDC_R31_EDIT,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
static constexpr DWORD FPREditIds[] = {
|
static constexpr DWORD FPREditIds[] = {
|
||||||
IDC_F0_EDIT, IDC_F1_EDIT, IDC_F2_EDIT, IDC_F3_EDIT,
|
IDC_F0_EDIT, IDC_F1_EDIT, IDC_F2_EDIT, IDC_F3_EDIT,
|
||||||
IDC_F4_EDIT, IDC_F5_EDIT, IDC_F6_EDIT, IDC_F7_EDIT,
|
IDC_F4_EDIT, IDC_F5_EDIT, IDC_F6_EDIT, IDC_F7_EDIT,
|
||||||
IDC_F8_EDIT, IDC_F9_EDIT, IDC_F10_EDIT, IDC_F11_EDIT,
|
IDC_F8_EDIT, IDC_F9_EDIT, IDC_F10_EDIT, IDC_F11_EDIT,
|
||||||
IDC_F12_EDIT, IDC_F13_EDIT, IDC_F14_EDIT, IDC_F15_EDIT,
|
IDC_F12_EDIT, IDC_F13_EDIT, IDC_F14_EDIT, IDC_F15_EDIT,
|
||||||
IDC_F16_EDIT, IDC_F17_EDIT, IDC_F18_EDIT, IDC_F19_EDIT,
|
IDC_F16_EDIT, IDC_F17_EDIT, IDC_F18_EDIT, IDC_F19_EDIT,
|
||||||
IDC_F20_EDIT, IDC_F21_EDIT, IDC_F22_EDIT, IDC_F23_EDIT,
|
IDC_F20_EDIT, IDC_F21_EDIT, IDC_F22_EDIT, IDC_F23_EDIT,
|
||||||
IDC_F24_EDIT, IDC_F25_EDIT, IDC_F26_EDIT, IDC_F27_EDIT,
|
IDC_F24_EDIT, IDC_F25_EDIT, IDC_F26_EDIT, IDC_F27_EDIT,
|
||||||
IDC_F28_EDIT, IDC_F29_EDIT, IDC_F30_EDIT, IDC_F31_EDIT,
|
IDC_F28_EDIT, IDC_F29_EDIT, IDC_F30_EDIT, IDC_F31_EDIT,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr DWORD COP0EditIds[] = {
|
|
||||||
IDC_COP0_0_EDIT, IDC_COP0_1_EDIT, IDC_COP0_2_EDIT, IDC_COP0_3_EDIT,
|
|
||||||
IDC_COP0_4_EDIT, IDC_COP0_5_EDIT, IDC_COP0_6_EDIT, IDC_COP0_7_EDIT,
|
|
||||||
IDC_COP0_8_EDIT, IDC_COP0_9_EDIT, IDC_COP0_10_EDIT, IDC_COP0_11_EDIT,
|
|
||||||
IDC_COP0_12_EDIT, IDC_COP0_13_EDIT, IDC_COP0_14_EDIT, IDC_COP0_15_EDIT,
|
|
||||||
IDC_COP0_16_EDIT, IDC_COP0_17_EDIT, IDC_COP0_18_EDIT,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
static constexpr DWORD RDRAMEditIds[] = {
|
static constexpr DWORD COP0EditIds[] = {
|
||||||
IDC_RDRAM00_EDIT, IDC_RDRAM04_EDIT, IDC_RDRAM08_EDIT, IDC_RDRAM0C_EDIT,
|
IDC_COP0_0_EDIT, IDC_COP0_1_EDIT, IDC_COP0_2_EDIT, IDC_COP0_3_EDIT,
|
||||||
IDC_RDRAM10_EDIT, IDC_RDRAM14_EDIT, IDC_RDRAM18_EDIT, IDC_RDRAM1C_EDIT,
|
IDC_COP0_4_EDIT, IDC_COP0_5_EDIT, IDC_COP0_6_EDIT, IDC_COP0_7_EDIT,
|
||||||
IDC_RDRAM20_EDIT, IDC_RDRAM24_EDIT,
|
IDC_COP0_8_EDIT, IDC_COP0_9_EDIT, IDC_COP0_10_EDIT, IDC_COP0_11_EDIT,
|
||||||
0
|
IDC_COP0_12_EDIT, IDC_COP0_13_EDIT, IDC_COP0_14_EDIT, IDC_COP0_15_EDIT,
|
||||||
};
|
IDC_COP0_16_EDIT, IDC_COP0_17_EDIT, IDC_COP0_18_EDIT,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
static constexpr DWORD SPEditIds[] = {
|
static constexpr DWORD RDRAMEditIds[] = {
|
||||||
IDC_SP00_EDIT, IDC_SP04_EDIT, IDC_SP08_EDIT, IDC_SP0C_EDIT,
|
IDC_RDRAM00_EDIT, IDC_RDRAM04_EDIT, IDC_RDRAM08_EDIT, IDC_RDRAM0C_EDIT,
|
||||||
IDC_SP10_EDIT, IDC_SP14_EDIT, IDC_SP18_EDIT, IDC_SP1C_EDIT,
|
IDC_RDRAM10_EDIT, IDC_RDRAM14_EDIT, IDC_RDRAM18_EDIT, IDC_RDRAM1C_EDIT,
|
||||||
0
|
IDC_RDRAM20_EDIT, IDC_RDRAM24_EDIT,
|
||||||
};
|
0
|
||||||
|
};
|
||||||
|
|
||||||
static constexpr DWORD DPCEditIds[] = {
|
static constexpr DWORD SPEditIds[] = {
|
||||||
IDC_DPC00_EDIT, IDC_DPC04_EDIT, IDC_DPC08_EDIT, IDC_DPC0C_EDIT,
|
IDC_SP00_EDIT, IDC_SP04_EDIT, IDC_SP08_EDIT, IDC_SP0C_EDIT,
|
||||||
IDC_DPC10_EDIT, IDC_DPC14_EDIT, IDC_DPC18_EDIT, IDC_DPC1C_EDIT,
|
IDC_SP10_EDIT, IDC_SP14_EDIT, IDC_SP18_EDIT, IDC_SP1C_EDIT,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr DWORD MIEditIds[] = {
|
static constexpr DWORD DPCEditIds[] = {
|
||||||
IDC_MI00_EDIT, IDC_MI04_EDIT, IDC_MI08_EDIT, IDC_MI0C_EDIT,
|
IDC_DPC00_EDIT, IDC_DPC04_EDIT, IDC_DPC08_EDIT, IDC_DPC0C_EDIT,
|
||||||
0
|
IDC_DPC10_EDIT, IDC_DPC14_EDIT, IDC_DPC18_EDIT, IDC_DPC1C_EDIT,
|
||||||
};
|
0
|
||||||
|
};
|
||||||
|
|
||||||
static constexpr DWORD VIEditIds[] = {
|
static constexpr DWORD MIEditIds[] = {
|
||||||
IDC_VI00_EDIT, IDC_VI04_EDIT, IDC_VI08_EDIT, IDC_VI0C_EDIT,
|
IDC_MI00_EDIT, IDC_MI04_EDIT, IDC_MI08_EDIT, IDC_MI0C_EDIT,
|
||||||
IDC_VI10_EDIT, IDC_VI14_EDIT, IDC_VI18_EDIT, IDC_VI1C_EDIT,
|
0
|
||||||
IDC_VI20_EDIT, IDC_VI24_EDIT, IDC_VI28_EDIT, IDC_VI2C_EDIT,
|
};
|
||||||
IDC_VI30_EDIT, IDC_VI34_EDIT,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
static constexpr DWORD AIEditIds[] = {
|
static constexpr DWORD VIEditIds[] = {
|
||||||
IDC_AI00_EDIT, IDC_AI04_EDIT, IDC_AI08_EDIT, IDC_AI0C_EDIT,
|
IDC_VI00_EDIT, IDC_VI04_EDIT, IDC_VI08_EDIT, IDC_VI0C_EDIT,
|
||||||
IDC_AI10_EDIT, IDC_AI14_EDIT,
|
IDC_VI10_EDIT, IDC_VI14_EDIT, IDC_VI18_EDIT, IDC_VI1C_EDIT,
|
||||||
0
|
IDC_VI20_EDIT, IDC_VI24_EDIT, IDC_VI28_EDIT, IDC_VI2C_EDIT,
|
||||||
};
|
IDC_VI30_EDIT, IDC_VI34_EDIT,
|
||||||
|
0
|
||||||
static constexpr DWORD PIEditIds[] = {
|
};
|
||||||
IDC_PI00_EDIT, IDC_PI04_EDIT, IDC_PI08_EDIT, IDC_PI0C_EDIT,
|
|
||||||
IDC_PI10_EDIT, IDC_PI14_EDIT, IDC_PI18_EDIT, IDC_PI1C_EDIT,
|
|
||||||
IDC_PI20_EDIT, IDC_PI24_EDIT, IDC_PI28_EDIT, IDC_PI2C_EDIT,
|
|
||||||
IDC_PI30_EDIT,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
static constexpr DWORD RIEditIds[] = {
|
static constexpr DWORD AIEditIds[] = {
|
||||||
IDC_RI00_EDIT, IDC_RI04_EDIT, IDC_RI08_EDIT, IDC_RI0C_EDIT,
|
IDC_AI00_EDIT, IDC_AI04_EDIT, IDC_AI08_EDIT, IDC_AI0C_EDIT,
|
||||||
IDC_RI10_EDIT, IDC_RI14_EDIT, IDC_RI18_EDIT, IDC_RI1C_EDIT,
|
IDC_AI10_EDIT, IDC_AI14_EDIT,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr DWORD SIEditIds[] = {
|
|
||||||
IDC_SI00_EDIT, IDC_SI04_EDIT, IDC_SI08_EDIT, IDC_SI0C_EDIT,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
static constexpr DWORD DDEditIds[] = {
|
static constexpr DWORD PIEditIds[] = {
|
||||||
IDC_DD00_EDIT, IDC_DD04_EDIT, IDC_DD08_EDIT, IDC_DD0C_EDIT,
|
IDC_PI00_EDIT, IDC_PI04_EDIT, IDC_PI08_EDIT, IDC_PI0C_EDIT,
|
||||||
IDC_DD10_EDIT, IDC_DD14_EDIT, IDC_DD18_EDIT, IDC_DD1C_EDIT,
|
IDC_PI10_EDIT, IDC_PI14_EDIT, IDC_PI18_EDIT, IDC_PI1C_EDIT,
|
||||||
IDC_DD20_EDIT, IDC_DD24_EDIT, IDC_DD28_EDIT, IDC_DD2C_EDIT,
|
IDC_PI20_EDIT, IDC_PI24_EDIT, IDC_PI28_EDIT, IDC_PI2C_EDIT,
|
||||||
IDC_DD30_EDIT, IDC_DD34_EDIT, IDC_DD38_EDIT, IDC_DD3C_EDIT,
|
IDC_PI30_EDIT,
|
||||||
IDC_DD40_EDIT, IDC_DD44_EDIT, IDC_DD48_EDIT,
|
0
|
||||||
0
|
};
|
||||||
};
|
|
||||||
|
|
||||||
static int MapEditRegNum(DWORD controlId, const DWORD* edits)
|
static constexpr DWORD RIEditIds[] = {
|
||||||
{
|
IDC_RI00_EDIT, IDC_RI04_EDIT, IDC_RI08_EDIT, IDC_RI0C_EDIT,
|
||||||
for (int i = 0; edits[i] != 0; i++)
|
IDC_RI10_EDIT, IDC_RI14_EDIT, IDC_RI18_EDIT, IDC_RI1C_EDIT,
|
||||||
{
|
0
|
||||||
if (edits[i] == controlId)
|
};
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static constexpr char* ExceptionCodes[] = {
|
|
||||||
"Interrupt",
|
|
||||||
"TLB mod",
|
|
||||||
"TLB load/fetch",
|
|
||||||
"TLB store",
|
|
||||||
"Address error (load/fetch)",
|
|
||||||
"Address error (store)",
|
|
||||||
"Bus error (instruction fetch)",
|
|
||||||
"Bus error (data load/store)",
|
|
||||||
"Syscall",
|
|
||||||
"Breakpoint",
|
|
||||||
"Reserved instruction",
|
|
||||||
"Coprocessor unusable",
|
|
||||||
"Arithmetic overflow",
|
|
||||||
"Trap",
|
|
||||||
"Virtual coherency (instruction)",
|
|
||||||
"Floating-point",
|
|
||||||
"? 16",
|
|
||||||
"? 17",
|
|
||||||
"? 18",
|
|
||||||
"? 19",
|
|
||||||
"? 20",
|
|
||||||
"? 21",
|
|
||||||
"? 22",
|
|
||||||
"Watch",
|
|
||||||
"? 24",
|
|
||||||
"? 25",
|
|
||||||
"? 26",
|
|
||||||
"? 27",
|
|
||||||
"? 28",
|
|
||||||
"? 29",
|
|
||||||
"? 30",
|
|
||||||
"Virtual coherency (data)"
|
|
||||||
};
|
|
||||||
|
|
||||||
// for static dlgprocs, assumes single instance
|
|
||||||
static bool m_bColorsEnabled;
|
|
||||||
|
|
||||||
vector<CWindow> m_TabWindows;
|
static constexpr DWORD SIEditIds[] = {
|
||||||
|
IDC_SI00_EDIT, IDC_SI04_EDIT, IDC_SI08_EDIT, IDC_SI0C_EDIT,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
CWindow m_GPRTab;
|
static constexpr DWORD DDEditIds[] = {
|
||||||
CEditReg64 m_GPREdits[COUNT_OF(GPREditIds) - 1];
|
IDC_DD00_EDIT, IDC_DD04_EDIT, IDC_DD08_EDIT, IDC_DD0C_EDIT,
|
||||||
CEditReg64 m_HIEdit;
|
IDC_DD10_EDIT, IDC_DD14_EDIT, IDC_DD18_EDIT, IDC_DD1C_EDIT,
|
||||||
CEditReg64 m_LOEdit;
|
IDC_DD20_EDIT, IDC_DD24_EDIT, IDC_DD28_EDIT, IDC_DD2C_EDIT,
|
||||||
|
IDC_DD30_EDIT, IDC_DD34_EDIT, IDC_DD38_EDIT, IDC_DD3C_EDIT,
|
||||||
CWindow m_FPRTab;
|
IDC_DD40_EDIT, IDC_DD44_EDIT, IDC_DD48_EDIT,
|
||||||
CEditNumber m_FPREdits[COUNT_OF(FPREditIds) - 1];
|
0
|
||||||
CEditNumber m_FCSREdit;
|
};
|
||||||
|
|
||||||
CWindow m_COP0Tab;
|
|
||||||
CEditNumber m_COP0Edits[COUNT_OF(COP0EditIds) - 1];
|
|
||||||
CStatic m_CauseTip;
|
|
||||||
|
|
||||||
CWindow m_RDRAMTab;
|
static int MapEditRegNum(DWORD controlId, const DWORD* edits)
|
||||||
CEditNumber m_RDRAMEdits[COUNT_OF(RDRAMEditIds) - 1];
|
{
|
||||||
|
for (int i = 0; edits[i] != 0; i++)
|
||||||
|
{
|
||||||
|
if (edits[i] == controlId)
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
CWindow m_SPTab;
|
static constexpr char* ExceptionCodes[] = {
|
||||||
CEditNumber m_SPEdits[COUNT_OF(SPEditIds) - 1];
|
"Interrupt",
|
||||||
CEditNumber m_SPPCEdit;
|
"TLB mod",
|
||||||
|
"TLB load/fetch",
|
||||||
|
"TLB store",
|
||||||
|
"Address error (load/fetch)",
|
||||||
|
"Address error (store)",
|
||||||
|
"Bus error (instruction fetch)",
|
||||||
|
"Bus error (data load/store)",
|
||||||
|
"Syscall",
|
||||||
|
"Breakpoint",
|
||||||
|
"Reserved instruction",
|
||||||
|
"Coprocessor unusable",
|
||||||
|
"Arithmetic overflow",
|
||||||
|
"Trap",
|
||||||
|
"Virtual coherency (instruction)",
|
||||||
|
"Floating-point",
|
||||||
|
"? 16",
|
||||||
|
"? 17",
|
||||||
|
"? 18",
|
||||||
|
"? 19",
|
||||||
|
"? 20",
|
||||||
|
"? 21",
|
||||||
|
"? 22",
|
||||||
|
"Watch",
|
||||||
|
"? 24",
|
||||||
|
"? 25",
|
||||||
|
"? 26",
|
||||||
|
"? 27",
|
||||||
|
"? 28",
|
||||||
|
"? 29",
|
||||||
|
"? 30",
|
||||||
|
"Virtual coherency (data)"
|
||||||
|
};
|
||||||
|
|
||||||
CWindow m_DPCTab;
|
// for static dlgprocs, assumes single instance
|
||||||
CEditNumber m_DPCEdits[COUNT_OF(DPCEditIds) - 1];
|
static bool m_bColorsEnabled;
|
||||||
|
|
||||||
CWindow m_MITab;
|
vector<CWindow> m_TabWindows;
|
||||||
CEditNumber m_MIEdits[COUNT_OF(MIEditIds) - 1];
|
|
||||||
|
|
||||||
CWindow m_VITab;
|
|
||||||
CEditNumber m_VIEdits[COUNT_OF(VIEditIds) - 1];
|
|
||||||
|
|
||||||
CWindow m_AITab;
|
CWindow m_GPRTab;
|
||||||
CEditNumber m_AIEdits[COUNT_OF(AIEditIds) - 1];
|
CEditReg64 m_GPREdits[COUNT_OF(GPREditIds) - 1];
|
||||||
|
CEditReg64 m_HIEdit;
|
||||||
|
CEditReg64 m_LOEdit;
|
||||||
|
|
||||||
CWindow m_PITab;
|
CWindow m_FPRTab;
|
||||||
CEditNumber m_PIEdits[COUNT_OF(PIEditIds) - 1];
|
CEditNumber m_FPREdits[COUNT_OF(FPREditIds) - 1];
|
||||||
|
CEditNumber m_FCSREdit;
|
||||||
CWindow m_RITab;
|
|
||||||
CEditNumber m_RIEdits[COUNT_OF(RIEditIds) - 1];
|
|
||||||
|
|
||||||
CWindow m_SITab;
|
CWindow m_COP0Tab;
|
||||||
CEditNumber m_SIEdits[COUNT_OF(SIEditIds) - 1];
|
CEditNumber m_COP0Edits[COUNT_OF(COP0EditIds) - 1];
|
||||||
|
CStatic m_CauseTip;
|
||||||
|
|
||||||
CWindow m_DDTab;
|
CWindow m_RDRAMTab;
|
||||||
CEditNumber m_DDEdits[COUNT_OF(DDEditIds) - 1];
|
CEditNumber m_RDRAMEdits[COUNT_OF(RDRAMEditIds) - 1];
|
||||||
|
|
||||||
static void RegisterChanged(HWND hDlg, TAB_ID srcTabId, WPARAM wParam);
|
|
||||||
|
|
||||||
static INT_PTR CALLBACK TabProcDefault(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
CWindow m_SPTab;
|
||||||
static INT_PTR CALLBACK TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
CEditNumber m_SPEdits[COUNT_OF(SPEditIds) - 1];
|
||||||
static INT_PTR CALLBACK TabProcFPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
CEditNumber m_SPPCEdit;
|
||||||
|
|
||||||
static void InitRegisterEdit(CWindow& tab, CEditNumber& edit, WORD ctrlId, HFONT font);
|
CWindow m_DPCTab;
|
||||||
static void InitRegisterEdits(CWindow& tab, CEditNumber* edits, const DWORD* ctrlIds, HFONT font);
|
CEditNumber m_DPCEdits[COUNT_OF(DPCEditIds) - 1];
|
||||||
static void InitRegisterEdit64(CWindow& tab, CEditReg64& edit, WORD ctrlId, HFONT font);
|
|
||||||
static void InitRegisterEdits64(CWindow& tab, CEditReg64* edits, const DWORD* ctrlIds, HFONT font);
|
CWindow m_MITab;
|
||||||
static void ZeroRegisterEdit(CEditNumber& edit);
|
CEditNumber m_MIEdits[COUNT_OF(MIEditIds) - 1];
|
||||||
static void ZeroRegisterEdits(CEditNumber* edits, const DWORD* ctrlIds);
|
|
||||||
static void ZeroRegisterEdit64(CEditReg64& edit);
|
CWindow m_VITab;
|
||||||
static void ZeroRegisterEdits64(CEditReg64* edits, const DWORD* ctrlIds);
|
CEditNumber m_VIEdits[COUNT_OF(VIEditIds) - 1];
|
||||||
|
|
||||||
|
CWindow m_AITab;
|
||||||
|
CEditNumber m_AIEdits[COUNT_OF(AIEditIds) - 1];
|
||||||
|
|
||||||
|
CWindow m_PITab;
|
||||||
|
CEditNumber m_PIEdits[COUNT_OF(PIEditIds) - 1];
|
||||||
|
|
||||||
|
CWindow m_RITab;
|
||||||
|
CEditNumber m_RIEdits[COUNT_OF(RIEditIds) - 1];
|
||||||
|
|
||||||
|
CWindow m_SITab;
|
||||||
|
CEditNumber m_SIEdits[COUNT_OF(SIEditIds) - 1];
|
||||||
|
|
||||||
|
CWindow m_DDTab;
|
||||||
|
CEditNumber m_DDEdits[COUNT_OF(DDEditIds) - 1];
|
||||||
|
|
||||||
|
static void RegisterChanged(HWND hDlg, TAB_ID srcTabId, WPARAM wParam);
|
||||||
|
|
||||||
|
static INT_PTR CALLBACK TabProcDefault(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
static INT_PTR CALLBACK TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
static INT_PTR CALLBACK TabProcFPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
|
static void InitRegisterEdit(CWindow& tab, CEditNumber& edit, WORD ctrlId, HFONT font);
|
||||||
|
static void InitRegisterEdits(CWindow& tab, CEditNumber* edits, const DWORD* ctrlIds, HFONT font);
|
||||||
|
static void InitRegisterEdit64(CWindow& tab, CEditReg64& edit, WORD ctrlId, HFONT font);
|
||||||
|
static void InitRegisterEdits64(CWindow& tab, CEditReg64* edits, const DWORD* ctrlIds, HFONT font);
|
||||||
|
static void ZeroRegisterEdit(CEditNumber& edit);
|
||||||
|
static void ZeroRegisterEdits(CEditNumber* edits, const DWORD* ctrlIds);
|
||||||
|
static void ZeroRegisterEdit64(CEditReg64& edit);
|
||||||
|
static void ZeroRegisterEdits64(CEditReg64* edits, const DWORD* ctrlIds);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Attach(HWND hWndNew);
|
void Attach(HWND hWndNew);
|
||||||
CWindow AddTab(char* caption, int dialogId, DLGPROC dlgProc);
|
CWindow AddTab(char* caption, int dialogId, DLGPROC dlgProc);
|
||||||
void ShowTab(int nPage);
|
void ShowTab(int nPage);
|
||||||
CRect GetPageRect();
|
CRect GetPageRect();
|
||||||
void RedrawCurrentTab();
|
void RedrawCurrentTab();
|
||||||
void RefreshEdits();
|
void RefreshEdits();
|
||||||
void SetColorsEnabled(bool bColorsEnabled);
|
void SetColorsEnabled(bool bColorsEnabled);
|
||||||
};
|
};
|
|
@ -16,128 +16,127 @@
|
||||||
class CScriptList : public CListViewCtrl
|
class CScriptList : public CListViewCtrl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BEGIN_MSG_MAP_EX(CScriptList)
|
BEGIN_MSG_MAP_EX(CScriptList)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
class CEditEval : public CWindowImpl<CEditEval, CEdit>
|
class CEditEval : public CWindowImpl<CEditEval, CEdit>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
//static char* m_EvalString;
|
//static char* m_EvalString;
|
||||||
static const int HISTORY_MAX_ENTRIES = 20;
|
static const int HISTORY_MAX_ENTRIES = 20;
|
||||||
vector<char*> m_History;
|
vector<char*> m_History;
|
||||||
int m_HistoryIdx;
|
int m_HistoryIdx;
|
||||||
CDebugScripts* m_ScriptWindow;
|
CDebugScripts* m_ScriptWindow;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CEditEval()
|
CEditEval()
|
||||||
{
|
{
|
||||||
m_HistoryIdx = 0;
|
m_HistoryIdx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetScriptWindow(CDebugScripts* scriptWindow)
|
|
||||||
{
|
|
||||||
m_ScriptWindow = scriptWindow;
|
|
||||||
}
|
|
||||||
|
|
||||||
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
void SetScriptWindow(CDebugScripts* scriptWindow)
|
||||||
|
{
|
||||||
BOOL Attach(HWND hWndNew)
|
m_ScriptWindow = scriptWindow;
|
||||||
{
|
}
|
||||||
return SubclassWindow(hWndNew);
|
|
||||||
}
|
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CEditEval)
|
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
|
|
||||||
END_MSG_MAP()
|
BOOL Attach(HWND hWndNew)
|
||||||
|
{
|
||||||
|
return SubclassWindow(hWndNew);
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_MSG_MAP_EX(CEditEval)
|
||||||
|
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
|
||||||
|
END_MSG_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
class CEditConsole : public CWindowImpl<CEditEval, CEdit>
|
class CEditConsole : public CWindowImpl<CEditEval, CEdit>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||||
{
|
{
|
||||||
if (GetKeyState(VK_CONTROL) < 0)
|
if (GetKeyState(VK_CONTROL) < 0)
|
||||||
{
|
{
|
||||||
if (wParam == 'A')
|
if (wParam == 'A')
|
||||||
{
|
{
|
||||||
this->SetSelAll();
|
this->SetSelAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
BOOL Attach(HWND hWndNew)
|
BOOL Attach(HWND hWndNew)
|
||||||
{
|
{
|
||||||
return SubclassWindow(hWndNew);
|
return SubclassWindow(hWndNew);
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CEditEval)
|
BEGIN_MSG_MAP_EX(CEditEval)
|
||||||
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
|
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
class CDebugScripts :
|
class CDebugScripts :
|
||||||
public CDebugDialog < CDebugScripts >,
|
public CDebugDialog < CDebugScripts >,
|
||||||
public CDialogResize<CDebugScripts>
|
public CDialogResize<CDebugScripts>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CEdit m_InstanceInfoEdit;
|
CEdit m_InstanceInfoEdit;
|
||||||
CEditEval m_EvalEdit;
|
CEditEval m_EvalEdit;
|
||||||
CEditConsole m_ConsoleEdit;
|
CEditConsole m_ConsoleEdit;
|
||||||
CScriptList m_ScriptList;
|
CScriptList m_ScriptList;
|
||||||
char* m_SelectedScriptName;
|
char* m_SelectedScriptName;
|
||||||
|
|
||||||
void RefreshStatus();
|
void RefreshStatus();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_Scripts };
|
enum { IDD = IDD_Debugger_Scripts };
|
||||||
|
|
||||||
CDebugScripts(CDebuggerUI * debugger);
|
CDebugScripts(CDebuggerUI * debugger);
|
||||||
virtual ~CDebugScripts(void);
|
virtual ~CDebugScripts(void);
|
||||||
|
|
||||||
void ConsolePrint(const char* text);
|
void ConsolePrint(const char* text);
|
||||||
void ConsoleClear();
|
void ConsoleClear();
|
||||||
void ConsoleCopy();
|
void ConsoleCopy();
|
||||||
|
|
||||||
void RefreshList();
|
void RefreshList();
|
||||||
void RefreshConsole();
|
void RefreshConsole();
|
||||||
|
|
||||||
void EvaluateInSelectedInstance(char* code);
|
void EvaluateInSelectedInstance(char* code);
|
||||||
void RunSelected();
|
void RunSelected();
|
||||||
void StopSelected();
|
void StopSelected();
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
LRESULT OnDestroy(void)
|
LRESULT OnDestroy(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
||||||
LRESULT OnScriptListDblClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnScriptListClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnScriptListRClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnScriptListCustomDraw(NMHDR* pNMHDR);
|
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDebugScripts)
|
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
LRESULT OnScriptListDblClicked(NMHDR* pNMHDR);
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
LRESULT OnScriptListClicked(NMHDR* pNMHDR);
|
||||||
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_DBLCLK, OnScriptListDblClicked)
|
LRESULT OnScriptListRClicked(NMHDR* pNMHDR);
|
||||||
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_CLICK, OnScriptListClicked)
|
LRESULT OnScriptListCustomDraw(NMHDR* pNMHDR);
|
||||||
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_RCLICK, OnScriptListRClicked)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_CUSTOMDRAW, OnScriptListCustomDraw)
|
|
||||||
CHAIN_MSG_MAP_MEMBER(m_ScriptList)
|
|
||||||
MSG_WM_DESTROY(OnDestroy)
|
|
||||||
CHAIN_MSG_MAP(CDialogResize<CDebugScripts>)
|
|
||||||
END_MSG_MAP()
|
|
||||||
|
|
||||||
BEGIN_DLGRESIZE_MAP(CDebugScripts)
|
BEGIN_MSG_MAP_EX(CDebugScripts)
|
||||||
DLGRESIZE_CONTROL(IDC_CTX_INFO_EDIT, DLSZ_SIZE_X)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
DLGRESIZE_CONTROL(IDC_EVAL_EDIT, DLSZ_SIZE_X | DLSZ_MOVE_Y)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
DLGRESIZE_CONTROL(IDC_CONSOLE_EDIT, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_DBLCLK, OnScriptListDblClicked)
|
||||||
DLGRESIZE_CONTROL(IDC_SCRIPT_LIST, DLSZ_SIZE_Y)
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_CLICK, OnScriptListClicked)
|
||||||
DLGRESIZE_CONTROL(IDC_CLEAR_BTN, DLSZ_MOVE_X)
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_RCLICK, OnScriptListRClicked)
|
||||||
DLGRESIZE_CONTROL(IDC_COPY_BTN, DLSZ_MOVE_X)
|
NOTIFY_HANDLER_EX(IDC_SCRIPT_LIST, NM_CUSTOMDRAW, OnScriptListCustomDraw)
|
||||||
END_DLGRESIZE_MAP()
|
CHAIN_MSG_MAP_MEMBER(m_ScriptList)
|
||||||
|
MSG_WM_DESTROY(OnDestroy)
|
||||||
|
CHAIN_MSG_MAP(CDialogResize<CDebugScripts>)
|
||||||
|
END_MSG_MAP()
|
||||||
|
|
||||||
|
BEGIN_DLGRESIZE_MAP(CDebugScripts)
|
||||||
|
DLGRESIZE_CONTROL(IDC_CTX_INFO_EDIT, DLSZ_SIZE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_EVAL_EDIT, DLSZ_SIZE_X | DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_CONSOLE_EDIT, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_SCRIPT_LIST, DLSZ_SIZE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_CLEAR_BTN, DLSZ_MOVE_X)
|
||||||
|
DLGRESIZE_CONTROL(IDC_COPY_BTN, DLSZ_MOVE_X)
|
||||||
|
END_DLGRESIZE_MAP()
|
||||||
};
|
};
|
|
@ -15,51 +15,51 @@
|
||||||
#define STACKTRACE_MAX_ENTRIES 100
|
#define STACKTRACE_MAX_ENTRIES 100
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t routineAddress;
|
uint32_t routineAddress;
|
||||||
uint32_t callingAddress;
|
uint32_t callingAddress;
|
||||||
} STACKTRACE_ENTRY;
|
} STACKTRACE_ENTRY;
|
||||||
|
|
||||||
class CDebugStackTrace :
|
class CDebugStackTrace :
|
||||||
public CDebugDialog<CDebugStackTrace>,
|
public CDebugDialog<CDebugStackTrace>,
|
||||||
public CDialogResize<CDebugStackTrace>
|
public CDialogResize<CDebugStackTrace>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_StackTrace };
|
enum { IDD = IDD_Debugger_StackTrace };
|
||||||
|
|
||||||
CDebugStackTrace(CDebuggerUI * debugger);
|
CDebugStackTrace(CDebuggerUI * debugger);
|
||||||
virtual ~CDebugStackTrace(void);
|
virtual ~CDebugStackTrace(void);
|
||||||
|
|
||||||
void Refresh();
|
void Refresh();
|
||||||
|
|
||||||
void PushEntry(uint32_t routineAddress, uint32_t callingAddress);
|
void PushEntry(uint32_t routineAddress, uint32_t callingAddress);
|
||||||
void PopEntry();
|
void PopEntry();
|
||||||
void ClearEntries();
|
void ClearEntries();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
STACKTRACE_ENTRY m_Entries[STACKTRACE_MAX_ENTRIES];
|
|
||||||
int m_EntriesIndex;
|
|
||||||
|
|
||||||
HANDLE m_AutoRefreshThread;
|
|
||||||
static DWORD WINAPI AutoRefreshProc(void* _this);
|
|
||||||
|
|
||||||
CListViewCtrl m_List;
|
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
STACKTRACE_ENTRY m_Entries[STACKTRACE_MAX_ENTRIES];
|
||||||
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
int m_EntriesIndex;
|
||||||
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
|
||||||
LRESULT OnListDblClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnDestroy(void);
|
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDebugStackTrace)
|
HANDLE m_AutoRefreshThread;
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
static DWORD WINAPI AutoRefreshProc(void* _this);
|
||||||
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_STACKTRACE_LIST, NM_DBLCLK, OnListDblClicked)
|
|
||||||
CHAIN_MSG_MAP(CDialogResize<CDebugStackTrace>)
|
|
||||||
END_MSG_MAP()
|
|
||||||
|
|
||||||
BEGIN_DLGRESIZE_MAP(CDebugStackTrace)
|
CListViewCtrl m_List;
|
||||||
DLGRESIZE_CONTROL(IDC_STACKTRACE_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
|
||||||
END_DLGRESIZE_MAP()
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||||
|
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
|
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||||
|
LRESULT OnListDblClicked(NMHDR* pNMHDR);
|
||||||
|
LRESULT OnDestroy(void);
|
||||||
|
|
||||||
|
BEGIN_MSG_MAP_EX(CDebugStackTrace)
|
||||||
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
|
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
||||||
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
|
NOTIFY_HANDLER_EX(IDC_STACKTRACE_LIST, NM_DBLCLK, OnListDblClicked)
|
||||||
|
CHAIN_MSG_MAP(CDialogResize<CDebugStackTrace>)
|
||||||
|
END_MSG_MAP()
|
||||||
|
|
||||||
|
BEGIN_DLGRESIZE_MAP(CDebugStackTrace)
|
||||||
|
DLGRESIZE_CONTROL(IDC_STACKTRACE_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||||
|
END_DLGRESIZE_MAP()
|
||||||
};
|
};
|
|
@ -11,35 +11,34 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
class CDebugStackView :
|
class CDebugStackView :
|
||||||
public CDebugDialog<CDebugStackView>,
|
public CDebugDialog<CDebugStackView>,
|
||||||
public CDialogResize<CDebugStackView>
|
public CDialogResize<CDebugStackView>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_Stack };
|
enum { IDD = IDD_Debugger_Stack };
|
||||||
|
|
||||||
CDebugStackView(CDebuggerUI * debugger);
|
CDebugStackView(CDebuggerUI * debugger);
|
||||||
virtual ~CDebugStackView(void);
|
virtual ~CDebugStackView(void);
|
||||||
|
|
||||||
void Refresh();
|
void Refresh();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CListViewCtrl m_StackList;
|
CListViewCtrl m_StackList;
|
||||||
CStatic m_SPStatic;
|
CStatic m_SPStatic;
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
LRESULT OnDestroy(void);
|
LRESULT OnDestroy(void);
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDebugStackView)
|
BEGIN_MSG_MAP_EX(CDebugStackView)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
MSG_WM_DESTROY(OnDestroy)
|
MSG_WM_DESTROY(OnDestroy)
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
CHAIN_MSG_MAP(CDialogResize<CDebugStackView>)
|
CHAIN_MSG_MAP(CDialogResize<CDebugStackView>)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
BEGIN_DLGRESIZE_MAP(CDebugStackView)
|
BEGIN_DLGRESIZE_MAP(CDebugStackView)
|
||||||
DLGRESIZE_CONTROL(IDC_STACK_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
DLGRESIZE_CONTROL(IDC_STACK_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||||
END_DLGRESIZE_MAP()
|
END_DLGRESIZE_MAP()
|
||||||
};
|
};
|
|
@ -15,47 +15,45 @@
|
||||||
|
|
||||||
// todo maybe add char* ownerName and use a TreeView
|
// todo maybe add char* ownerName and use a TreeView
|
||||||
|
|
||||||
|
|
||||||
class CDebugSymbols :
|
class CDebugSymbols :
|
||||||
public CDebugDialog<CDebugSymbols>,
|
public CDebugDialog<CDebugSymbols>,
|
||||||
public CDialogResize<CDebugSymbols>
|
public CDialogResize<CDebugSymbols>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CListViewCtrl m_SymbolsListView;
|
CListViewCtrl m_SymbolsListView;
|
||||||
CAddSymbolDlg m_AddSymbolDlg;
|
CAddSymbolDlg m_AddSymbolDlg;
|
||||||
|
|
||||||
|
HANDLE m_AutoRefreshThread;
|
||||||
|
static DWORD WINAPI CDebugSymbols::AutoRefreshProc(void* _this);
|
||||||
|
|
||||||
HANDLE m_AutoRefreshThread;
|
|
||||||
static DWORD WINAPI CDebugSymbols::AutoRefreshProc(void* _this);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_Symbols };
|
enum { IDD = IDD_Debugger_Symbols };
|
||||||
|
|
||||||
CDebugSymbols(CDebuggerUI * debugger);
|
|
||||||
//virtual ~CDebugScripts(void);
|
|
||||||
|
|
||||||
void Refresh();
|
|
||||||
void RefreshValues();
|
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
CDebugSymbols(CDebuggerUI * debugger);
|
||||||
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
//virtual ~CDebugScripts(void);
|
||||||
LRESULT OnListDblClicked(NMHDR* pNMHDR);
|
|
||||||
LRESULT OnDestroy(void);
|
|
||||||
|
|
||||||
BEGIN_MSG_MAP_EX(CDebugSymbols)
|
void Refresh();
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
void RefreshValues();
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
|
||||||
MSG_WM_DESTROY(OnDestroy)
|
|
||||||
NOTIFY_HANDLER_EX(IDC_SYMBOLS_LIST, NM_DBLCLK, OnListDblClicked)
|
|
||||||
//NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_RCLICK, OnListClicked)
|
|
||||||
CHAIN_MSG_MAP(CDialogResize<CDebugSymbols>)
|
|
||||||
END_MSG_MAP()
|
|
||||||
|
|
||||||
BEGIN_DLGRESIZE_MAP(CDebugSymbols)
|
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
DLGRESIZE_CONTROL(IDC_FILTER_EDIT, DLSZ_MOVE_Y)
|
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||||
DLGRESIZE_CONTROL(IDC_FILTER_STATIC, DLSZ_MOVE_Y)
|
LRESULT OnListDblClicked(NMHDR* pNMHDR);
|
||||||
DLGRESIZE_CONTROL(IDC_REMOVESYMBOL_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
LRESULT OnDestroy(void);
|
||||||
DLGRESIZE_CONTROL(IDC_ADDSYMBOL_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
|
||||||
DLGRESIZE_CONTROL(IDC_SYMBOLS_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
BEGIN_MSG_MAP_EX(CDebugSymbols)
|
||||||
END_DLGRESIZE_MAP()
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
|
MSG_WM_DESTROY(OnDestroy)
|
||||||
|
NOTIFY_HANDLER_EX(IDC_SYMBOLS_LIST, NM_DBLCLK, OnListDblClicked)
|
||||||
|
//NOTIFY_HANDLER_EX(IDC_CMD_LIST, NM_RCLICK, OnListClicked)
|
||||||
|
CHAIN_MSG_MAP(CDialogResize<CDebugSymbols>)
|
||||||
|
END_MSG_MAP()
|
||||||
|
|
||||||
|
BEGIN_DLGRESIZE_MAP(CDebugSymbols)
|
||||||
|
DLGRESIZE_CONTROL(IDC_FILTER_EDIT, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_FILTER_STATIC, DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_REMOVESYMBOL_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_ADDSYMBOL_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
|
||||||
|
DLGRESIZE_CONTROL(IDC_SYMBOLS_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||||
|
END_DLGRESIZE_MAP()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@ class CDebugTlb :
|
||||||
BEGIN_MSG_MAP_EX(CDebugTlb)
|
BEGIN_MSG_MAP_EX(CDebugTlb)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum { IDD = IDD_Debugger_TLB };
|
enum { IDD = IDD_Debugger_TLB };
|
||||||
|
|
|
@ -24,59 +24,59 @@ public:
|
||||||
void ShowAddress(DWORD Address, bool VAddr);
|
void ShowAddress(DWORD Address, bool VAddr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BEGIN_MSG_MAP_EX(CDebugMemoryView)
|
BEGIN_MSG_MAP_EX(CDebugMemoryView)
|
||||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||||
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
||||||
COMMAND_HANDLER_EX(IDC_ADDR_EDIT, EN_CHANGE, OnAddrChanged)
|
COMMAND_HANDLER_EX(IDC_ADDR_EDIT, EN_CHANGE, OnAddrChanged)
|
||||||
NOTIFY_HANDLER_EX(IDC_MEM_DETAILS, LCN_MODIFIED, OnMemoryModified)
|
NOTIFY_HANDLER_EX(IDC_MEM_DETAILS, LCN_MODIFIED, OnMemoryModified)
|
||||||
NOTIFY_HANDLER_EX(IDC_MEM_DETAILS, LCN_RIGHTCLICK, OnMemoryRightClicked)
|
NOTIFY_HANDLER_EX(IDC_MEM_DETAILS, LCN_RIGHTCLICK, OnMemoryRightClicked)
|
||||||
NOTIFY_HANDLER_EX(IDC_MEM_DETAILS, LCN_HOTITEMCHANGED, OnHotItemChanged)
|
NOTIFY_HANDLER_EX(IDC_MEM_DETAILS, LCN_HOTITEMCHANGED, OnHotItemChanged)
|
||||||
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
||||||
MSG_WM_DESTROY(OnDestroy)
|
MSG_WM_DESTROY(OnDestroy)
|
||||||
MSG_WM_VSCROLL(OnVScroll)
|
MSG_WM_VSCROLL(OnVScroll)
|
||||||
END_MSG_MAP()
|
END_MSG_MAP()
|
||||||
|
|
||||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||||
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
||||||
void OnAddrChanged(UINT Code, int id, HWND ctl);
|
void OnAddrChanged(UINT Code, int id, HWND ctl);
|
||||||
void OnVScroll(int request, short Pos, HWND ctrl);
|
void OnVScroll(int request, short Pos, HWND ctrl);
|
||||||
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
||||||
LRESULT OnMemoryModified(LPNMHDR lpNMHDR);
|
LRESULT OnMemoryModified(LPNMHDR lpNMHDR);
|
||||||
LRESULT OnMemoryRightClicked(LPNMHDR lpNMHDR);
|
LRESULT OnMemoryRightClicked(LPNMHDR lpNMHDR);
|
||||||
LRESULT OnHotItemChanged(LPNMHDR lpNMHDR);
|
LRESULT OnHotItemChanged(LPNMHDR lpNMHDR);
|
||||||
LRESULT OnDestroy(void);
|
LRESULT OnDestroy(void);
|
||||||
|
|
||||||
void Insert_MemoryLineDump(int LineNumber);
|
void Insert_MemoryLineDump(int LineNumber);
|
||||||
void RefreshMemory(bool ResetCompare);
|
void RefreshMemory(bool ResetCompare);
|
||||||
|
|
||||||
HANDLE m_AutoRefreshThread;
|
HANDLE m_AutoRefreshThread;
|
||||||
static DWORD WINAPI AutoRefreshProc(void* _this);
|
static DWORD WINAPI AutoRefreshProc(void* _this);
|
||||||
|
|
||||||
void SelectColors(uint32_t address, bool changed, COLORREF& bgColor, COLORREF& fgColor, COLORREF& fgHiColor);
|
void SelectColors(uint32_t address, bool changed, COLORREF& bgColor, COLORREF& fgColor, COLORREF& fgHiColor);
|
||||||
bool GetItemOffset(LPNMHDR lpNMHDR, uint32_t &offset);
|
bool GetItemOffset(LPNMHDR lpNMHDR, uint32_t &offset);
|
||||||
bool GetItemAddress(LPNMHDR lpNMHDR, uint32_t &address);
|
bool GetItemAddress(LPNMHDR lpNMHDR, uint32_t &address);
|
||||||
|
|
||||||
bool AddressSafe(uint32_t vaddr);
|
bool AddressSafe(uint32_t vaddr);
|
||||||
|
|
||||||
enum { MemoryToDisplay = 0x100 };
|
enum { MemoryToDisplay = 0x100 };
|
||||||
|
|
||||||
static CDebugMemoryView* _this;
|
static CDebugMemoryView* _this;
|
||||||
static HHOOK hWinMessageHook;
|
static HHOOK hWinMessageHook;
|
||||||
static LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
static LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
void InterceptMouseWheel(WPARAM wParam, LPARAM lParam);
|
void InterceptMouseWheel(WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
CEditNumber m_MemAddr;
|
CEditNumber m_MemAddr;
|
||||||
CListCtrl * m_MemoryList;
|
CListCtrl * m_MemoryList;
|
||||||
CAddSymbolDlg m_AddSymbolDlg;
|
CAddSymbolDlg m_AddSymbolDlg;
|
||||||
CStatic m_SymInfo;
|
CStatic m_SymInfo;
|
||||||
CStatic m_DMAInfo;
|
CStatic m_DMAInfo;
|
||||||
|
|
||||||
CBreakpoints* m_Breakpoints;
|
CBreakpoints* m_Breakpoints;
|
||||||
|
|
||||||
int m_SymbolColorStride;
|
int m_SymbolColorStride;
|
||||||
int m_SymbolColorPhase;
|
int m_SymbolColorPhase;
|
||||||
DWORD m_CtxMenuAddr;
|
DWORD m_CtxMenuAddr;
|
||||||
|
|
||||||
DWORD m_DataStartLoc;
|
DWORD m_DataStartLoc;
|
||||||
bool m_DataVAddrr;
|
bool m_DataVAddrr;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../WTLApp.h"
|
#include "../../WTLApp.h"
|
||||||
#include "../../N64System.h"
|
#include "../../N64System.h"
|
||||||
|
|
|
@ -13,194 +13,194 @@
|
||||||
class CScriptSystem;
|
class CScriptSystem;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
STATE_STARTED, // initial evaluation & execution
|
STATE_STARTED, // initial evaluation & execution
|
||||||
STATE_RUNNING, // event loop running with pending events
|
STATE_RUNNING, // event loop running with pending events
|
||||||
STATE_STOPPED, // no pending events
|
STATE_STOPPED, // no pending events
|
||||||
STATE_INVALID
|
STATE_INVALID
|
||||||
} INSTANCE_STATE;
|
} INSTANCE_STATE;
|
||||||
|
|
||||||
class CScriptInstance
|
class CScriptInstance
|
||||||
{
|
{
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EVENT_READ,
|
EVENT_READ,
|
||||||
EVENT_WRITE,
|
EVENT_WRITE,
|
||||||
EVENT_ACCEPT,
|
EVENT_ACCEPT,
|
||||||
EVENT_CONNECT
|
EVENT_CONNECT
|
||||||
} IOEVENTTYPE;
|
} IOEVENTTYPE;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
OVERLAPPED ovl;
|
OVERLAPPED ovl;
|
||||||
IOEVENTTYPE eventType;
|
IOEVENTTYPE eventType;
|
||||||
HANDLE fd;
|
HANDLE fd;
|
||||||
HANDLE childFd; // accepted socket
|
HANDLE childFd; // accepted socket
|
||||||
bool bSocket;
|
bool bSocket;
|
||||||
UINT id;
|
UINT id;
|
||||||
void* data;
|
void* data;
|
||||||
DWORD dataLen; // changed to bytes transferred after event is fired
|
DWORD dataLen; // changed to bytes transferred after event is fired
|
||||||
void* callback;
|
void* callback;
|
||||||
} IOLISTENER;
|
} IOLISTENER;
|
||||||
|
|
||||||
// Wrapper for file/socket descriptor and completion port
|
// Wrapper for file/socket descriptor and completion port
|
||||||
typedef struct {
|
typedef struct {
|
||||||
HANDLE fd;
|
HANDLE fd;
|
||||||
HANDLE iocp;
|
HANDLE iocp;
|
||||||
bool bSocket;
|
bool bSocket;
|
||||||
} IOFD;
|
} IOFD;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EVENT_STATUS_OK,
|
EVENT_STATUS_OK,
|
||||||
EVENT_STATUS_INTERRUPTED,
|
EVENT_STATUS_INTERRUPTED,
|
||||||
EVENT_STATUS_ERROR
|
EVENT_STATUS_ERROR
|
||||||
} EVENT_STATUS;
|
} EVENT_STATUS;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CScriptInstance(CDebuggerUI* debugger);
|
|
||||||
~CScriptInstance();
|
|
||||||
|
|
||||||
void Start(char* path);
|
CScriptInstance(CDebuggerUI* debugger);
|
||||||
void ForceStop();
|
~CScriptInstance();
|
||||||
void Invoke(void* heapptr, uint32_t param = 0);
|
|
||||||
INSTANCE_STATE GetState();
|
|
||||||
|
|
||||||
friend class PendingEval;
|
void Start(char* path);
|
||||||
void EvalAsync(const char* jsCode);
|
void ForceStop();
|
||||||
const char* Eval(const char* jsCode);
|
void Invoke(void* heapptr, uint32_t param = 0);
|
||||||
|
INSTANCE_STATE GetState();
|
||||||
|
|
||||||
|
friend class PendingEval;
|
||||||
|
void EvalAsync(const char* jsCode);
|
||||||
|
const char* Eval(const char* jsCode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
duk_context* m_Ctx;
|
duk_context* m_Ctx;
|
||||||
duk_context* DukContext();
|
duk_context* DukContext();
|
||||||
char* m_TempPath;
|
char* m_TempPath;
|
||||||
|
|
||||||
HANDLE m_hThread;
|
|
||||||
HANDLE m_hIOCompletionPort;
|
|
||||||
CRITICAL_SECTION m_CriticalSection;
|
|
||||||
|
|
||||||
vector<IOFD> m_Files;
|
HANDLE m_hThread;
|
||||||
vector<IOLISTENER*> m_Listeners;
|
HANDLE m_hIOCompletionPort;
|
||||||
UINT m_NextListenerId;
|
CRITICAL_SECTION m_CriticalSection;
|
||||||
|
|
||||||
CDebuggerUI* m_Debugger;
|
|
||||||
|
|
||||||
CScriptSystem* m_ScriptSystem;
|
vector<IOFD> m_Files;
|
||||||
|
vector<IOLISTENER*> m_Listeners;
|
||||||
|
UINT m_NextListenerId;
|
||||||
|
|
||||||
INSTANCE_STATE m_State;
|
CDebuggerUI* m_Debugger;
|
||||||
|
|
||||||
static DWORD CALLBACK StartThread(CScriptInstance* _this);
|
|
||||||
void StartScriptProc();
|
|
||||||
void StartEventLoop();
|
|
||||||
bool HaveEvents();
|
|
||||||
EVENT_STATUS WaitForEvent(IOLISTENER** lpListener);
|
|
||||||
|
|
||||||
void SetState(INSTANCE_STATE state);
|
CScriptSystem* m_ScriptSystem;
|
||||||
void StateChanged();
|
|
||||||
|
|
||||||
void QueueAPC(PAPCFUNC userProc, ULONG_PTR param = 0);
|
INSTANCE_STATE m_State;
|
||||||
|
|
||||||
void AddFile(HANDLE fd, bool bSocket = false);
|
static DWORD CALLBACK StartThread(CScriptInstance* _this);
|
||||||
void CloseFile(HANDLE fd);
|
void StartScriptProc();
|
||||||
void CloseAllFiles();
|
void StartEventLoop();
|
||||||
void RemoveFile(HANDLE fd);
|
bool HaveEvents();
|
||||||
HANDLE CreateSocket();
|
EVENT_STATUS WaitForEvent(IOLISTENER** lpListener);
|
||||||
|
|
||||||
IOLISTENER* AddListener(HANDLE fd, IOEVENTTYPE evt, void* jsCallback, void* data = NULL, int dataLen = 0);
|
|
||||||
void RemoveListener(IOLISTENER* lpListener);
|
|
||||||
void RemoveListenerByIndex(UINT index);
|
|
||||||
void RemoveListenersByFd(HANDLE fd);
|
|
||||||
void InvokeListenerCallback(IOLISTENER* lpListener);
|
|
||||||
|
|
||||||
static void CALLBACK EvalAsyncCallback(ULONG_PTR evalWait);
|
|
||||||
|
|
||||||
const char* EvalFile(const char* jsPath);
|
void SetState(INSTANCE_STATE state);
|
||||||
|
void StateChanged();
|
||||||
// Lookup list of CScriptInstance instances for static js_* functions
|
|
||||||
static vector<CScriptInstance*> Cache;
|
|
||||||
static void CacheInstance(CScriptInstance* _this);
|
|
||||||
static void UncacheInstance(CScriptInstance* _this);
|
|
||||||
static CScriptInstance* FetchInstance(duk_context* ctx);
|
|
||||||
|
|
||||||
// Bound functions (_native object)
|
|
||||||
static duk_ret_t js_ioSockCreate (duk_context*);
|
|
||||||
static duk_ret_t js_ioSockListen (duk_context*);
|
|
||||||
static duk_ret_t js_ioSockAccept (duk_context*); // async
|
|
||||||
static duk_ret_t js_ioSockConnect (duk_context*); // async
|
|
||||||
static duk_ret_t js_ioRead (duk_context*); // async
|
|
||||||
static duk_ret_t js_ioWrite (duk_context*); // async
|
|
||||||
static duk_ret_t js_ioClose (duk_context*); // (fd) ; file or socket
|
|
||||||
static duk_ret_t js_MsgBox (duk_context*); // (message, caption)
|
|
||||||
static duk_ret_t js_AddCallback (duk_context*); // (hookId, callback, tag) ; external events
|
|
||||||
static duk_ret_t js_RemoveCallback (duk_context*); // (callbackId)
|
|
||||||
static duk_ret_t js_GetPCVal (duk_context*); // ()
|
|
||||||
static duk_ret_t js_SetPCVal (duk_context*); // (value)
|
|
||||||
static duk_ret_t js_GetHIVal (duk_context*); // (bUpper)
|
|
||||||
static duk_ret_t js_SetHIVal (duk_context*); // (bUpper, value)
|
|
||||||
static duk_ret_t js_GetLOVal (duk_context*); // (bUpper)
|
|
||||||
static duk_ret_t js_SetLOVal (duk_context*); // (bUpper, value)
|
|
||||||
static duk_ret_t js_GetGPRVal (duk_context*); // (regNum, bUpper)
|
|
||||||
static duk_ret_t js_SetGPRVal (duk_context*); // (regNum, bUpper, value)
|
|
||||||
static duk_ret_t js_GetFPRVal (duk_context*); // (regNum, bDouble)
|
|
||||||
static duk_ret_t js_SetFPRVal (duk_context*); // (regNum, bDouble, value)
|
|
||||||
static duk_ret_t js_GetROMInt (duk_context*); // (address, bitwidth, signed)
|
|
||||||
static duk_ret_t js_GetROMFloat (duk_context*); // (address, bDouble)
|
|
||||||
static duk_ret_t js_GetROMBlock (duk_context*); // (address, nBytes) ; returns Buffer
|
|
||||||
static duk_ret_t js_GetROMString (duk_context*); // (address[, maxLen]) ; fetch zero terminated string from memory
|
|
||||||
|
|
||||||
static duk_ret_t js_GetRDRAMInt (duk_context*); // (address, bitwidth, signed)
|
void QueueAPC(PAPCFUNC userProc, ULONG_PTR param = 0);
|
||||||
static duk_ret_t js_SetRDRAMInt (duk_context*); // (address, bitwidth, signed, newValue)
|
|
||||||
static duk_ret_t js_GetRDRAMFloat (duk_context*); // (address, bDouble)
|
|
||||||
static duk_ret_t js_SetRDRAMFloat (duk_context*); // (address, bDouble, newValue)
|
|
||||||
static duk_ret_t js_GetRDRAMBlock (duk_context*); // (address, nBytes) ; returns Buffer
|
|
||||||
static duk_ret_t js_GetRDRAMString (duk_context*); // (address[, maxLen]) ; fetch zero terminated string from memory
|
|
||||||
static duk_ret_t js_ConsolePrint (duk_context*);
|
|
||||||
static duk_ret_t js_ConsoleClear (duk_context*);
|
|
||||||
|
|
||||||
static duk_ret_t js_Pause(duk_context*); // () ; pauses emulation
|
void AddFile(HANDLE fd, bool bSocket = false);
|
||||||
static duk_ret_t js_ShowCommands(duk_context*); // ([address]) ; shows commands window
|
void CloseFile(HANDLE fd);
|
||||||
|
void CloseAllFiles();
|
||||||
|
void RemoveFile(HANDLE fd);
|
||||||
|
HANDLE CreateSocket();
|
||||||
|
|
||||||
static duk_ret_t js_ScreenPrint(duk_context*); // (x, y, text)
|
IOLISTENER* AddListener(HANDLE fd, IOEVENTTYPE evt, void* jsCallback, void* data = NULL, int dataLen = 0);
|
||||||
|
void RemoveListener(IOLISTENER* lpListener);
|
||||||
|
void RemoveListenerByIndex(UINT index);
|
||||||
|
void RemoveListenersByFd(HANDLE fd);
|
||||||
|
void InvokeListenerCallback(IOLISTENER* lpListener);
|
||||||
|
|
||||||
static constexpr duk_function_list_entry NativeFunctions[] =
|
static void CALLBACK EvalAsyncCallback(ULONG_PTR evalWait);
|
||||||
{
|
|
||||||
{ "addCallback", js_AddCallback, DUK_VARARGS },
|
|
||||||
{ "removeCallback", js_RemoveCallback, DUK_VARARGS },
|
|
||||||
|
|
||||||
{ "setPCVal", js_SetPCVal, DUK_VARARGS },
|
const char* EvalFile(const char* jsPath);
|
||||||
{ "getPCVal", js_GetPCVal, DUK_VARARGS },
|
|
||||||
{ "setHIVal", js_SetHIVal, DUK_VARARGS },
|
|
||||||
{ "getHIVal", js_GetHIVal, DUK_VARARGS },
|
|
||||||
{ "setLOVal", js_SetLOVal, DUK_VARARGS },
|
|
||||||
{ "getLOVal", js_GetLOVal, DUK_VARARGS },
|
|
||||||
{ "setGPRVal", js_SetGPRVal, DUK_VARARGS },
|
|
||||||
{ "getGPRVal", js_GetGPRVal, DUK_VARARGS },
|
|
||||||
{ "setFPRVal", js_SetFPRVal, DUK_VARARGS },
|
|
||||||
{ "getFPRVal", js_GetFPRVal, DUK_VARARGS },
|
|
||||||
|
|
||||||
{ "getROMInt", js_GetROMInt, DUK_VARARGS },
|
// Lookup list of CScriptInstance instances for static js_* functions
|
||||||
{ "getROMFloat", js_GetROMFloat, DUK_VARARGS },
|
static vector<CScriptInstance*> Cache;
|
||||||
{ "getROMString", js_GetROMString, DUK_VARARGS },
|
static void CacheInstance(CScriptInstance* _this);
|
||||||
{ "getROMBlock", js_GetROMBlock, DUK_VARARGS },
|
static void UncacheInstance(CScriptInstance* _this);
|
||||||
|
static CScriptInstance* FetchInstance(duk_context* ctx);
|
||||||
|
|
||||||
{ "getRDRAMInt", js_GetRDRAMInt, DUK_VARARGS },
|
// Bound functions (_native object)
|
||||||
{ "setRDRAMInt", js_SetRDRAMInt, DUK_VARARGS },
|
static duk_ret_t js_ioSockCreate(duk_context*);
|
||||||
{ "getRDRAMFloat", js_GetRDRAMFloat, DUK_VARARGS },
|
static duk_ret_t js_ioSockListen(duk_context*);
|
||||||
{ "setRDRAMFloat", js_SetRDRAMFloat, DUK_VARARGS },
|
static duk_ret_t js_ioSockAccept(duk_context*); // async
|
||||||
{ "getRDRAMBlock", js_GetRDRAMBlock, DUK_VARARGS },
|
static duk_ret_t js_ioSockConnect(duk_context*); // async
|
||||||
{ "getRDRAMString", js_GetRDRAMString, DUK_VARARGS },
|
static duk_ret_t js_ioRead(duk_context*); // async
|
||||||
|
static duk_ret_t js_ioWrite(duk_context*); // async
|
||||||
|
static duk_ret_t js_ioClose(duk_context*); // (fd) ; file or socket
|
||||||
|
static duk_ret_t js_MsgBox(duk_context*); // (message, caption)
|
||||||
|
static duk_ret_t js_AddCallback(duk_context*); // (hookId, callback, tag) ; external events
|
||||||
|
static duk_ret_t js_RemoveCallback(duk_context*); // (callbackId)
|
||||||
|
static duk_ret_t js_GetPCVal(duk_context*); // ()
|
||||||
|
static duk_ret_t js_SetPCVal(duk_context*); // (value)
|
||||||
|
static duk_ret_t js_GetHIVal(duk_context*); // (bUpper)
|
||||||
|
static duk_ret_t js_SetHIVal(duk_context*); // (bUpper, value)
|
||||||
|
static duk_ret_t js_GetLOVal(duk_context*); // (bUpper)
|
||||||
|
static duk_ret_t js_SetLOVal(duk_context*); // (bUpper, value)
|
||||||
|
static duk_ret_t js_GetGPRVal(duk_context*); // (regNum, bUpper)
|
||||||
|
static duk_ret_t js_SetGPRVal(duk_context*); // (regNum, bUpper, value)
|
||||||
|
static duk_ret_t js_GetFPRVal(duk_context*); // (regNum, bDouble)
|
||||||
|
static duk_ret_t js_SetFPRVal(duk_context*); // (regNum, bDouble, value)
|
||||||
|
static duk_ret_t js_GetROMInt(duk_context*); // (address, bitwidth, signed)
|
||||||
|
static duk_ret_t js_GetROMFloat(duk_context*); // (address, bDouble)
|
||||||
|
static duk_ret_t js_GetROMBlock(duk_context*); // (address, nBytes) ; returns Buffer
|
||||||
|
static duk_ret_t js_GetROMString(duk_context*); // (address[, maxLen]) ; fetch zero terminated string from memory
|
||||||
|
|
||||||
{ "sockCreate", js_ioSockCreate, DUK_VARARGS },
|
static duk_ret_t js_GetRDRAMInt(duk_context*); // (address, bitwidth, signed)
|
||||||
{ "sockListen", js_ioSockListen, DUK_VARARGS },
|
static duk_ret_t js_SetRDRAMInt(duk_context*); // (address, bitwidth, signed, newValue)
|
||||||
{ "sockAccept", js_ioSockAccept, DUK_VARARGS },
|
static duk_ret_t js_GetRDRAMFloat(duk_context*); // (address, bDouble)
|
||||||
{ "sockConnect", js_ioSockConnect, DUK_VARARGS },
|
static duk_ret_t js_SetRDRAMFloat(duk_context*); // (address, bDouble, newValue)
|
||||||
{ "close", js_ioClose, DUK_VARARGS },
|
static duk_ret_t js_GetRDRAMBlock(duk_context*); // (address, nBytes) ; returns Buffer
|
||||||
{ "write", js_ioWrite, DUK_VARARGS },
|
static duk_ret_t js_GetRDRAMString(duk_context*); // (address[, maxLen]) ; fetch zero terminated string from memory
|
||||||
{ "read", js_ioRead, DUK_VARARGS },
|
static duk_ret_t js_ConsolePrint(duk_context*);
|
||||||
{ "msgBox", js_MsgBox, DUK_VARARGS },
|
static duk_ret_t js_ConsoleClear(duk_context*);
|
||||||
{ "consolePrint", js_ConsolePrint, DUK_VARARGS },
|
|
||||||
{ "consoleClear", js_ConsoleClear, DUK_VARARGS },
|
|
||||||
{ "pause", js_Pause, DUK_VARARGS },
|
|
||||||
{ "showCommands", js_ShowCommands, DUK_VARARGS },
|
|
||||||
|
|
||||||
{ "screenPrint", js_ScreenPrint, DUK_VARARGS },
|
static duk_ret_t js_Pause(duk_context*); // () ; pauses emulation
|
||||||
{ NULL, NULL, 0 }
|
static duk_ret_t js_ShowCommands(duk_context*); // ([address]) ; shows commands window
|
||||||
};
|
|
||||||
|
static duk_ret_t js_ScreenPrint(duk_context*); // (x, y, text)
|
||||||
|
|
||||||
|
static constexpr duk_function_list_entry NativeFunctions[] =
|
||||||
|
{
|
||||||
|
{ "addCallback", js_AddCallback, DUK_VARARGS },
|
||||||
|
{ "removeCallback", js_RemoveCallback, DUK_VARARGS },
|
||||||
|
|
||||||
|
{ "setPCVal", js_SetPCVal, DUK_VARARGS },
|
||||||
|
{ "getPCVal", js_GetPCVal, DUK_VARARGS },
|
||||||
|
{ "setHIVal", js_SetHIVal, DUK_VARARGS },
|
||||||
|
{ "getHIVal", js_GetHIVal, DUK_VARARGS },
|
||||||
|
{ "setLOVal", js_SetLOVal, DUK_VARARGS },
|
||||||
|
{ "getLOVal", js_GetLOVal, DUK_VARARGS },
|
||||||
|
{ "setGPRVal", js_SetGPRVal, DUK_VARARGS },
|
||||||
|
{ "getGPRVal", js_GetGPRVal, DUK_VARARGS },
|
||||||
|
{ "setFPRVal", js_SetFPRVal, DUK_VARARGS },
|
||||||
|
{ "getFPRVal", js_GetFPRVal, DUK_VARARGS },
|
||||||
|
|
||||||
|
{ "getROMInt", js_GetROMInt, DUK_VARARGS },
|
||||||
|
{ "getROMFloat", js_GetROMFloat, DUK_VARARGS },
|
||||||
|
{ "getROMString", js_GetROMString, DUK_VARARGS },
|
||||||
|
{ "getROMBlock", js_GetROMBlock, DUK_VARARGS },
|
||||||
|
|
||||||
|
{ "getRDRAMInt", js_GetRDRAMInt, DUK_VARARGS },
|
||||||
|
{ "setRDRAMInt", js_SetRDRAMInt, DUK_VARARGS },
|
||||||
|
{ "getRDRAMFloat", js_GetRDRAMFloat, DUK_VARARGS },
|
||||||
|
{ "setRDRAMFloat", js_SetRDRAMFloat, DUK_VARARGS },
|
||||||
|
{ "getRDRAMBlock", js_GetRDRAMBlock, DUK_VARARGS },
|
||||||
|
{ "getRDRAMString", js_GetRDRAMString, DUK_VARARGS },
|
||||||
|
|
||||||
|
{ "sockCreate", js_ioSockCreate, DUK_VARARGS },
|
||||||
|
{ "sockListen", js_ioSockListen, DUK_VARARGS },
|
||||||
|
{ "sockAccept", js_ioSockAccept, DUK_VARARGS },
|
||||||
|
{ "sockConnect", js_ioSockConnect, DUK_VARARGS },
|
||||||
|
{ "close", js_ioClose, DUK_VARARGS },
|
||||||
|
{ "write", js_ioWrite, DUK_VARARGS },
|
||||||
|
{ "read", js_ioRead, DUK_VARARGS },
|
||||||
|
{ "msgBox", js_MsgBox, DUK_VARARGS },
|
||||||
|
{ "consolePrint", js_ConsolePrint, DUK_VARARGS },
|
||||||
|
{ "consoleClear", js_ConsoleClear, DUK_VARARGS },
|
||||||
|
{ "pause", js_Pause, DUK_VARARGS },
|
||||||
|
{ "showCommands", js_ShowCommands, DUK_VARARGS },
|
||||||
|
|
||||||
|
{ "screenPrint", js_ScreenPrint, DUK_VARARGS },
|
||||||
|
{ NULL, NULL, 0 }
|
||||||
|
};
|
||||||
};
|
};
|
|
@ -21,108 +21,107 @@ class CScriptHook;
|
||||||
class CScriptSystem
|
class CScriptSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CScriptSystem(CDebuggerUI* debugger);
|
CScriptSystem(CDebuggerUI* debugger);
|
||||||
~CScriptSystem();
|
~CScriptSystem();
|
||||||
// Run a script in its own context/thread
|
// Run a script in its own context/thread
|
||||||
void RunScript(char* path);
|
void RunScript(char* path);
|
||||||
|
|
||||||
// Kill a script context/thread by its path
|
// Kill a script context/thread by its path
|
||||||
void StopScript(char* path);
|
void StopScript(char* path);
|
||||||
|
|
||||||
const char* APIScript();
|
const char* APIScript();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char* hookId;
|
const char* hookId;
|
||||||
CScriptHook* cbList;
|
CScriptHook* cbList;
|
||||||
} HOOKENTRY;
|
} HOOKENTRY;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char* path;
|
char* path;
|
||||||
CScriptInstance* scriptInstance;
|
CScriptInstance* scriptInstance;
|
||||||
} INSTANCE_ENTRY;
|
} INSTANCE_ENTRY;
|
||||||
|
|
||||||
CDebuggerUI* m_Debugger;
|
CDebuggerUI* m_Debugger;
|
||||||
|
|
||||||
char* m_APIScript;
|
char* m_APIScript;
|
||||||
|
|
||||||
vector<HOOKENTRY> m_Hooks;
|
vector<HOOKENTRY> m_Hooks;
|
||||||
vector<INSTANCE_ENTRY> m_RunningInstances;
|
vector<INSTANCE_ENTRY> m_RunningInstances;
|
||||||
|
|
||||||
vector<char*> m_LogData;
|
vector<char*> m_LogData;
|
||||||
|
|
||||||
CScriptHook* m_HookCPUExec;
|
CScriptHook* m_HookCPUExec;
|
||||||
CScriptHook* m_HookCPURead;
|
CScriptHook* m_HookCPURead;
|
||||||
CScriptHook* m_HookCPUWrite;
|
CScriptHook* m_HookCPUWrite;
|
||||||
|
|
||||||
CScriptHook* m_HookFrameDrawn;
|
CScriptHook* m_HookFrameDrawn;
|
||||||
|
|
||||||
void RegisterHook(const char* hookId, CScriptHook* cbList); // associate string id with callback list
|
void RegisterHook(const char* hookId, CScriptHook* cbList); // associate string id with callback list
|
||||||
void UnregisterHooks();
|
void UnregisterHooks();
|
||||||
|
|
||||||
HDC m_ScreenDC;
|
HDC m_ScreenDC;
|
||||||
|
|
||||||
int m_NextCallbackId;
|
int m_NextCallbackId;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Returns true if any of the script hooks have callbacks for scriptInstance
|
// Returns true if any of the script hooks have callbacks for scriptInstance
|
||||||
|
|
||||||
|
void SetScreenDC(HDC hdc)
|
||||||
|
{
|
||||||
|
m_ScreenDC = hdc;
|
||||||
|
}
|
||||||
|
|
||||||
void SetScreenDC(HDC hdc)
|
HDC GetScreenDC()
|
||||||
{
|
{
|
||||||
m_ScreenDC = hdc;
|
return m_ScreenDC;
|
||||||
}
|
}
|
||||||
|
|
||||||
HDC GetScreenDC()
|
inline vector<char*>* LogData()
|
||||||
{
|
{
|
||||||
return m_ScreenDC;
|
return &m_LogData;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vector<char*>* LogData()
|
inline void LogText(const char* text)
|
||||||
{
|
{
|
||||||
return &m_LogData;
|
char* newStr = (char*)malloc(strlen(text));
|
||||||
}
|
strcpy(newStr, text);
|
||||||
|
m_LogData.push_back(newStr);
|
||||||
inline void LogText(const char* text)
|
m_Debugger->Debug_RefreshScriptsWindow();
|
||||||
{
|
}
|
||||||
char* newStr = (char*)malloc(strlen(text));
|
|
||||||
strcpy(newStr, text);
|
|
||||||
m_LogData.push_back(newStr);
|
|
||||||
m_Debugger->Debug_RefreshScriptsWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HasCallbacksForInstance(CScriptInstance* scriptInstance);
|
|
||||||
|
|
||||||
// Remove all hooked callbacks for an instance
|
bool HasCallbacksForInstance(CScriptInstance* scriptInstance);
|
||||||
void ClearCallbacksForInstance(CScriptInstance* scriptInstance);
|
|
||||||
|
|
||||||
void RemoveCallbackById(int callbackId);
|
// Remove all hooked callbacks for an instance
|
||||||
|
void ClearCallbacksForInstance(CScriptInstance* scriptInstance);
|
||||||
|
|
||||||
CScriptHook* GetHook(const char* hookId);
|
void RemoveCallbackById(int callbackId);
|
||||||
|
|
||||||
int GetNextCallbackId();
|
CScriptHook* GetHook(const char* hookId);
|
||||||
|
|
||||||
void DeleteStoppedInstances();
|
|
||||||
INSTANCE_STATE GetInstanceState(char* scriptName);
|
|
||||||
CScriptInstance* GetInstance(char* scriptName);
|
|
||||||
|
|
||||||
CScriptHook* HookCPUExec()
|
int GetNextCallbackId();
|
||||||
{
|
|
||||||
return m_HookCPUExec;
|
|
||||||
}
|
|
||||||
|
|
||||||
CScriptHook* HookCPURead()
|
void DeleteStoppedInstances();
|
||||||
{
|
INSTANCE_STATE GetInstanceState(char* scriptName);
|
||||||
return m_HookCPURead;
|
CScriptInstance* GetInstance(char* scriptName);
|
||||||
}
|
|
||||||
|
|
||||||
CScriptHook* HookCPUWrite()
|
CScriptHook* HookCPUExec()
|
||||||
{
|
{
|
||||||
return m_HookCPUWrite;
|
return m_HookCPUExec;
|
||||||
}
|
}
|
||||||
|
|
||||||
CScriptHook* HookFrameDrawn()
|
CScriptHook* HookCPURead()
|
||||||
{
|
{
|
||||||
return m_HookFrameDrawn;
|
return m_HookCPURead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CScriptHook* HookCPUWrite()
|
||||||
|
{
|
||||||
|
return m_HookCPUWrite;
|
||||||
|
}
|
||||||
|
|
||||||
|
CScriptHook* HookFrameDrawn()
|
||||||
|
{
|
||||||
|
return m_HookFrameDrawn;
|
||||||
|
}
|
||||||
};
|
};
|
|
@ -6,154 +6,153 @@ class CSymbolEntry;
|
||||||
class CSymbols
|
class CSymbols
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ERR_SUCCESS,
|
ERR_SUCCESS,
|
||||||
ERR_INVALID_TYPE,
|
ERR_INVALID_TYPE,
|
||||||
ERR_INVALID_ADDR,
|
ERR_INVALID_ADDR,
|
||||||
ERR_INVALID_NAME,
|
ERR_INVALID_NAME,
|
||||||
ERR_MISSING_FIELDS,
|
ERR_MISSING_FIELDS,
|
||||||
} ParseError;
|
} ParseError;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
TYPE_CODE,
|
TYPE_CODE,
|
||||||
TYPE_DATA,
|
TYPE_DATA,
|
||||||
TYPE_U8,
|
TYPE_U8,
|
||||||
TYPE_U16,
|
TYPE_U16,
|
||||||
TYPE_U32,
|
TYPE_U32,
|
||||||
TYPE_U64,
|
TYPE_U64,
|
||||||
TYPE_S8,
|
TYPE_S8,
|
||||||
TYPE_S16,
|
TYPE_S16,
|
||||||
TYPE_S32,
|
TYPE_S32,
|
||||||
TYPE_S64,
|
TYPE_S64,
|
||||||
TYPE_FLOAT,
|
TYPE_FLOAT,
|
||||||
TYPE_DOUBLE
|
TYPE_DOUBLE
|
||||||
} DataType;
|
} DataType;
|
||||||
|
|
||||||
static constexpr char* SymbolTypes[] = {
|
static constexpr char* SymbolTypes[] = {
|
||||||
"code", // 0
|
"code", // 0
|
||||||
"data", // 1
|
"data", // 1
|
||||||
"u8",
|
"u8",
|
||||||
"u16",
|
"u16",
|
||||||
"u32",
|
"u32",
|
||||||
"u64",
|
"u64",
|
||||||
"s8",
|
"s8",
|
||||||
"s16",
|
"s16",
|
||||||
"s32",
|
"s32",
|
||||||
"s64",
|
"s64",
|
||||||
"float",
|
"float",
|
||||||
"double",
|
"double",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr int TypeSizes[] = {
|
static constexpr int TypeSizes[] = {
|
||||||
1, 1, // code data
|
1, 1, // code data
|
||||||
1, 2, 4, 8, // u8 u16 u32 u64
|
1, 2, 4, 8, // u8 u16 u32 u64
|
||||||
1, 2, 4, 8, // s8 s16 s32 s64
|
1, 2, 4, 8, // s8 s16 s32 s64
|
||||||
4, 8 // float double
|
4, 8 // float double
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool m_bInitialized;
|
static bool m_bInitialized;
|
||||||
static vector<CSymbolEntry*> m_Symbols;
|
static vector<CSymbolEntry*> m_Symbols;
|
||||||
static int m_NextSymbolId;
|
static int m_NextSymbolId;
|
||||||
|
|
||||||
static CFile m_SymFileHandle;
|
|
||||||
static char* m_SymFileBuffer;
|
|
||||||
static size_t m_SymFileSize;
|
|
||||||
|
|
||||||
static CRITICAL_SECTION m_CriticalSection;
|
static CFile m_SymFileHandle;
|
||||||
|
static char* m_SymFileBuffer;
|
||||||
|
static size_t m_SymFileSize;
|
||||||
|
|
||||||
static char* m_ParserToken;
|
static CRITICAL_SECTION m_CriticalSection;
|
||||||
static size_t m_ParserTokenLength;
|
|
||||||
static char m_ParserDelimeter;
|
|
||||||
static char* m_SymFileParseBuffer;
|
|
||||||
static bool m_bHaveFirstToken;
|
|
||||||
|
|
||||||
static void ParserInit();
|
static char* m_ParserToken;
|
||||||
static void ParserDone();
|
static size_t m_ParserTokenLength;
|
||||||
static void ParserFetchToken(const char* delim);
|
static char m_ParserDelimeter;
|
||||||
|
static char* m_SymFileParseBuffer;
|
||||||
|
static bool m_bHaveFirstToken;
|
||||||
|
|
||||||
|
static void ParserInit();
|
||||||
|
static void ParserDone();
|
||||||
|
static void ParserFetchToken(const char* delim);
|
||||||
|
|
||||||
|
static bool SortFunction(CSymbolEntry* a, CSymbolEntry* b);
|
||||||
|
|
||||||
static bool SortFunction(CSymbolEntry* a, CSymbolEntry* b);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CPath GetSymFilePath();
|
static CPath GetSymFilePath();
|
||||||
static void Load();
|
static void Load();
|
||||||
static void Save();
|
static void Save();
|
||||||
static void ParseErrorAlert(char* message, int lineNumber);
|
static void ParseErrorAlert(char* message, int lineNumber);
|
||||||
|
|
||||||
static void Add(int type, uint32_t address, char* name, char* description = NULL);
|
|
||||||
static void RemoveEntryById(int id);
|
|
||||||
|
|
||||||
static void Reset();
|
|
||||||
|
|
||||||
static const char* GetTypeName(int typeNumber);
|
static void Add(int type, uint32_t address, char* name, char* description = NULL);
|
||||||
static int GetTypeNumber(char* typeName);
|
static void RemoveEntryById(int id);
|
||||||
static void GetValueString(char* str, CSymbolEntry* lpSymbol);
|
|
||||||
|
|
||||||
static int GetCount();
|
static void Reset();
|
||||||
|
|
||||||
static CSymbolEntry* GetEntryById(int id);
|
static const char* GetTypeName(int typeNumber);
|
||||||
static CSymbolEntry* GetEntryByIndex(int id);
|
static int GetTypeNumber(char* typeName);
|
||||||
static CSymbolEntry* GetEntryByAddress(uint32_t address);
|
static void GetValueString(char* str, CSymbolEntry* lpSymbol);
|
||||||
|
|
||||||
static const char* GetNameByAddress(uint32_t address);
|
static int GetCount();
|
||||||
|
|
||||||
static void InitializeCriticalSection();
|
static CSymbolEntry* GetEntryById(int id);
|
||||||
static void DeleteCriticalSection();
|
static CSymbolEntry* GetEntryByIndex(int id);
|
||||||
static void EnterCriticalSection();
|
static CSymbolEntry* GetEntryByAddress(uint32_t address);
|
||||||
static void LeaveCriticalSection();
|
|
||||||
|
|
||||||
|
static const char* GetNameByAddress(uint32_t address);
|
||||||
|
|
||||||
|
static void InitializeCriticalSection();
|
||||||
|
static void DeleteCriticalSection();
|
||||||
|
static void EnterCriticalSection();
|
||||||
|
static void LeaveCriticalSection();
|
||||||
};
|
};
|
||||||
|
|
||||||
class CSymbolEntry {
|
class CSymbolEntry {
|
||||||
public:
|
public:
|
||||||
int m_Id;
|
int m_Id;
|
||||||
int m_Type;
|
int m_Type;
|
||||||
uint32_t m_Address;
|
uint32_t m_Address;
|
||||||
char* m_Name;
|
char* m_Name;
|
||||||
char* m_Description;
|
char* m_Description;
|
||||||
|
|
||||||
CSymbolEntry(int id, int type, uint32_t address, char* name, char* description) :
|
|
||||||
m_Name(NULL),
|
|
||||||
m_Description(NULL),
|
|
||||||
m_Id(id),
|
|
||||||
m_Type(type),
|
|
||||||
m_Address(address)
|
|
||||||
{
|
|
||||||
if (name != NULL)
|
|
||||||
{
|
|
||||||
size_t nameLen = strlen(name);
|
|
||||||
m_Name = (char*)malloc(nameLen + 1);
|
|
||||||
strcpy(m_Name, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (description != NULL)
|
CSymbolEntry(int id, int type, uint32_t address, char* name, char* description) :
|
||||||
{
|
m_Name(NULL),
|
||||||
size_t descLen = strlen(description);
|
m_Description(NULL),
|
||||||
m_Description = (char*)malloc(descLen + 1);
|
m_Id(id),
|
||||||
strcpy(m_Description, description);
|
m_Type(type),
|
||||||
}
|
m_Address(address)
|
||||||
}
|
{
|
||||||
|
if (name != NULL)
|
||||||
~CSymbolEntry()
|
{
|
||||||
{
|
size_t nameLen = strlen(name);
|
||||||
if (m_Name != NULL)
|
m_Name = (char*)malloc(nameLen + 1);
|
||||||
{
|
strcpy(m_Name, name);
|
||||||
free(m_Name);
|
}
|
||||||
}
|
|
||||||
if (m_Description != NULL)
|
|
||||||
{
|
|
||||||
free(m_Description);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* TypeName()
|
if (description != NULL)
|
||||||
{
|
{
|
||||||
return CSymbols::SymbolTypes[m_Type];
|
size_t descLen = strlen(description);
|
||||||
}
|
m_Description = (char*)malloc(descLen + 1);
|
||||||
|
strcpy(m_Description, description);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int TypeSize()
|
~CSymbolEntry()
|
||||||
{
|
{
|
||||||
return CSymbols::TypeSizes[m_Type];
|
if (m_Name != NULL)
|
||||||
}
|
{
|
||||||
|
free(m_Name);
|
||||||
|
}
|
||||||
|
if (m_Description != NULL)
|
||||||
|
{
|
||||||
|
free(m_Description);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* TypeName()
|
||||||
|
{
|
||||||
|
return CSymbols::SymbolTypes[m_Type];
|
||||||
|
}
|
||||||
|
|
||||||
|
int TypeSize()
|
||||||
|
{
|
||||||
|
return CSymbols::TypeSizes[m_Type];
|
||||||
|
}
|
||||||
};
|
};
|
|
@ -27,68 +27,68 @@ class CScriptSystem;
|
||||||
|
|
||||||
__interface CDebugger
|
__interface CDebugger
|
||||||
{
|
{
|
||||||
virtual void TLBChanged ( void ) = 0;
|
virtual void TLBChanged(void) = 0;
|
||||||
virtual bool CPUStepStarted ( void ) = 0;
|
virtual bool CPUStepStarted(void) = 0;
|
||||||
virtual void CPUStep ( void ) = 0;
|
virtual void CPUStep(void) = 0;
|
||||||
virtual void FrameDrawn ( void ) = 0;
|
virtual void FrameDrawn(void) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CDebuggerUI :
|
class CDebuggerUI :
|
||||||
public CDebugger
|
public CDebugger
|
||||||
{
|
{
|
||||||
CDumpMemory * m_MemoryDump;
|
CDumpMemory * m_MemoryDump;
|
||||||
CDebugMemoryView * m_MemoryView;
|
CDebugMemoryView * m_MemoryView;
|
||||||
CDebugMemorySearch * m_MemorySearch;
|
CDebugMemorySearch * m_MemorySearch;
|
||||||
CDebugTlb * m_DebugTLB;
|
CDebugTlb * m_DebugTLB;
|
||||||
CDebugCommandsView * m_CommandsView;
|
CDebugCommandsView * m_CommandsView;
|
||||||
CDebugScripts * m_Scripts;
|
CDebugScripts * m_Scripts;
|
||||||
CDebugSymbols * m_Symbols;
|
CDebugSymbols * m_Symbols;
|
||||||
CDebugDMALogView * m_DMALogView;
|
CDebugDMALogView * m_DMALogView;
|
||||||
CDebugStackTrace * m_StackTrace;
|
CDebugStackTrace * m_StackTrace;
|
||||||
CDebugStackView * m_StackView;
|
CDebugStackView * m_StackView;
|
||||||
|
|
||||||
CBreakpoints * m_Breakpoints;
|
CBreakpoints * m_Breakpoints;
|
||||||
CScriptSystem * m_ScriptSystem;
|
CScriptSystem * m_ScriptSystem;
|
||||||
CDMALog * m_DMALog;
|
CDMALog * m_DMALog;
|
||||||
|
|
||||||
void BreakpointHit(void);
|
void BreakpointHit(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CDebuggerUI();
|
CDebuggerUI();
|
||||||
virtual ~CDebuggerUI();
|
virtual ~CDebuggerUI();
|
||||||
|
|
||||||
void TLBChanged ( void );
|
void TLBChanged(void);
|
||||||
bool CPUStepStarted ( void );
|
bool CPUStepStarted(void);
|
||||||
void CPUStep ( void );
|
void CPUStep(void);
|
||||||
void FrameDrawn ( void );
|
void FrameDrawn(void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Debug_Reset ( void );
|
void Debug_Reset(void);
|
||||||
void Debug_ShowMemoryDump ( void );
|
void Debug_ShowMemoryDump(void);
|
||||||
void Debug_ShowMemoryWindow ( void );
|
void Debug_ShowMemoryWindow(void);
|
||||||
void Debug_ShowMemoryLocation ( uint32_t Address, bool VAddr );
|
void Debug_ShowMemoryLocation(uint32_t Address, bool VAddr);
|
||||||
void Debug_ShowMemorySearch ( void );
|
void Debug_ShowMemorySearch(void);
|
||||||
void Debug_ShowTLBWindow ( void );
|
void Debug_ShowTLBWindow(void);
|
||||||
void Debug_RefreshTLBWindow ( void );
|
void Debug_RefreshTLBWindow(void);
|
||||||
void Debug_ShowCommandsWindow ( void );
|
void Debug_ShowCommandsWindow(void);
|
||||||
void Debug_ShowCommandsLocation ( uint32_t address, bool top );
|
void Debug_ShowCommandsLocation(uint32_t address, bool top);
|
||||||
void Debug_ShowScriptsWindow ( void );
|
void Debug_ShowScriptsWindow(void);
|
||||||
void Debug_LogScriptsWindow ( const char* text );
|
void Debug_LogScriptsWindow(const char* text);
|
||||||
void Debug_ClearScriptsWindow ( void );
|
void Debug_ClearScriptsWindow(void);
|
||||||
void Debug_RefreshScriptsWindow ( void );
|
void Debug_RefreshScriptsWindow(void);
|
||||||
void Debug_RefreshSymbolsWindow ( void );
|
void Debug_RefreshSymbolsWindow(void);
|
||||||
void Debug_ShowSymbolsWindow ( void );
|
void Debug_ShowSymbolsWindow(void);
|
||||||
void Debug_ShowStackTrace ( void );
|
void Debug_ShowStackTrace(void);
|
||||||
void Debug_ShowStackWindow ( void );
|
void Debug_ShowStackWindow(void);
|
||||||
void Debug_RefreshStackWindow ( void );
|
void Debug_RefreshStackWindow(void);
|
||||||
void Debug_RefreshStackTraceWindow ( void );
|
void Debug_RefreshStackTraceWindow(void);
|
||||||
void Debug_ShowDMALogWindow ( void );
|
void Debug_ShowDMALogWindow(void);
|
||||||
|
|
||||||
CBreakpoints* Breakpoints();
|
CBreakpoints* Breakpoints();
|
||||||
CDebugSymbols* Symbols();
|
CDebugSymbols* Symbols();
|
||||||
CScriptSystem* ScriptSystem();
|
CScriptSystem* ScriptSystem();
|
||||||
CDebugScripts* ScriptConsole();
|
CDebugScripts* ScriptConsole();
|
||||||
CDMALog* DMALog();
|
CDMALog* DMALog();
|
||||||
|
|
||||||
static void GameReset ( CDebuggerUI * _this );
|
static void GameReset(CDebuggerUI * _this);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue