2016-01-27 09:11:59 +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
|
|
|
|
|
2017-08-18 05:08:22 +00:00
|
|
|
#include "Debugger-AddSymbol.h"
|
|
|
|
|
2016-01-27 09:11:59 +00:00
|
|
|
class CDebugMemoryView :
|
|
|
|
public CDebugDialog < CDebugMemoryView >
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum { IDD = IDD_Debugger_Memory };
|
|
|
|
|
|
|
|
CDebugMemoryView(CDebuggerUI * debugger);
|
|
|
|
virtual ~CDebugMemoryView(void);
|
|
|
|
|
|
|
|
void ShowAddress(DWORD Address, bool VAddr);
|
|
|
|
|
|
|
|
private:
|
2017-09-13 10:36:03 +00:00
|
|
|
BEGIN_MSG_MAP_EX(CDebugMemoryView)
|
|
|
|
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
|
|
|
COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
|
|
|
|
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_RIGHTCLICK, OnMemoryRightClicked)
|
|
|
|
NOTIFY_HANDLER_EX(IDC_MEM_DETAILS, LCN_HOTITEMCHANGED, OnHotItemChanged)
|
|
|
|
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
|
2016-01-27 09:11:59 +00:00
|
|
|
MSG_WM_DESTROY(OnDestroy)
|
|
|
|
MSG_WM_VSCROLL(OnVScroll)
|
2018-04-02 18:30:50 +00:00
|
|
|
END_MSG_MAP()
|
2017-09-13 10:36:03 +00:00
|
|
|
|
|
|
|
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
|
|
|
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
|
|
|
|
void OnAddrChanged(UINT Code, int id, HWND ctl);
|
|
|
|
void OnVScroll(int request, short Pos, HWND ctrl);
|
|
|
|
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
LRESULT OnMemoryModified(LPNMHDR lpNMHDR);
|
|
|
|
LRESULT OnMemoryRightClicked(LPNMHDR lpNMHDR);
|
|
|
|
LRESULT OnHotItemChanged(LPNMHDR lpNMHDR);
|
|
|
|
LRESULT OnDestroy(void);
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
void Insert_MemoryLineDump(int LineNumber);
|
|
|
|
void RefreshMemory(bool ResetCompare);
|
|
|
|
|
2017-09-13 10:36:03 +00:00
|
|
|
HANDLE m_AutoRefreshThread;
|
2017-09-13 12:00:53 +00:00
|
|
|
static DWORD WINAPI AutoRefreshProc(void* _self);
|
2017-08-18 05:08:22 +00:00
|
|
|
|
2017-09-13 10:36:03 +00:00
|
|
|
void SelectColors(uint32_t address, bool changed, COLORREF& bgColor, COLORREF& fgColor, COLORREF& fgHiColor);
|
|
|
|
bool GetItemOffset(LPNMHDR lpNMHDR, uint32_t &offset);
|
|
|
|
bool GetItemAddress(LPNMHDR lpNMHDR, uint32_t &address);
|
2016-01-27 09:11:59 +00:00
|
|
|
|
2017-09-13 10:36:03 +00:00
|
|
|
bool AddressSafe(uint32_t vaddr);
|
2017-08-18 05:08:22 +00:00
|
|
|
|
|
|
|
enum { MemoryToDisplay = 0x100 };
|
2017-09-13 10:36:03 +00:00
|
|
|
|
|
|
|
static CDebugMemoryView* _this;
|
|
|
|
static HHOOK hWinMessageHook;
|
|
|
|
static LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
|
|
void InterceptMouseWheel(WPARAM wParam, LPARAM lParam);
|
2017-08-30 06:15:28 +00:00
|
|
|
|
2017-11-21 20:37:45 +00:00
|
|
|
CEditNumber32 m_MemAddr;
|
2016-01-27 09:11:59 +00:00
|
|
|
CListCtrl * m_MemoryList;
|
2017-09-13 10:36:03 +00:00
|
|
|
CAddSymbolDlg m_AddSymbolDlg;
|
|
|
|
CStatic m_SymInfo;
|
|
|
|
CStatic m_DMAInfo;
|
|
|
|
|
|
|
|
CBreakpoints* m_Breakpoints;
|
|
|
|
|
|
|
|
int m_SymbolColorStride;
|
|
|
|
int m_SymbolColorPhase;
|
|
|
|
DWORD m_CtxMenuAddr;
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
DWORD m_DataStartLoc;
|
|
|
|
bool m_DataVAddrr;
|
|
|
|
BYTE m_CurrentData[MemoryToDisplay];
|
|
|
|
bool m_DataValid[MemoryToDisplay];
|
|
|
|
|
|
|
|
DWORD m_CompareStartLoc;
|
|
|
|
bool m_CompareVAddrr;
|
|
|
|
BYTE m_CompareData[MemoryToDisplay];
|
|
|
|
bool m_CompareValid[MemoryToDisplay];
|
2017-08-18 05:08:22 +00:00
|
|
|
};
|