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

69 lines
2.5 KiB
C
Raw Normal View History

2017-08-18 05:08:22 +00:00
/****************************************************************************
* *
* Project64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#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>,
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
2017-09-13 10:36:03 +00:00
void PushEntry(uint32_t routineAddress, uint32_t callingAddress);
void PopEntry();
void ClearEntries();
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
HANDLE m_AutoRefreshThread;
static DWORD WINAPI AutoRefreshProc(void* _this);
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);
void OnExitSizeMove(void);
2017-09-13 10:36:03 +00:00
BEGIN_MSG_MAP_EX(CDebugStackTrace)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
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>)
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()
2017-08-18 05:08:22 +00:00
};