From bf76b802a7b619369349ac95de1850ce89091e63 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 10 Mar 2012 16:24:13 +1100 Subject: Fixed the in-built Dolphin profiler. --- .../DolphinWX/Src/Debugger/CodeWindowFunctions.cpp | 45 ++++++++++++---------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp index a3dd9a9ab8..05915ecd20 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp @@ -187,35 +187,40 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) { - if (Core::GetState() == Core::CORE_RUN) { - event.Skip(); - return; - } switch (event.GetId()) { case IDM_PROFILEBLOCKS: - if (jit != NULL) jit->ClearCache(); + Core::SetState(Core::CORE_PAUSE); + if (jit != NULL) + jit->ClearCache(); Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS); + Core::SetState(Core::CORE_RUN); break; case IDM_WRITEPROFILE: - if (jit != NULL) - { - std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt"; - File::CreateFullPath(filename); - Profiler::WriteProfileResults(filename.c_str()); + if (Core::GetState() == Core::CORE_RUN) + Core::SetState(Core::CORE_PAUSE); - wxFileType* filetype = NULL; - if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt")))) + if (Core::GetState() == Core::CORE_PAUSE && PowerPC::GetMode() == PowerPC::MODE_JIT) + { + if (jit != NULL) { - // From extension failed, trying with MIME type now - if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType(_T("text/plain")))) - // MIME type failed, aborting mission - break; + std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt"; + File::CreateFullPath(filename); + Profiler::WriteProfileResults(filename.c_str()); + + wxFileType* filetype = NULL; + if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt")))) + { + // From extension failed, trying with MIME type now + if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType(_T("text/plain")))) + // MIME type failed, aborting mission + break; + } + wxString OpenCommand; + OpenCommand = filetype->GetOpenCommand(wxString::From8BitData(filename.c_str())); + if(!OpenCommand.IsEmpty()) + wxExecute(OpenCommand, wxEXEC_SYNC); } - wxString OpenCommand; - OpenCommand = filetype->GetOpenCommand(wxString::From8BitData(filename.c_str())); - if(!OpenCommand.IsEmpty()) - wxExecute(OpenCommand, wxEXEC_SYNC); } break; } -- cgit v1.2.3