summaryrefslogtreecommitdiff
path: root/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
diff options
context:
space:
mode:
authorhyperiris <hyperiris@gmail.com>2009-01-21 17:02:01 +0000
committerhyperiris <hyperiris@gmail.com>2009-01-21 17:02:01 +0000
commitb71d92126d0df2113f6030811a165ced681e0cae (patch)
tree754ff687aa6900c245c758dcf83c12834c640df5 /Source/Core/DebuggerWX/Src/MemoryWindow.cpp
parent8f4d58e0827c4b476bd595677fb8853329103271 (diff)
Debugger: add a tiny function, dump main memory to a file, mainram.dump in .\User\Cache\,
this is for ram data analysis, open the dump in hex/tile editor we can do something... git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1973 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DebuggerWX/Src/MemoryWindow.cpp')
-rw-r--r--Source/Core/DebuggerWX/Src/MemoryWindow.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
index c406bc1a84..9a4be1859a 100644
--- a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp
@@ -58,7 +58,9 @@ enum
IDM_REGISTERWINDOW,
IDM_BREAKPOINTWINDOW,
IDM_VALBOX,
- IDM_SETVALBUTTON
+ IDM_SETVALBUTTON,
+ IDM_DUMP_MEMORY,
+
};
BEGIN_EVENT_TABLE(CMemoryWindow, wxFrame)
@@ -66,6 +68,7 @@ BEGIN_EVENT_TABLE(CMemoryWindow, wxFrame)
EVT_LISTBOX(IDM_SYMBOLLIST, CMemoryWindow::OnSymbolListChange)
EVT_HOST_COMMAND(wxID_ANY, CMemoryWindow::OnHostMessage)
EVT_BUTTON(IDM_SETVALBUTTON, CMemoryWindow::SetMemoryValue)
+ EVT_BUTTON(IDM_DUMP_MEMORY, CMemoryWindow::OnDumpMemory)
END_EVENT_TABLE()
@@ -90,6 +93,9 @@ CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
sizerRight->Add(new wxButton(this, IDM_SETPC, _T("S&et PC")));
sizerRight->Add(valbox = new wxTextCtrl(this, IDM_VALBOX, _T("")));
sizerRight->Add(new wxButton(this, IDM_SETVALBUTTON, _T("Set &Value")));
+
+ sizerRight->AddSpacer(5);
+ sizerRight->Add(new wxButton(this, IDM_DUMP_MEMORY, _T("&Dump Memory")));
SetSizer(sizerBig);
@@ -218,4 +224,18 @@ void CMemoryWindow::OnHostMessage(wxCommandEvent& event)
}
}
+// this is a simple main 1Tsram dump,
+// so we can view memory in a tile/hex viewer for data analysis
+void CMemoryWindow::OnDumpMemory( wxCommandEvent& event )
+{
+ FILE* pDumpFile = fopen(FULL_MEMORY_DUMP_DIR, "wb");
+ if (pDumpFile)
+ {
+ if (Memory::m_pRAM)
+ {
+ fwrite(Memory::m_pRAM, Memory::REALRAM_SIZE, 1, pDumpFile);
+ }
+ fclose(pDumpFile);
+ }
+}