diff options
| author | hrydgard <hrydgard@gmail.com> | 2008-08-30 12:11:25 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2008-08-30 12:11:25 +0000 |
| commit | ff0a613427de1533edf2f5b3347a44fd9f242998 (patch) | |
| tree | cf7a6a6184f656e846650a5329c3b80bb542af95 /Source/Core/DebuggerWX/src/CodeWindow.cpp | |
| parent | 838f37112efafb57a519495161b9d04f3bc9713c (diff) | |
Cleaning up XK's mess, added a simple profiler, minor disasm fix. Too lazy to split it up into individual changes. Savestates not yet working.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@381 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DebuggerWX/src/CodeWindow.cpp')
| -rw-r--r-- | Source/Core/DebuggerWX/src/CodeWindow.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Source/Core/DebuggerWX/src/CodeWindow.cpp b/Source/Core/DebuggerWX/src/CodeWindow.cpp index 0136a118df..e52b59d39a 100644 --- a/Source/Core/DebuggerWX/src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/src/CodeWindow.cpp @@ -48,6 +48,7 @@ #include "Debugger/PPCDebugInterface.h"
#include "Debugger/Debugger_SymbolMap.h"
#include "PowerPC/PPCAnalyst.h"
+#include "PowerPC/Profiler.h"
#include "PowerPC/SymbolDB.h"
#include "PowerPC/SignatureDB.h"
#include "PowerPC/PPCTables.h"
@@ -86,6 +87,10 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame) EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu)
+
+ EVT_MENU(IDM_PROFILEBLOCKS, CCodeWindow::OnProfilerMenu)
+ EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu)
+
// toolbar
EVT_MENU(IDM_DEBUG_GO, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_STEP, CCodeWindow::OnCodeStep)
@@ -275,6 +280,15 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam pMenuBar->Append(pJitMenu, _T("&JIT"));
}
+ {
+ wxMenu *pProfilerMenu = new wxMenu;
+ pProfilerMenu->Append(IDM_PROFILEBLOCKS, _T("&Profile blocks"), wxEmptyString, wxITEM_CHECK);
+ pProfilerMenu->AppendSeparator();
+ pProfilerMenu->Append(IDM_WRITEPROFILE, _T("&Write to profile.txt, show"));
+ pMenuBar->Append(pProfilerMenu, _T("&Profiler"));
+ }
+
+
SetMenuBar(pMenuBar);
}
@@ -295,6 +309,7 @@ void CCodeWindow::OnInterpreter(wxCommandEvent& event) if (Core::GetState() != Core::CORE_RUN) {
PowerPC::SetMode(UseInterpreter() ? PowerPC::MODE_INTERPRETER : PowerPC::MODE_JIT);
} else {
+ event.Skip();
wxMessageBox(_T("Please pause the emulator before changing mode."));
}
}
@@ -312,6 +327,24 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event) }
}
+void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
+{
+ if (Core::GetState() == Core::CORE_RUN) {
+ event.Skip();
+ return;
+ }
+ switch (event.GetId())
+ {
+ case IDM_PROFILEBLOCKS:
+ Jit64::ClearCache();
+ Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS);
+ break;
+ case IDM_WRITEPROFILE:
+ Profiler::WriteProfileResults("profiler.txt");
+ break;
+ }
+}
+
void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
{
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
