project64/Source/Project64/UserInterface/Debugger/Debugger-StackTrace.h

79 lines
2.0 KiB
C
Raw Normal View History

2017-08-18 05:08:22 +00:00
#pragma once
#include "DebuggerUI.h"
2017-08-30 04:54:06 +00:00
#define STACKTRACE_MAX_ENTRIES 100
2022-09-26 02:31:54 +00:00
typedef struct
{
2017-09-13 10:36:03 +00:00
uint32_t routineAddress;
uint32_t callingAddress;
2017-08-30 04:54:06 +00:00
} STACKTRACE_ENTRY;
2017-08-18 05:08:22 +00:00
class CDebugStackTrace :
2017-09-13 10:36:03 +00:00
public CDebugDialog<CDebugStackTrace>,
public CDialogResize<CDebugStackTrace>,
private CDebugSettings
2017-08-18 05:08:22 +00:00
{
public:
2022-09-26 02:31:54 +00:00
enum
{
IDD = IDD_Debugger_StackTrace
};
2017-08-18 05:08:22 +00:00
2017-09-13 10:36:03 +00:00
CDebugStackTrace(CDebuggerUI * debugger);
virtual ~CDebugStackTrace(void);
2017-08-18 05:08:22 +00:00
2017-09-13 10:36:03 +00:00
void Refresh();
2017-08-30 04:54:06 +00:00
inline void PushEntry(uint32_t routineAddress, uint32_t callingAddress)
{
if (m_EntriesIndex < STACKTRACE_MAX_ENTRIES)
{
2022-09-26 02:31:54 +00:00
m_Entries[m_EntriesIndex] = {routineAddress, callingAddress};
m_EntriesIndex++;
}
}
inline void PopEntry()
{
if (m_EntriesIndex > 0)
{
m_EntriesIndex--;
}
}
inline void ClearEntries()
{
m_EntriesIndex = 0;
}
2017-08-18 05:08:22 +00:00
private:
2017-09-13 10:36:03 +00:00
STACKTRACE_ENTRY m_Entries[STACKTRACE_MAX_ENTRIES];
int m_EntriesIndex;
2017-08-18 05:08:22 +00:00
2017-09-13 10:36:03 +00:00
CListViewCtrl m_List;
2022-09-26 02:31:54 +00:00
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);
2017-09-13 10:36:03 +00:00
LRESULT OnDestroy(void);
void OnExitSizeMove(void);
2017-09-13 10:36:03 +00:00
BEGIN_MSG_MAP_EX(CDebugStackTrace)
2022-09-26 02:31:54 +00:00
{
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog);
MSG_WM_DESTROY(OnDestroy);
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>);
MSG_WM_EXITSIZEMOVE(OnExitSizeMove);
}
END_MSG_MAP()
2017-09-13 10:36:03 +00:00
BEGIN_DLGRESIZE_MAP(CDebugStackTrace)
2022-09-26 02:31:54 +00:00
DLGRESIZE_CONTROL(IDC_STACKTRACE_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
2017-09-13 10:36:03 +00:00
END_DLGRESIZE_MAP()
};