Code Cleanup: Clean up memory search and memory dump class definition

This commit is contained in:
zilmar 2012-12-18 19:47:53 +11:00
parent a444ad3e52
commit 718239477f
2 changed files with 31 additions and 48 deletions

View File

@ -1,6 +1,16 @@
class CDumpMemory : class CDumpMemory :
public CDebugDialog<CDumpMemory> public CDebugDialog<CDumpMemory>
{ {
public:
enum { IDD = IDD_Cheats_DumpMemory };
CDumpMemory(CDebugger * debugger);
virtual ~CDumpMemory(void);
private:
CDumpMemory(void); // Disable default constructor
CDumpMemory(const CDumpMemory&); // Disable copy constructor
CDumpMemory& operator=(const CDumpMemory&); // Disable assignment
enum DumpFormat enum DumpFormat
{ {
@ -10,43 +20,12 @@ class CDumpMemory :
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 );
CEditNumber m_StartAddress, m_EndAddress, m_PC; CEditNumber m_StartAddress, m_EndAddress, m_PC;
};
public:
enum { IDD = IDD_Cheats_DumpMemory };
CDumpMemory(CDebugger * debugger);
virtual ~CDumpMemory(void);
};
//class CDumpMemory
//{
// enum DumpFormat
// {
// DisassemblyWithPC
// };
// CMipsMemory * g_MMU;
// WND_HANDLE m_Window;
// WORD SelStart, SelStop;
// static DWORD m_StartAddress;
// static DWORD m_EndAddress;
//
// bool DumpMemory(LPCSTR FileName,DumpFormat Format, DWORD StartPC, DWORD EndPC, DWORD DumpPC);
//
// static DWORD AsciiToHex ( const char * HexValue );
// static int CALLBACK WinProc (WND_HANDLE hDlg,DWORD uMsg,DWORD wParam, DWORD lParam);
//
//
//public:
// CDumpMemory(CMipsMemory * MMU);
// ~CDumpMemory(void);
//
// void DisplayDump ( WND_HANDLE & hParent );
//};

View File

@ -1,20 +1,31 @@
class CDebugMemorySearch : class CDebugMemorySearch :
public CDebugDialog<CDebugMemorySearch> public CDebugDialog<CDebugMemorySearch>
{ {
public:
enum { IDD = IDD_Debugger_Search };
CDebugMemorySearch(CDebugger * debugger);
virtual ~CDebugMemorySearch(void);
private:
CDebugMemorySearch(void); // Disable default constructor
CDebugMemorySearch(const CDebugMemorySearch&); // Disable copy constructor
CDebugMemorySearch& operator=(const CDebugMemorySearch&); // Disable assignment
typedef struct { typedef struct {
DWORD PAddr; DWORD PAddr;
DWORD Value; DWORD Value;
} SearchResultItem; } SearchResultItem;
typedef std::vector<SearchResultItem> SearchResult; typedef std::vector<SearchResultItem> SearchResult;
BEGIN_MSG_MAP_EX(CDebugMemorySearch) BEGIN_MSG_MAP_EX(CDebugMemorySearch)
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)
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 );
@ -23,24 +34,17 @@ class CDebugMemorySearch :
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;
CN64System * m_System; CN64System * m_System;
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 );
public:
enum { IDD = IDD_Debugger_Search };
CDebugMemorySearch(CDebugger * debugger);
virtual ~CDebugMemorySearch(void);
}; };