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
|
|
|
|
|
|
|
|
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>,
|
2018-01-15 21:14:15 +00:00
|
|
|
public CDialogResize<CDebugStackTrace>,
|
|
|
|
private CDebugSettings
|
2017-08-18 05:08:22 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-09-13 10:36:03 +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
|
|
|
|
2019-12-01 10:10:36 +00:00
|
|
|
inline void PushEntry(uint32_t routineAddress, uint32_t callingAddress)
|
|
|
|
{
|
|
|
|
if (m_EntriesIndex < STACKTRACE_MAX_ENTRIES)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
|
|
|
|
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);
|
2019-01-14 06:02:05 +00:00
|
|
|
void OnExitSizeMove(void);
|
2017-09-13 10:36:03 +00:00
|
|
|
|
|
|
|
BEGIN_MSG_MAP_EX(CDebugStackTrace)
|
|
|
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
2017-09-13 12:00:53 +00:00
|
|
|
MSG_WM_DESTROY(OnDestroy)
|
2017-09-13 10:36:03 +00:00
|
|
|
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>)
|
2019-01-14 06:02:05 +00:00
|
|
|
MSG_WM_EXITSIZEMOVE(OnExitSizeMove)
|
2017-09-13 10:36:03 +00:00
|
|
|
END_MSG_MAP()
|
|
|
|
|
|
|
|
BEGIN_DLGRESIZE_MAP(CDebugStackTrace)
|
|
|
|
DLGRESIZE_CONTROL(IDC_STACKTRACE_LIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
|
|
|
END_DLGRESIZE_MAP()
|
2021-03-18 03:34:24 +00:00
|
|
|
};
|