From 34692ab826abc8f8faa61bdb2280b742424528f1 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 7 Dec 2013 15:14:29 -0500 Subject: Remove unnecessary Src/ folders --- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 544 +++++++++++++++++++++ 1 file changed, 544 insertions(+) create mode 100644 Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp new file mode 100644 index 0000000000..3582866c48 --- /dev/null +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -0,0 +1,544 @@ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#include "Common.h" +#include "CommonPaths.h" + +#include +#include + +#include "Host.h" + +#include "DebuggerUIUtil.h" + +#include "../WxUtils.h" +#include "RegisterWindow.h" +#include "BreakpointWindow.h" +#include "MemoryWindow.h" +#include "JitWindow.h" +#include "DebuggerPanel.h" +#include "DSPDebugWindow.h" +#include "FileUtil.h" + +#include "CodeWindow.h" +#include "CodeView.h" + +#include "Core.h" +#include "HLE/HLE.h" +#include "Boot/Boot.h" +#include "LogManager.h" +#include "HW/CPU.h" +#include "PowerPC/PowerPC.h" +#include "Debugger/PPCDebugInterface.h" +#include "Debugger/Debugger_SymbolMap.h" +#include "PowerPC/PPCAnalyst.h" +#include "PowerPC/Profiler.h" +#include "PowerPC/PPCSymbolDB.h" +#include "PowerPC/SignatureDB.h" +#include "PowerPC/PPCTables.h" +#include "PowerPC/JitCommon/JitBase.h" +#include "PowerPC/JitCommon/JitCache.h" // for ClearCache() + +#include "ConfigManager.h" + +// Save and load settings +// ----------------------------- +void CCodeWindow::Load() +{ + IniFile ini; + ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); + + // The font to override DebuggerFont with + std::string fontDesc; + ini.Get("General", "DebuggerFont", &fontDesc); + if (!fontDesc.empty()) + DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc)); + + // Boot to pause or not + ini.Get("General", "AutomaticStart", &bAutomaticStart, false); + ini.Get("General", "BootToPause", &bBootToPause, true); + + const char* SettingName[] = { + "Log", + "LogConfig", + "Console", + "Registers", + "Breakpoints", + "Memory", + "JIT", + "Sound", + "Video", + "Code" + }; + + // Decide what windows to show + for (int i = 0; i <= IDM_VIDEOWINDOW - IDM_LOGWINDOW; i++) + ini.Get("ShowOnStart", SettingName[i], &bShowOnStart[i], false); + + // Get notebook affiliation + std::string _Section = "P - " + + ((Parent->ActivePerspective < Parent->Perspectives.size()) + ? Parent->Perspectives[Parent->ActivePerspective].Name : "Perspective 1"); + + for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) + ini.Get(_Section.c_str(), SettingName[i], &iNbAffiliation[i], 0); + + // Get floating setting + for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) + ini.Get("Float", SettingName[i], &Parent->bFloatWindow[i], false); +} + +void CCodeWindow::Save() +{ + IniFile ini; + ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); + + ini.Set("General", "DebuggerFont", + WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc())); + + // Boot to pause or not + ini.Set("General", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); + ini.Set("General", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE)); + + const char* SettingName[] = { + "Log", + "LogConfig", + "Console", + "Registers", + "Breakpoints", + "Memory", + "JIT", + "Sound", + "Video", + "Code" + }; + + // Save windows settings + for (int i = IDM_LOGWINDOW; i <= IDM_VIDEOWINDOW; i++) + ini.Set("ShowOnStart", SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i)); + + // Save notebook affiliations + std::string _Section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name; + for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) + ini.Set(_Section.c_str(), SettingName[i], iNbAffiliation[i]); + + // Save floating setting + for (int i = IDM_LOGWINDOW_PARENT; i <= IDM_CODEWINDOW_PARENT; i++) + ini.Set("Float", SettingName[i - IDM_LOGWINDOW_PARENT], !!FindWindowById(i)); + + ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); +} + +// Symbols, JIT, Profiler +// ---------------- +void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) +{ + wxMenu *pSymbolsMenu = new wxMenu; + pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _("&Clear symbols")); + pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _("&Generate symbol map")); + pSymbolsMenu->AppendSeparator(); + pSymbolsMenu->Append(IDM_LOADMAPFILE, _("&Load symbol map")); + pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map")); + pSymbolsMenu->AppendSeparator(); + pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _("Save code"), + StrToWxStr("Save the entire disassembled code. This may take a several seconds" + " and may require between 50 and 100 MB of hard drive space. It will only save code" + " that are in the first 4 MB of memory, if you are debugging a game that load .rel" + " files with code to memory you may want to increase that to perhaps 8 MB, you can do" + " that from SymbolDB::SaveMap().") + ); + + pSymbolsMenu->AppendSeparator(); + pSymbolsMenu->Append(IDM_CREATESIGNATUREFILE, _("&Create signature file...")); + pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _("&Use signature file...")); + pSymbolsMenu->AppendSeparator(); + pSymbolsMenu->Append(IDM_PATCHHLEFUNCTIONS, _("&Patch HLE functions")); + pSymbolsMenu->Append(IDM_RENAME_SYMBOLS, _("&Rename symbols from file...")); + pMenuBar->Append(pSymbolsMenu, _("&Symbols")); + + wxMenu *pProfilerMenu = new wxMenu; + pProfilerMenu->Append(IDM_PROFILEBLOCKS, _("&Profile blocks"), wxEmptyString, wxITEM_CHECK); + pProfilerMenu->AppendSeparator(); + pProfilerMenu->Append(IDM_WRITEPROFILE, _("&Write to profile.txt, show")); + pMenuBar->Append(pProfilerMenu, _("&Profiler")); +} + +void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) +{ + switch (event.GetId()) + { + case IDM_PROFILEBLOCKS: + 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 (Core::GetState() == Core::CORE_RUN) + Core::SetState(Core::CORE_PAUSE); + + if (Core::GetState() == Core::CORE_PAUSE && PowerPC::GetMode() == PowerPC::MODE_JIT) + { + if (jit != NULL) + { + 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(StrToWxStr(filename)); + if(!OpenCommand.IsEmpty()) + wxExecute(OpenCommand, wxEXEC_SYNC); + } + } + break; + } +} + +void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) +{ + Parent->ClearStatusBar(); + + if (Core::GetState() == Core::CORE_UNINITIALIZED) return; + + std::string existing_map_file, writable_map_file; + bool map_exists = CBoot::FindMapFile(&existing_map_file, + &writable_map_file); + switch (event.GetId()) + { + case IDM_CLEARSYMBOLS: + if(!AskYesNo("Do you want to clear the list of symbol names?")) return; + g_symbolDB.Clear(); + Host_NotifyMapLoaded(); + break; + case IDM_SCANFUNCTIONS: + { + PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB); + SignatureDB db; + if (db.Load((File::GetSysDirectory() + TOTALDB).c_str())) + { + db.Apply(&g_symbolDB); + Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB); + } + else + { + Parent->StatusBarMessage("'%s' not found, no symbol names generated", TOTALDB); + } + // HLE::PatchFunctions(); + // Update GUI + NotifyMapLoaded(); + break; + } + case IDM_LOADMAPFILE: + if (!map_exists) + { + g_symbolDB.Clear(); + PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB); + SignatureDB db; + if (db.Load((File::GetSysDirectory() + TOTALDB).c_str())) + db.Apply(&g_symbolDB); + Parent->StatusBarMessage("'%s' not found, scanning for common functions instead", writable_map_file.c_str()); + } + else + { + g_symbolDB.LoadMap(existing_map_file.c_str()); + Parent->StatusBarMessage("Loaded symbols from '%s'", existing_map_file.c_str()); + } + HLE::PatchFunctions(); + NotifyMapLoaded(); + break; + case IDM_SAVEMAPFILE: + g_symbolDB.SaveMap(writable_map_file.c_str()); + break; + case IDM_SAVEMAPFILEWITHCODES: + g_symbolDB.SaveMap(writable_map_file.c_str(), true); + break; + + case IDM_RENAME_SYMBOLS: + { + const wxString path = wxFileSelector( + _("Apply signature file"), wxEmptyString, + wxEmptyString, wxEmptyString, + _T("Dolphin Symbol Rename File (*.sym)|*.sym"), + wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); + + if (!path.IsEmpty()) + { + std::ifstream f; + OpenFStream(f, WxStrToStr(path), std::ios_base::in); + + std::string line; + while (std::getline(f, line)) + { + if (line.length() < 12) + continue; + + u32 address, type; + std::string name; + + std::istringstream ss(line); + ss >> std::hex >> address >> std::dec >> type >> name; + + Symbol *symbol = g_symbolDB.GetSymbolFromAddr(address); + if (symbol) + symbol->name = line.substr(12); + } + + Host_NotifyMapLoaded(); + } + } + break; + + case IDM_CREATESIGNATUREFILE: + { + wxTextEntryDialog input_prefix( + this, + StrToWxStr("Only export symbols with prefix:\n(Blank for all symbols)"), + wxGetTextFromUserPromptStr, + wxEmptyString); + + if (input_prefix.ShowModal() == wxID_OK) + { + std::string prefix(WxStrToStr(input_prefix.GetValue())); + + wxString path = wxFileSelector( + _T("Save signature as"), wxEmptyString, wxEmptyString, wxEmptyString, + _T("Dolphin Signature File (*.dsy)|*.dsy;"), wxFD_SAVE, + this); + if (!path.IsEmpty()) + { + SignatureDB db; + db.Initialize(&g_symbolDB, prefix.c_str()); + db.Save(WxStrToStr(path).c_str()); + } + } + } + break; + case IDM_USESIGNATUREFILE: + { + wxString path = wxFileSelector( + _T("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString, + _T("Dolphin Signature File (*.dsy)|*.dsy;"), wxFD_OPEN | wxFD_FILE_MUST_EXIST, + this); + if (!path.IsEmpty()) + { + SignatureDB db; + db.Load(WxStrToStr(path).c_str()); + db.Apply(&g_symbolDB); + } + } + NotifyMapLoaded(); + break; + case IDM_PATCHHLEFUNCTIONS: + HLE::PatchFunctions(); + Update(); + break; + } +} + +void CCodeWindow::NotifyMapLoaded() +{ + if (!codeview) return; + + g_symbolDB.FillInCallers(); + //symbols->Show(false); // hide it for faster filling + symbols->Freeze(); // HyperIris: wx style fast filling + symbols->Clear(); + for (PPCSymbolDB::XFuncMap::iterator iter = g_symbolDB.GetIterator(); iter != g_symbolDB.End(); ++iter) + { + int idx = symbols->Append(StrToWxStr(iter->second.name)); + symbols->SetClientData(idx, (void*)&iter->second); + } + symbols->Thaw(); + //symbols->Show(true); + Update(); +} + +void CCodeWindow::OnSymbolListChange(wxCommandEvent& event) +{ + int index = symbols->GetSelection(); + if (index >= 0) { + Symbol* pSymbol = static_cast(symbols->GetClientData(index)); + if (pSymbol != NULL) + { + if(pSymbol->type == Symbol::SYMBOL_DATA) + { + if(m_MemoryWindow)// && m_MemoryWindow->IsVisible()) + m_MemoryWindow->JumpToAddress(pSymbol->address); + } + else + { + JumpToAddress(pSymbol->address); + } + } + } +} + +void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event) +{ +} + +// Change the global DebuggerFont +void CCodeWindow::OnChangeFont(wxCommandEvent& event) +{ + wxFontData data; + data.SetInitialFont(DebuggerFont); + + wxFontDialog dialog(this, data); + if ( dialog.ShowModal() == wxID_OK ) + DebuggerFont = dialog.GetFontData().GetChosenFont(); +} + +// Toggle windows + +void CCodeWindow::OpenPages() +{ + ToggleCodeWindow(true); + if (bShowOnStart[0]) + Parent->ToggleLogWindow(true); + if (bShowOnStart[IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW]) + Parent->ToggleLogConfigWindow(true); + if (bShowOnStart[IDM_CONSOLEWINDOW - IDM_LOGWINDOW]) + Parent->ToggleConsole(true); + if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW]) + ToggleRegisterWindow(true); + if (bShowOnStart[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]) + ToggleBreakPointWindow(true); + if (bShowOnStart[IDM_MEMORYWINDOW - IDM_LOGWINDOW]) + ToggleMemoryWindow(true); + if (bShowOnStart[IDM_JITWINDOW - IDM_LOGWINDOW]) + ToggleJitWindow(true); + if (bShowOnStart[IDM_SOUNDWINDOW - IDM_LOGWINDOW]) + ToggleSoundWindow(true); + if (bShowOnStart[IDM_VIDEOWINDOW - IDM_LOGWINDOW]) + ToggleVideoWindow(true); +} + +void CCodeWindow::ToggleCodeWindow(bool bShow) +{ + if (bShow) + Parent->DoAddPage(this, + iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW]); + else // Hide + Parent->DoRemovePage(this); +} + +void CCodeWindow::ToggleRegisterWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_REGISTERWINDOW)->Check(bShow); + if (bShow) + { + if (!m_RegisterWindow) + m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTERWINDOW); + Parent->DoAddPage(m_RegisterWindow, + iNbAffiliation[IDM_REGISTERWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_REGISTERWINDOW - IDM_LOGWINDOW]); + } + else // Close + { + Parent->DoRemovePage(m_RegisterWindow, false); + m_RegisterWindow = NULL; + } +} + +void CCodeWindow::ToggleBreakPointWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_BREAKPOINTWINDOW)->Check(bShow); + if (bShow) + { + if (!m_BreakpointWindow) + m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW); + Parent->DoAddPage(m_BreakpointWindow, + iNbAffiliation[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]); + } + else // Close + { + Parent->DoRemovePage(m_BreakpointWindow, false); + m_BreakpointWindow = NULL; + } +} + +void CCodeWindow::ToggleMemoryWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_MEMORYWINDOW)->Check(bShow); + if (bShow) + { + if (!m_MemoryWindow) + m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW); + Parent->DoAddPage(m_MemoryWindow, + iNbAffiliation[IDM_MEMORYWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_MEMORYWINDOW - IDM_LOGWINDOW]); + } + else // Close + { + Parent->DoRemovePage(m_MemoryWindow, false); + m_MemoryWindow = NULL; + } +} + +void CCodeWindow::ToggleJitWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_JITWINDOW)->Check(bShow); + if (bShow) + { + if (!m_JitWindow) + m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW); + Parent->DoAddPage(m_JitWindow, + iNbAffiliation[IDM_JITWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_JITWINDOW - IDM_LOGWINDOW]); + } + else // Close + { + Parent->DoRemovePage(m_JitWindow, false); + m_JitWindow = NULL; + } +} + + +void CCodeWindow::ToggleSoundWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(bShow); + if (bShow) + { + if (!m_SoundWindow) + m_SoundWindow = new DSPDebuggerLLE(Parent, IDM_SOUNDWINDOW); + Parent->DoAddPage(m_SoundWindow, + iNbAffiliation[IDM_SOUNDWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_SOUNDWINDOW - IDM_LOGWINDOW]); + } + else // Close + { + Parent->DoRemovePage(m_SoundWindow, false); + m_SoundWindow = NULL; + } +} + +void CCodeWindow::ToggleVideoWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_VIDEOWINDOW)->Check(bShow); + if (bShow) + { + if (!m_VideoWindow) + m_VideoWindow = new GFXDebuggerPanel(Parent, IDM_VIDEOWINDOW); + Parent->DoAddPage(m_VideoWindow, + iNbAffiliation[IDM_VIDEOWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_VIDEOWINDOW - IDM_LOGWINDOW]); + } + else // Close + { + Parent->DoRemovePage(m_VideoWindow, false); + m_VideoWindow = NULL; + } +} -- cgit v1.2.3 From 3fe05e0a9f6908c1cf9a3caad6bff1d8decf04a3 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Sat, 8 Feb 2014 18:50:37 +1300 Subject: Fix IniFile to use string& instead of char* Also removes .c_str() usages where found. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 3582866c48..4f8f71225c 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -82,7 +82,7 @@ void CCodeWindow::Load() ? Parent->Perspectives[Parent->ActivePerspective].Name : "Perspective 1"); for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) - ini.Get(_Section.c_str(), SettingName[i], &iNbAffiliation[i], 0); + ini.Get(_Section, SettingName[i], &iNbAffiliation[i], 0); // Get floating setting for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) @@ -121,7 +121,7 @@ void CCodeWindow::Save() // Save notebook affiliations std::string _Section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name; for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) - ini.Set(_Section.c_str(), SettingName[i], iNbAffiliation[i]); + ini.Set(_Section, SettingName[i], iNbAffiliation[i]); // Save floating setting for (int i = IDM_LOGWINDOW_PARENT; i <= IDM_CODEWINDOW_PARENT; i++) -- cgit v1.2.3 From 404624bf0b0125e5a408021c616ee9b9e2dde382 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Wed, 12 Feb 2014 16:00:34 +0100 Subject: Turn loops into range-based form and some things suggested by cppcheck and compiler warnings. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 4f8f71225c..be6d8e4c04 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -354,10 +354,10 @@ void CCodeWindow::NotifyMapLoaded() //symbols->Show(false); // hide it for faster filling symbols->Freeze(); // HyperIris: wx style fast filling symbols->Clear(); - for (PPCSymbolDB::XFuncMap::iterator iter = g_symbolDB.GetIterator(); iter != g_symbolDB.End(); ++iter) + for (const auto& symbol : g_symbolDB.Symbols()) { - int idx = symbols->Append(StrToWxStr(iter->second.name)); - symbols->SetClientData(idx, (void*)&iter->second); + int idx = symbols->Append(StrToWxStr(symbol.second.name)); + symbols->SetClientData(idx, (void*)&symbol.second); } symbols->Thaw(); //symbols->Show(true); -- cgit v1.2.3 From ca7bdf1d5d2534805738dd9a7e86cba732e981bc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 16 Feb 2014 00:52:20 -0500 Subject: Remove the embedded Console from the possible logging options. Note I do not mean the Logging window, but the console window. It's literally rarely, if at all used, and offers less advantages over the built-in logging window (ie. it breaks on different locales: http://i.imgur.com/Cs92tQE.png) This commit should remove all of the console logging. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index be6d8e4c04..c4233b02ce 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -408,8 +408,6 @@ void CCodeWindow::OpenPages() Parent->ToggleLogWindow(true); if (bShowOnStart[IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW]) Parent->ToggleLogConfigWindow(true); - if (bShowOnStart[IDM_CONSOLEWINDOW - IDM_LOGWINDOW]) - Parent->ToggleConsole(true); if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW]) ToggleRegisterWindow(true); if (bShowOnStart[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]) -- cgit v1.2.3 From 3fd87a7636ff434118a5d7f7334550be8db55c0b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 16 Feb 2014 23:51:41 -0500 Subject: Second and final pass of clearing out tabs. --- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 45 +++++++++++----------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index c4233b02ce..14a1e3e1e8 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -94,8 +94,7 @@ void CCodeWindow::Save() IniFile ini; ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); - ini.Set("General", "DebuggerFont", - WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc())); + ini.Set("General", "DebuggerFont", WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc())); // Boot to pause or not ini.Set("General", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); @@ -352,7 +351,7 @@ void CCodeWindow::NotifyMapLoaded() g_symbolDB.FillInCallers(); //symbols->Show(false); // hide it for faster filling - symbols->Freeze(); // HyperIris: wx style fast filling + symbols->Freeze(); // HyperIris: wx style fast filling symbols->Clear(); for (const auto& symbol : g_symbolDB.Symbols()) { @@ -426,8 +425,8 @@ void CCodeWindow::ToggleCodeWindow(bool bShow) { if (bShow) Parent->DoAddPage(this, - iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW]); else // Hide Parent->DoRemovePage(this); } @@ -438,10 +437,10 @@ void CCodeWindow::ToggleRegisterWindow(bool bShow) if (bShow) { if (!m_RegisterWindow) - m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTERWINDOW); + m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTERWINDOW); Parent->DoAddPage(m_RegisterWindow, - iNbAffiliation[IDM_REGISTERWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_REGISTERWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_REGISTERWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_REGISTERWINDOW - IDM_LOGWINDOW]); } else // Close { @@ -456,10 +455,10 @@ void CCodeWindow::ToggleBreakPointWindow(bool bShow) if (bShow) { if (!m_BreakpointWindow) - m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW); + m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW); Parent->DoAddPage(m_BreakpointWindow, - iNbAffiliation[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]); } else // Close { @@ -474,10 +473,10 @@ void CCodeWindow::ToggleMemoryWindow(bool bShow) if (bShow) { if (!m_MemoryWindow) - m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW); + m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW); Parent->DoAddPage(m_MemoryWindow, - iNbAffiliation[IDM_MEMORYWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_MEMORYWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_MEMORYWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_MEMORYWINDOW - IDM_LOGWINDOW]); } else // Close { @@ -492,10 +491,10 @@ void CCodeWindow::ToggleJitWindow(bool bShow) if (bShow) { if (!m_JitWindow) - m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW); + m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW); Parent->DoAddPage(m_JitWindow, - iNbAffiliation[IDM_JITWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_JITWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_JITWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_JITWINDOW - IDM_LOGWINDOW]); } else // Close { @@ -511,10 +510,10 @@ void CCodeWindow::ToggleSoundWindow(bool bShow) if (bShow) { if (!m_SoundWindow) - m_SoundWindow = new DSPDebuggerLLE(Parent, IDM_SOUNDWINDOW); + m_SoundWindow = new DSPDebuggerLLE(Parent, IDM_SOUNDWINDOW); Parent->DoAddPage(m_SoundWindow, - iNbAffiliation[IDM_SOUNDWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_SOUNDWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_SOUNDWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_SOUNDWINDOW - IDM_LOGWINDOW]); } else // Close { @@ -529,10 +528,10 @@ void CCodeWindow::ToggleVideoWindow(bool bShow) if (bShow) { if (!m_VideoWindow) - m_VideoWindow = new GFXDebuggerPanel(Parent, IDM_VIDEOWINDOW); + m_VideoWindow = new GFXDebuggerPanel(Parent, IDM_VIDEOWINDOW); Parent->DoAddPage(m_VideoWindow, - iNbAffiliation[IDM_VIDEOWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_VIDEOWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_VIDEOWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_VIDEOWINDOW - IDM_LOGWINDOW]); } else // Close { -- cgit v1.2.3 From 2afe2152712981e21d6bda6f029292ed2b1cf91e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 17 Feb 2014 05:18:15 -0500 Subject: Convert all includes to relative paths. --- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 69 +++++++++++----------- 1 file changed, 33 insertions(+), 36 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 14a1e3e1e8..c7c68458e3 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -2,45 +2,42 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include "Common.h" -#include "CommonPaths.h" - #include #include -#include "Host.h" - -#include "DebuggerUIUtil.h" - -#include "../WxUtils.h" -#include "RegisterWindow.h" -#include "BreakpointWindow.h" -#include "MemoryWindow.h" -#include "JitWindow.h" -#include "DebuggerPanel.h" -#include "DSPDebugWindow.h" -#include "FileUtil.h" - -#include "CodeWindow.h" -#include "CodeView.h" - -#include "Core.h" -#include "HLE/HLE.h" -#include "Boot/Boot.h" -#include "LogManager.h" -#include "HW/CPU.h" -#include "PowerPC/PowerPC.h" -#include "Debugger/PPCDebugInterface.h" -#include "Debugger/Debugger_SymbolMap.h" -#include "PowerPC/PPCAnalyst.h" -#include "PowerPC/Profiler.h" -#include "PowerPC/PPCSymbolDB.h" -#include "PowerPC/SignatureDB.h" -#include "PowerPC/PPCTables.h" -#include "PowerPC/JitCommon/JitBase.h" -#include "PowerPC/JitCommon/JitCache.h" // for ClearCache() - -#include "ConfigManager.h" +#include "Common/Common.h" +#include "Common/CommonPaths.h" +#include "Common/FileUtil.h" +#include "Common/LogManager.h" + +#include "Core/ConfigManager.h" +#include "Core/Core.h" +#include "Core/Host.h" +#include "Core/HLE/HLE.h" +#include "Core/Boot/Boot.h" +#include "Core/Debugger/PPCDebugInterface.h" +#include "Core/Debugger/Debugger_SymbolMap.h" +#include "Core/HW/CPU.h" +#include "Core/PowerPC/PowerPC.h" +#include "Core/PowerPC/PPCAnalyst.h" +#include "Core/PowerPC/PPCSymbolDB.h" +#include "Core/PowerPC/PPCTables.h" +#include "Core/PowerPC/Profiler.h" +#include "Core/PowerPC/SignatureDB.h" +#include "Core/PowerPC/JitCommon/JitBase.h" +#include "Core/PowerPC/JitCommon/JitCache.h" // for ClearCache() + +#include "DolphinWX/WxUtils.h" +#include "DolphinWX/Debugger/BreakpointWindow.h" +#include "DolphinWX/Debugger/CodeView.h" +#include "DolphinWX/Debugger/CodeWindow.h" +#include "DolphinWX/Debugger/DebuggerPanel.h" +#include "DolphinWX/Debugger/DebuggerUIUtil.h" +#include "DolphinWX/Debugger/DSPDebugWindow.h" +#include "DolphinWX/Debugger/JitWindow.h" +#include "DolphinWX/Debugger/MemoryWindow.h" +#include "DolphinWX/Debugger/RegisterWindow.h" + // Save and load settings // ----------------------------- -- cgit v1.2.3 From 592ebc5262f13bc587896e678d389fe831df9af7 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Wed, 19 Feb 2014 02:56:29 +0100 Subject: Fix more header sorting issues in DolphinWX/ (now check-includes clean). --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index c7c68458e3..0de5320038 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -13,10 +13,10 @@ #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/Host.h" -#include "Core/HLE/HLE.h" #include "Core/Boot/Boot.h" -#include "Core/Debugger/PPCDebugInterface.h" #include "Core/Debugger/Debugger_SymbolMap.h" +#include "Core/Debugger/PPCDebugInterface.h" +#include "Core/HLE/HLE.h" #include "Core/HW/CPU.h" #include "Core/PowerPC/PowerPC.h" #include "Core/PowerPC/PPCAnalyst.h" -- cgit v1.2.3 From f344a43657f609343fec125f374e014692e4ca6a Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sat, 22 Feb 2014 23:36:30 +0100 Subject: Make DolphinWX/ mostly IWYU clean. --- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 30 ++++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 0de5320038..d42d227c94 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -2,34 +2,48 @@ // Licensed under GPLv2 // Refer to the license.txt file included. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include +#include #include "Common/Common.h" #include "Common/CommonPaths.h" #include "Common/FileUtil.h" -#include "Common/LogManager.h" +#include "Common/IniFile.h" +#include "Common/SymbolDB.h" -#include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/Host.h" #include "Core/Boot/Boot.h" -#include "Core/Debugger/Debugger_SymbolMap.h" -#include "Core/Debugger/PPCDebugInterface.h" #include "Core/HLE/HLE.h" -#include "Core/HW/CPU.h" #include "Core/PowerPC/PowerPC.h" #include "Core/PowerPC/PPCAnalyst.h" #include "Core/PowerPC/PPCSymbolDB.h" -#include "Core/PowerPC/PPCTables.h" #include "Core/PowerPC/Profiler.h" #include "Core/PowerPC/SignatureDB.h" #include "Core/PowerPC/JitCommon/JitBase.h" -#include "Core/PowerPC/JitCommon/JitCache.h" // for ClearCache() +#include "DolphinWX/Frame.h" +#include "DolphinWX/Globals.h" #include "DolphinWX/WxUtils.h" #include "DolphinWX/Debugger/BreakpointWindow.h" -#include "DolphinWX/Debugger/CodeView.h" #include "DolphinWX/Debugger/CodeWindow.h" #include "DolphinWX/Debugger/DebuggerPanel.h" #include "DolphinWX/Debugger/DebuggerUIUtil.h" -- cgit v1.2.3 From 70f3a069f2b760b2add51046781be625bef758db Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 23 Feb 2014 07:33:03 +0100 Subject: Revert "Merge pull request #83 from lioncash/remove-console" This breaks Linux stdout logging. This reverts commit 7ac5b1f2f805b2bc553492606cf71b6609fa0ae7, reversing changes made to 9bc14012fccf92f38b7d270ec82f7dac522986c5. Revert "Merge pull request #77 from lioncash/remove-console" This reverts commit 9bc14012fccf92f38b7d270ec82f7dac522986c5, reversing changes made to b18a33377d7229a66226a524186d24c57f1d56aa. Conflicts: Source/Core/Common/LogManager.cpp Source/Core/DolphinWX/Frame.cpp Source/Core/DolphinWX/FrameAui.cpp Source/Core/DolphinWX/LogConfigWindow.cpp Source/Core/DolphinWX/LogWindow.cpp --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index d42d227c94..f7b6006534 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -418,6 +418,8 @@ void CCodeWindow::OpenPages() Parent->ToggleLogWindow(true); if (bShowOnStart[IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW]) Parent->ToggleLogConfigWindow(true); + if (bShowOnStart[IDM_CONSOLEWINDOW - IDM_LOGWINDOW]) + Parent->ToggleConsole(true); if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW]) ToggleRegisterWindow(true); if (bShowOnStart[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]) -- cgit v1.2.3 From 8d57f38be7af319cfecc450bd183d9c7932664c8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 23 Feb 2014 02:38:46 -0500 Subject: Purge wx elements of the console. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index f7b6006534..d42d227c94 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -418,8 +418,6 @@ void CCodeWindow::OpenPages() Parent->ToggleLogWindow(true); if (bShowOnStart[IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW]) Parent->ToggleLogConfigWindow(true); - if (bShowOnStart[IDM_CONSOLEWINDOW - IDM_LOGWINDOW]) - Parent->ToggleConsole(true); if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW]) ToggleRegisterWindow(true); if (bShowOnStart[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]) -- cgit v1.2.3 From d802d392811be44d34ae9cd23f616db93e54c50f Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 9 Mar 2014 21:14:26 +0100 Subject: clang-modernize -use-nullptr and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine --- .../Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index d42d227c94..1add1c9600 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -180,7 +180,7 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) { case IDM_PROFILEBLOCKS: Core::SetState(Core::CORE_PAUSE); - if (jit != NULL) + if (jit != nullptr) jit->ClearCache(); Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS); Core::SetState(Core::CORE_RUN); @@ -191,13 +191,13 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) if (Core::GetState() == Core::CORE_PAUSE && PowerPC::GetMode() == PowerPC::MODE_JIT) { - if (jit != NULL) + if (jit != nullptr) { std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt"; File::CreateFullPath(filename); Profiler::WriteProfileResults(filename.c_str()); - wxFileType* filetype = NULL; + wxFileType* filetype = nullptr; if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt")))) { // From extension failed, trying with MIME type now @@ -379,7 +379,7 @@ void CCodeWindow::OnSymbolListChange(wxCommandEvent& event) int index = symbols->GetSelection(); if (index >= 0) { Symbol* pSymbol = static_cast(symbols->GetClientData(index)); - if (pSymbol != NULL) + if (pSymbol != nullptr) { if(pSymbol->type == Symbol::SYMBOL_DATA) { @@ -456,7 +456,7 @@ void CCodeWindow::ToggleRegisterWindow(bool bShow) else // Close { Parent->DoRemovePage(m_RegisterWindow, false); - m_RegisterWindow = NULL; + m_RegisterWindow = nullptr; } } @@ -474,7 +474,7 @@ void CCodeWindow::ToggleBreakPointWindow(bool bShow) else // Close { Parent->DoRemovePage(m_BreakpointWindow, false); - m_BreakpointWindow = NULL; + m_BreakpointWindow = nullptr; } } @@ -492,7 +492,7 @@ void CCodeWindow::ToggleMemoryWindow(bool bShow) else // Close { Parent->DoRemovePage(m_MemoryWindow, false); - m_MemoryWindow = NULL; + m_MemoryWindow = nullptr; } } @@ -510,7 +510,7 @@ void CCodeWindow::ToggleJitWindow(bool bShow) else // Close { Parent->DoRemovePage(m_JitWindow, false); - m_JitWindow = NULL; + m_JitWindow = nullptr; } } @@ -529,7 +529,7 @@ void CCodeWindow::ToggleSoundWindow(bool bShow) else // Close { Parent->DoRemovePage(m_SoundWindow, false); - m_SoundWindow = NULL; + m_SoundWindow = nullptr; } } @@ -547,6 +547,6 @@ void CCodeWindow::ToggleVideoWindow(bool bShow) else // Close { Parent->DoRemovePage(m_VideoWindow, false); - m_VideoWindow = NULL; + m_VideoWindow = nullptr; } } -- cgit v1.2.3 From 31cfc73a09a8685cbab20502b4bc132e98e2feb5 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Tue, 11 Mar 2014 00:30:55 +1300 Subject: Fixes spacing for "for", "while", "switch" and "if" Also moved && and || to ends of lines instead of start. Fixed misc vertical alignments and some { needed newlining. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 1add1c9600..ef76d59424 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -207,7 +207,7 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) } wxString OpenCommand; OpenCommand = filetype->GetOpenCommand(StrToWxStr(filename)); - if(!OpenCommand.IsEmpty()) + if (!OpenCommand.IsEmpty()) wxExecute(OpenCommand, wxEXEC_SYNC); } } @@ -227,7 +227,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) switch (event.GetId()) { case IDM_CLEARSYMBOLS: - if(!AskYesNo("Do you want to clear the list of symbol names?")) return; + if (!AskYesNo("Do you want to clear the list of symbol names?")) return; g_symbolDB.Clear(); Host_NotifyMapLoaded(); break; @@ -381,9 +381,9 @@ void CCodeWindow::OnSymbolListChange(wxCommandEvent& event) Symbol* pSymbol = static_cast(symbols->GetClientData(index)); if (pSymbol != nullptr) { - if(pSymbol->type == Symbol::SYMBOL_DATA) + if (pSymbol->type == Symbol::SYMBOL_DATA) { - if(m_MemoryWindow)// && m_MemoryWindow->IsVisible()) + if (m_MemoryWindow)// && m_MemoryWindow->IsVisible()) m_MemoryWindow->JumpToAddress(pSymbol->address); } else -- cgit v1.2.3 From a82675b7d581421fa80d5d5c53253cf1d5c1a26d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 12 Mar 2014 15:33:41 -0400 Subject: Kill off some usages of c_str. Also changes some function params, but this is ok. Some simplifications were also able to be made (ie. killing off strcmps with ==, etc). --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index ef76d59424..698265613d 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -195,7 +195,7 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) { std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt"; File::CreateFullPath(filename); - Profiler::WriteProfileResults(filename.c_str()); + Profiler::WriteProfileResults(filename); wxFileType* filetype = nullptr; if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt")))) @@ -235,7 +235,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB); SignatureDB db; - if (db.Load((File::GetSysDirectory() + TOTALDB).c_str())) + if (db.Load(File::GetSysDirectory() + TOTALDB)) { db.Apply(&g_symbolDB); Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB); @@ -255,23 +255,23 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) g_symbolDB.Clear(); PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB); SignatureDB db; - if (db.Load((File::GetSysDirectory() + TOTALDB).c_str())) + if (db.Load(File::GetSysDirectory() + TOTALDB)) db.Apply(&g_symbolDB); Parent->StatusBarMessage("'%s' not found, scanning for common functions instead", writable_map_file.c_str()); } else { - g_symbolDB.LoadMap(existing_map_file.c_str()); + g_symbolDB.LoadMap(existing_map_file); Parent->StatusBarMessage("Loaded symbols from '%s'", existing_map_file.c_str()); } HLE::PatchFunctions(); NotifyMapLoaded(); break; case IDM_SAVEMAPFILE: - g_symbolDB.SaveMap(writable_map_file.c_str()); + g_symbolDB.SaveMap(writable_map_file); break; case IDM_SAVEMAPFILEWITHCODES: - g_symbolDB.SaveMap(writable_map_file.c_str(), true); + g_symbolDB.SaveMap(writable_map_file, true); break; case IDM_RENAME_SYMBOLS: @@ -328,8 +328,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { SignatureDB db; - db.Initialize(&g_symbolDB, prefix.c_str()); - db.Save(WxStrToStr(path).c_str()); + db.Initialize(&g_symbolDB, prefix); + db.Save(WxStrToStr(path)); } } } @@ -343,7 +343,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { SignatureDB db; - db.Load(WxStrToStr(path).c_str()); + db.Load(WxStrToStr(path)); db.Apply(&g_symbolDB); } } -- cgit v1.2.3 From e1359382be30bb8f61a779846c9ebc1fa72791d0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 17 May 2014 13:17:28 -0400 Subject: Kill off _T and wxT macros Minor other alterations that relate to above as well. Also added the PanicAlertT version of alerts for some error messages that use PanicAlert. We want the user to actually understand why the error occurred. --- .../Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 698265613d..1236dd84fe 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -152,7 +152,7 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map")); pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _("Save code"), - StrToWxStr("Save the entire disassembled code. This may take a several seconds" + _("Save the entire disassembled code. This may take a several seconds" " and may require between 50 and 100 MB of hard drive space. It will only save code" " that are in the first 4 MB of memory, if you are debugging a game that load .rel" " files with code to memory you may want to increase that to perhaps 8 MB, you can do" @@ -198,10 +198,10 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) Profiler::WriteProfileResults(filename); wxFileType* filetype = nullptr; - if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt")))) + if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension("txt"))) { // From extension failed, trying with MIME type now - if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType(_T("text/plain")))) + if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType("text/plain"))) // MIME type failed, aborting mission break; } @@ -227,7 +227,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) switch (event.GetId()) { case IDM_CLEARSYMBOLS: - if (!AskYesNo("Do you want to clear the list of symbol names?")) return; + if (!AskYesNoT("Do you want to clear the list of symbol names?")) return; g_symbolDB.Clear(); Host_NotifyMapLoaded(); break; @@ -279,7 +279,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) const wxString path = wxFileSelector( _("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString, - _T("Dolphin Symbol Rename File (*.sym)|*.sym"), + "Dolphin Symbol Rename File (*.sym)|*.sym", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); if (!path.IsEmpty()) @@ -313,7 +313,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { wxTextEntryDialog input_prefix( this, - StrToWxStr("Only export symbols with prefix:\n(Blank for all symbols)"), + _("Only export symbols with prefix:\n(Blank for all symbols)"), wxGetTextFromUserPromptStr, wxEmptyString); @@ -322,8 +322,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) std::string prefix(WxStrToStr(input_prefix.GetValue())); wxString path = wxFileSelector( - _T("Save signature as"), wxEmptyString, wxEmptyString, wxEmptyString, - _T("Dolphin Signature File (*.dsy)|*.dsy;"), wxFD_SAVE, + _("Save signature as"), wxEmptyString, wxEmptyString, wxEmptyString, + "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE, this); if (!path.IsEmpty()) { @@ -337,8 +337,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) case IDM_USESIGNATUREFILE: { wxString path = wxFileSelector( - _T("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString, - _T("Dolphin Signature File (*.dsy)|*.dsy;"), wxFD_OPEN | wxFD_FILE_MUST_EXIST, + _("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString, + "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); if (!path.IsEmpty()) { -- cgit v1.2.3 From f05d3f6e5d6da8be530c0cd4ffaaec0382240ec5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 16 Jun 2014 01:12:43 -0400 Subject: Use only section-based ini reading. --- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 1236dd84fe..41abb27300 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -62,14 +62,15 @@ void CCodeWindow::Load() // The font to override DebuggerFont with std::string fontDesc; - ini.Get("General", "DebuggerFont", &fontDesc); + + IniFile::Section* general = ini.GetOrCreateSection("General"); + general->Get("DebuggerFont", &fontDesc); + general->Get("AutomaticStart", &bAutomaticStart, false); + general->Get("BootToPause", &bBootToPause, true); + if (!fontDesc.empty()) DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc)); - // Boot to pause or not - ini.Get("General", "AutomaticStart", &bAutomaticStart, false); - ini.Get("General", "BootToPause", &bBootToPause, true); - const char* SettingName[] = { "Log", "LogConfig", @@ -85,19 +86,19 @@ void CCodeWindow::Load() // Decide what windows to show for (int i = 0; i <= IDM_VIDEOWINDOW - IDM_LOGWINDOW; i++) - ini.Get("ShowOnStart", SettingName[i], &bShowOnStart[i], false); + ini.GetOrCreateSection("ShowOnStart")->Get(SettingName[i], &bShowOnStart[i], false); // Get notebook affiliation - std::string _Section = "P - " + + std::string section = "P - " + ((Parent->ActivePerspective < Parent->Perspectives.size()) ? Parent->Perspectives[Parent->ActivePerspective].Name : "Perspective 1"); for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) - ini.Get(_Section, SettingName[i], &iNbAffiliation[i], 0); + ini.GetOrCreateSection(section)->Get(SettingName[i], &iNbAffiliation[i], 0); // Get floating setting for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) - ini.Get("Float", SettingName[i], &Parent->bFloatWindow[i], false); + ini.GetOrCreateSection("Float")->Get(SettingName[i], &Parent->bFloatWindow[i], false); } void CCodeWindow::Save() @@ -105,11 +106,10 @@ void CCodeWindow::Save() IniFile ini; ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); - ini.Set("General", "DebuggerFont", WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc())); - - // Boot to pause or not - ini.Set("General", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); - ini.Set("General", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE)); + IniFile::Section* general = ini.GetOrCreateSection("General"); + general->Set("DebuggerFont", WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc())); + general->Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); + general->Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE)); const char* SettingName[] = { "Log", @@ -126,16 +126,16 @@ void CCodeWindow::Save() // Save windows settings for (int i = IDM_LOGWINDOW; i <= IDM_VIDEOWINDOW; i++) - ini.Set("ShowOnStart", SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i)); + ini.GetOrCreateSection("ShowOnStart")->Set(SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i)); // Save notebook affiliations - std::string _Section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name; + std::string section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name; for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) - ini.Set(_Section, SettingName[i], iNbAffiliation[i]); + ini.GetOrCreateSection(section)->Set(SettingName[i], iNbAffiliation[i]); // Save floating setting for (int i = IDM_LOGWINDOW_PARENT; i <= IDM_CODEWINDOW_PARENT; i++) - ini.Set("Float", SettingName[i - IDM_LOGWINDOW_PARENT], !!FindWindowById(i)); + ini.GetOrCreateSection("Float")->Set(SettingName[i - IDM_LOGWINDOW_PARENT], !!FindWindowById(i)); ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); } -- cgit v1.2.3 From db7e746cb423de5ca47be7a3df7c4918a610ff5a Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Tue, 8 Jul 2014 00:47:57 +0200 Subject: Check whether the core is running instead of checking if it is unitialized. This properly handles the stopping state and more accurately represents the intended check. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 41abb27300..9f3c081c16 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -219,7 +219,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { Parent->ClearStatusBar(); - if (Core::GetState() == Core::CORE_UNINITIALIZED) return; + if (!Core::IsRunning()) return; std::string existing_map_file, writable_map_file; bool map_exists = CBoot::FindMapFile(&existing_map_file, -- cgit v1.2.3 From 8553b0f27b50ef6b78e043c349a0c3a983293d4b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 30 Aug 2014 17:01:19 -0400 Subject: DolphinWX: Clean up brace placements --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 9f3c081c16..a83413587d 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -377,7 +377,8 @@ void CCodeWindow::NotifyMapLoaded() void CCodeWindow::OnSymbolListChange(wxCommandEvent& event) { int index = symbols->GetSelection(); - if (index >= 0) { + if (index >= 0) + { Symbol* pSymbol = static_cast(symbols->GetClientData(index)); if (pSymbol != nullptr) { -- cgit v1.2.3 From fbc64984ca7de7db10b1a8a4f49002f260c93569 Mon Sep 17 00:00:00 2001 From: Rohit Nirmal Date: Sun, 7 Sep 2014 20:06:58 -0500 Subject: Include CommonTypes.h instead of Common.h. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index a83413587d..fbf5820c0a 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -23,8 +23,8 @@ #include #include -#include "Common/Common.h" #include "Common/CommonPaths.h" +#include "Common/CommonTypes.h" #include "Common/FileUtil.h" #include "Common/IniFile.h" #include "Common/SymbolDB.h" -- cgit v1.2.3 From 613cae613a8c2ac34dd823f875ac4a6a0059db38 Mon Sep 17 00:00:00 2001 From: skidau Date: Sun, 19 Oct 2014 21:45:40 +1100 Subject: Added a RAM Watch window to the debugger Conflicts: Source/Core/Core/HW/Memmap.cpp Source/Core/Core/HW/Memmap.h Source/Core/DolphinWX/Debugger/CodeWindow.h --- .../Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index fbf5820c0a..099d184bee 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -51,6 +51,7 @@ #include "DolphinWX/Debugger/JitWindow.h" #include "DolphinWX/Debugger/MemoryWindow.h" #include "DolphinWX/Debugger/RegisterWindow.h" +#include "DolphinWX/Debugger/WatchWindow.h" // Save and load settings @@ -421,6 +422,8 @@ void CCodeWindow::OpenPages() Parent->ToggleLogConfigWindow(true); if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW]) ToggleRegisterWindow(true); + if (bShowOnStart[IDM_WATCHWINDOW - IDM_LOGWINDOW]) + ToggleWatchWindow(true); if (bShowOnStart[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]) ToggleBreakPointWindow(true); if (bShowOnStart[IDM_MEMORYWINDOW - IDM_LOGWINDOW]) @@ -461,6 +464,24 @@ void CCodeWindow::ToggleRegisterWindow(bool bShow) } } +void CCodeWindow::ToggleWatchWindow(bool bShow) +{ + GetMenuBar()->FindItem(IDM_WATCHWINDOW)->Check(bShow); + if (bShow) + { + if (!m_WatchWindow) + m_WatchWindow = new CWatchWindow(Parent, IDM_WATCHWINDOW); + Parent->DoAddPage(m_WatchWindow, + iNbAffiliation[IDM_WATCHWINDOW - IDM_LOGWINDOW], + Parent->bFloatWindow[IDM_WATCHWINDOW - IDM_LOGWINDOW]); + } + else // Close + { + Parent->DoRemovePage(m_WatchWindow, false); + m_WatchWindow = nullptr; + } +} + void CCodeWindow::ToggleBreakPointWindow(bool bShow) { GetMenuBar()->FindItem(IDM_BREAKPOINTWINDOW)->Check(bShow); -- cgit v1.2.3 From f54d9e33c256560e0c06041cc2c480d6ada32c6e Mon Sep 17 00:00:00 2001 From: CarlKenner Date: Mon, 15 Dec 2014 08:47:36 +1030 Subject: Fix many bugs with the Symbols menu (when run with -d argument). The Symbols menu is now fully useable. --- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 125 +++++++++++++++++++-- 1 file changed, 114 insertions(+), 11 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 099d184bee..cba74774da 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -146,11 +146,19 @@ void CCodeWindow::Save() void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) { wxMenu *pSymbolsMenu = new wxMenu; - pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _("&Clear symbols")); - pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _("&Generate symbol map")); + pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _("&Clear symbols"), + _("Remove names from all functions and variables.")); + pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _("&Generate symbol map"), + _("Recognise standard functions from sys\\totaldb.dsy, and use generic zz_ names for other functions.")); pSymbolsMenu->AppendSeparator(); - pSymbolsMenu->Append(IDM_LOADMAPFILE, _("&Load symbol map")); - pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map")); + pSymbolsMenu->Append(IDM_LOADMAPFILE, _("&Load symbol map"), + _("Try to load this game's function names automatically - but doesn't check .map files stored on the disc image yet.")); + pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map"), + _("Save the function names for each address to a .map file in your user settings map folder, named after the title id.")); + pSymbolsMenu->Append(IDM_LOADMAPFILEAS, _("Choose symbol map file to load..."), + _("Load any .map file containing the function names and addresses for this game.")); + pSymbolsMenu->Append(IDM_SAVEMAPFILEAS, _("Save symbol map &as..."), + _("Save the function names and addresses for this game as a .map file. If you want to open it in IDA pro, use the .idc script.")); pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _("Save code"), _("Save the entire disassembled code. This may take a several seconds" @@ -161,8 +169,14 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) ); pSymbolsMenu->AppendSeparator(); - pSymbolsMenu->Append(IDM_CREATESIGNATUREFILE, _("&Create signature file...")); - pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _("&Use signature file...")); + pSymbolsMenu->Append(IDM_CREATESIGNATUREFILE, _("&Create signature file..."), + _("Create a .dsy file that can be used to recognise these same functions in other games.")); + pSymbolsMenu->Append(IDM_APPENDSIGNATUREFILE, _("Append to &existing signature file..."), + _("Add any named functions missing from a .dsy file, so it can also recognise these additional functions in other games.")); + pSymbolsMenu->Append(IDM_COMBINESIGNATUREFILES, _("Combine &2 signature files..."), + _("Make a new .dsy file which can recognise more functions, by combining two existing files. The first input file has priority.")); + pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _("&Use signature file..."), + _("Must use Generate symbol map first! Recognise names of any standard library functions used in multiple games, by loading them from a .dsy file.")); pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_PATCHHLEFUNCTIONS, _("&Patch HLE functions")); pSymbolsMenu->Append(IDM_RENAME_SYMBOLS, _("&Rename symbols from file...")); @@ -222,9 +236,10 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!Core::IsRunning()) return; - std::string existing_map_file, writable_map_file; + std::string existing_map_file, writable_map_file, title_id_str; bool map_exists = CBoot::FindMapFile(&existing_map_file, - &writable_map_file); + &writable_map_file, + &title_id_str); switch (event.GetId()) { case IDM_CLEARSYMBOLS: @@ -240,6 +255,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { db.Apply(&g_symbolDB); Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB); + db.List(); } else { @@ -268,9 +284,38 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) HLE::PatchFunctions(); NotifyMapLoaded(); break; + case IDM_LOADMAPFILEAS: + { + const wxString path = wxFileSelector( + _("Load map file"), File::GetUserPath(D_MAPS_IDX), + title_id_str + ".map", ".map", + "Dolphin Map File (*.map)|*.map|All files (*.*)|*.*", + wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); + + if (!path.IsEmpty()) + { + g_symbolDB.LoadMap(WxStrToStr(path)); + Parent->StatusBarMessage("Loaded symbols from '%s'", path.c_str()); + } + HLE::PatchFunctions(); + NotifyMapLoaded(); + } + break; case IDM_SAVEMAPFILE: g_symbolDB.SaveMap(writable_map_file); break; + case IDM_SAVEMAPFILEAS: + { + const wxString path = wxFileSelector( + _("Save map file as"), File::GetUserPath(D_MAPS_IDX), + title_id_str + ".map", ".map", + "Dolphin Map File (*.map)|*.map|All files (*.*)|*.*", + wxFD_SAVE | wxFD_OVERWRITE_PROMPT, this); + + if (!path.IsEmpty()) + g_symbolDB.SaveMap(WxStrToStr(path)); + } + break; case IDM_SAVEMAPFILEWITHCODES: g_symbolDB.SaveMap(writable_map_file, true); break; @@ -323,14 +368,43 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) std::string prefix(WxStrToStr(input_prefix.GetValue())); wxString path = wxFileSelector( - _("Save signature as"), wxEmptyString, wxEmptyString, wxEmptyString, + _("Save signature as"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, + "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE | wxFD_OVERWRITE_PROMPT, + this); + if (!path.IsEmpty()) + { + SignatureDB db; + db.Initialize(&g_symbolDB, prefix); + db.Save(WxStrToStr(path)); + db.List(); + } + } + } + break; + case IDM_APPENDSIGNATUREFILE: + { + wxTextEntryDialog input_prefix( + this, + _("Only export symbols with prefix:\n(Blank for all symbols)"), + wxGetTextFromUserPromptStr, + wxEmptyString); + + if (input_prefix.ShowModal() == wxID_OK) + { + std::string prefix(WxStrToStr(input_prefix.GetValue())); + + wxString path = wxFileSelector( + _("Append signature to"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE, this); if (!path.IsEmpty()) { SignatureDB db; db.Initialize(&g_symbolDB, prefix); + db.List(); + db.Load(WxStrToStr(path)); db.Save(WxStrToStr(path)); + db.List(); } } } @@ -338,7 +412,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) case IDM_USESIGNATUREFILE: { wxString path = wxFileSelector( - _("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString, + _("Apply signature file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); if (!path.IsEmpty()) @@ -346,9 +420,38 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) SignatureDB db; db.Load(WxStrToStr(path)); db.Apply(&g_symbolDB); + db.List(); + NotifyMapLoaded(); + } + } + break; + case IDM_COMBINESIGNATUREFILES: + { + wxString path1 = wxFileSelector( + _("Choose priority input file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, + "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST, + this); + if (!path1.IsEmpty()) + { + SignatureDB db; + wxString path2 = wxFileSelector( + _("Choose secondary input file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, + "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_OPEN | wxFD_FILE_MUST_EXIST, + this); + if (!path2.IsEmpty()) + { + db.Load(WxStrToStr(path2)); + db.Load(WxStrToStr(path1)); + + path2 = wxFileSelector( + _("Save combined output file as"), File::GetSysDirectory(), wxEmptyString, ".dsy", + "Dolphin Signature File (*.dsy)|*.dsy;", wxFD_SAVE | wxFD_OVERWRITE_PROMPT, + this); + db.Save(WxStrToStr(path2)); + db.List(); + } } } - NotifyMapLoaded(); break; case IDM_PATCHHLEFUNCTIONS: HLE::PatchFunctions(); -- cgit v1.2.3 From e246aaf419c34e23e6c37013e0b7ed7dbf11ba21 Mon Sep 17 00:00:00 2001 From: CarlKenner Date: Mon, 15 Dec 2014 10:13:45 +1030 Subject: Add "Load bad map file" option for map files on disc that don't quite match. Currently it is very simple and naive, but filters out most of the bad matches. --- .../Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index cba74774da..b19d26fb74 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -155,8 +155,11 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) _("Try to load this game's function names automatically - but doesn't check .map files stored on the disc image yet.")); pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map"), _("Save the function names for each address to a .map file in your user settings map folder, named after the title id.")); + pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_LOADMAPFILEAS, _("Choose symbol map file to load..."), _("Load any .map file containing the function names and addresses for this game.")); + pSymbolsMenu->Append(IDM_LOADBADMAPFILE, _("Load &bad map file..."), + _("Try to load a .map file that might be from a slightly different version.")); pSymbolsMenu->Append(IDM_SAVEMAPFILEAS, _("Save symbol map &as..."), _("Save the function names and addresses for this game as a .map file. If you want to open it in IDA pro, use the .idc script.")); pSymbolsMenu->AppendSeparator(); @@ -301,6 +304,23 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) NotifyMapLoaded(); } break; + case IDM_LOADBADMAPFILE: + { + const wxString path = wxFileSelector( + _("Load bad map file"), File::GetUserPath(D_MAPS_IDX), + title_id_str + ".map", ".map", + "Dolphin Map File (*.map)|*.map|All files (*.*)|*.*", + wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); + + if (!path.IsEmpty()) + { + g_symbolDB.LoadBadMap(WxStrToStr(path)); + Parent->StatusBarMessage("Loaded symbols from '%s'", path.c_str()); + } + HLE::PatchFunctions(); + NotifyMapLoaded(); + } + break; case IDM_SAVEMAPFILE: g_symbolDB.SaveMap(writable_map_file); break; -- cgit v1.2.3 From f95f43fdde1a0c8f5181c1359314253e973b43ea Mon Sep 17 00:00:00 2001 From: CarlKenner Date: Mon, 15 Dec 2014 11:34:18 +1030 Subject: Apparently c_str doesn't return a C str. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index b19d26fb74..2adbb32b66 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -298,7 +298,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { g_symbolDB.LoadMap(WxStrToStr(path)); - Parent->StatusBarMessage("Loaded symbols from '%s'", path.c_str()); + Parent->StatusBarMessage("Loaded symbols from '%s'", WxStrToStr(path).c_str()); } HLE::PatchFunctions(); NotifyMapLoaded(); @@ -315,7 +315,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { g_symbolDB.LoadBadMap(WxStrToStr(path)); - Parent->StatusBarMessage("Loaded symbols from '%s'", path.c_str()); + Parent->StatusBarMessage("Loaded symbols from '%s'", WxStrToStr(path).c_str()); } HLE::PatchFunctions(); NotifyMapLoaded(); -- cgit v1.2.3 From dfd915eb535276088f9d9f8681b196b37bd11229 Mon Sep 17 00:00:00 2001 From: CarlKenner Date: Mon, 15 Dec 2014 18:42:07 +1030 Subject: Merge bad map file loading into the original function. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 2adbb32b66..e5f91692ee 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -314,7 +314,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { - g_symbolDB.LoadBadMap(WxStrToStr(path)); + g_symbolDB.LoadMap(WxStrToStr(path), true); Parent->StatusBarMessage("Loaded symbols from '%s'", WxStrToStr(path).c_str()); } HLE::PatchFunctions(); -- cgit v1.2.3 From 6e7eb52211844727bdf9f665630273ea109a1589 Mon Sep 17 00:00:00 2001 From: CarlKenner Date: Wed, 17 Dec 2014 00:11:05 +1030 Subject: Rename menu items, stop using PanicAlertT, remove -d when running from visual studio. I accidentally committed my addition of the -d option that I used for testing, now it's fixed. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index e5f91692ee..1bf48b523e 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -156,7 +156,7 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map"), _("Save the function names for each address to a .map file in your user settings map folder, named after the title id.")); pSymbolsMenu->AppendSeparator(); - pSymbolsMenu->Append(IDM_LOADMAPFILEAS, _("Choose symbol map file to load..."), + pSymbolsMenu->Append(IDM_LOADMAPFILEAS, _("Load &other map file..."), _("Load any .map file containing the function names and addresses for this game.")); pSymbolsMenu->Append(IDM_LOADBADMAPFILE, _("Load &bad map file..."), _("Try to load a .map file that might be from a slightly different version.")); @@ -176,9 +176,9 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) _("Create a .dsy file that can be used to recognise these same functions in other games.")); pSymbolsMenu->Append(IDM_APPENDSIGNATUREFILE, _("Append to &existing signature file..."), _("Add any named functions missing from a .dsy file, so it can also recognise these additional functions in other games.")); - pSymbolsMenu->Append(IDM_COMBINESIGNATUREFILES, _("Combine &2 signature files..."), + pSymbolsMenu->Append(IDM_COMBINESIGNATUREFILES, _("Combine two signature files..."), _("Make a new .dsy file which can recognise more functions, by combining two existing files. The first input file has priority.")); - pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _("&Use signature file..."), + pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _("Apply signat&ure file..."), _("Must use Generate symbol map first! Recognise names of any standard library functions used in multiple games, by loading them from a .dsy file.")); pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_PATCHHLEFUNCTIONS, _("&Patch HLE functions")); -- cgit v1.2.3 From 6ad5e54970b7889b15991c15f6363fd965a3c826 Mon Sep 17 00:00:00 2001 From: Stevoisiak Date: Sat, 20 Dec 2014 20:36:26 -0500 Subject: DolphinWX/Globals: Variable naming consistency --- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 154 ++++++++++----------- 1 file changed, 77 insertions(+), 77 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 1bf48b523e..441c7688c5 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -86,7 +86,7 @@ void CCodeWindow::Load() }; // Decide what windows to show - for (int i = 0; i <= IDM_VIDEOWINDOW - IDM_LOGWINDOW; i++) + for (int i = 0; i <= IDM_VIDEO_WINDOW - IDM_LOG_WINDOW; i++) ini.GetOrCreateSection("ShowOnStart")->Get(SettingName[i], &bShowOnStart[i], false); // Get notebook affiliation @@ -94,11 +94,11 @@ void CCodeWindow::Load() ((Parent->ActivePerspective < Parent->Perspectives.size()) ? Parent->Perspectives[Parent->ActivePerspective].Name : "Perspective 1"); - for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) + for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++) ini.GetOrCreateSection(section)->Get(SettingName[i], &iNbAffiliation[i], 0); // Get floating setting - for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) + for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++) ini.GetOrCreateSection("Float")->Get(SettingName[i], &Parent->bFloatWindow[i], false); } @@ -109,8 +109,8 @@ void CCodeWindow::Save() IniFile::Section* general = ini.GetOrCreateSection("General"); general->Set("DebuggerFont", WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc())); - general->Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); - general->Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE)); + general->Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATIC_START)); + general->Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOT_TO_PAUSE)); const char* SettingName[] = { "Log", @@ -126,17 +126,17 @@ void CCodeWindow::Save() }; // Save windows settings - for (int i = IDM_LOGWINDOW; i <= IDM_VIDEOWINDOW; i++) - ini.GetOrCreateSection("ShowOnStart")->Set(SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i)); + for (int i = IDM_LOG_WINDOW; i <= IDM_VIDEO_WINDOW; i++) + ini.GetOrCreateSection("ShowOnStart")->Set(SettingName[i - IDM_LOG_WINDOW], GetMenuBar()->IsChecked(i)); // Save notebook affiliations std::string section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name; - for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) + for (int i = 0; i <= IDM_CODE_WINDOW - IDM_LOG_WINDOW; i++) ini.GetOrCreateSection(section)->Set(SettingName[i], iNbAffiliation[i]); // Save floating setting - for (int i = IDM_LOGWINDOW_PARENT; i <= IDM_CODEWINDOW_PARENT; i++) - ini.GetOrCreateSection("Float")->Set(SettingName[i - IDM_LOGWINDOW_PARENT], !!FindWindowById(i)); + for (int i = IDM_LOG_WINDOW_PARENT; i <= IDM_CODE_WINDOW_PARENT; i++) + ini.GetOrCreateSection("Float")->Set(SettingName[i - IDM_LOG_WINDOW_PARENT], !!FindWindowById(i)); ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); } @@ -146,24 +146,24 @@ void CCodeWindow::Save() void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) { wxMenu *pSymbolsMenu = new wxMenu; - pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _("&Clear symbols"), + pSymbolsMenu->Append(IDM_CLEAR_SYMBOLS, _("&Clear symbols"), _("Remove names from all functions and variables.")); - pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _("&Generate symbol map"), + pSymbolsMenu->Append(IDM_SCAN_FUNCTIONS, _("&Generate symbol map"), _("Recognise standard functions from sys\\totaldb.dsy, and use generic zz_ names for other functions.")); pSymbolsMenu->AppendSeparator(); - pSymbolsMenu->Append(IDM_LOADMAPFILE, _("&Load symbol map"), + pSymbolsMenu->Append(IDM_LOAD_MAP_FILE, _("&Load symbol map"), _("Try to load this game's function names automatically - but doesn't check .map files stored on the disc image yet.")); pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map"), _("Save the function names for each address to a .map file in your user settings map folder, named after the title id.")); pSymbolsMenu->AppendSeparator(); - pSymbolsMenu->Append(IDM_LOADMAPFILEAS, _("Load &other map file..."), + pSymbolsMenu->Append(IDM_LOAD_MAP_FILE_AS, _("Load &other map file..."), _("Load any .map file containing the function names and addresses for this game.")); - pSymbolsMenu->Append(IDM_LOADBADMAPFILE, _("Load &bad map file..."), + pSymbolsMenu->Append(IDM_LOAD_BAD_MAP_FILE, _("Load &bad map file..."), _("Try to load a .map file that might be from a slightly different version.")); - pSymbolsMenu->Append(IDM_SAVEMAPFILEAS, _("Save symbol map &as..."), + pSymbolsMenu->Append(IDM_SAVE_MAP_FILE_AS, _("Save symbol map &as..."), _("Save the function names and addresses for this game as a .map file. If you want to open it in IDA pro, use the .idc script.")); pSymbolsMenu->AppendSeparator(); - pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _("Save code"), + pSymbolsMenu->Append(IDM_SAVE_MAP_FILE_WITH_CODES, _("Save code"), _("Save the entire disassembled code. This may take a several seconds" " and may require between 50 and 100 MB of hard drive space. It will only save code" " that are in the first 4 MB of memory, if you are debugging a game that load .rel" @@ -172,23 +172,23 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) ); pSymbolsMenu->AppendSeparator(); - pSymbolsMenu->Append(IDM_CREATESIGNATUREFILE, _("&Create signature file..."), + pSymbolsMenu->Append(IDM_CREATE_SIGNATURE_FILE, _("&Create signature file..."), _("Create a .dsy file that can be used to recognise these same functions in other games.")); - pSymbolsMenu->Append(IDM_APPENDSIGNATUREFILE, _("Append to &existing signature file..."), + pSymbolsMenu->Append(IDM_APPEND_SIGNATURE_FILE, _("Append to &existing signature file..."), _("Add any named functions missing from a .dsy file, so it can also recognise these additional functions in other games.")); - pSymbolsMenu->Append(IDM_COMBINESIGNATUREFILES, _("Combine two signature files..."), + pSymbolsMenu->Append(IDM_COMBINE_SIGNATURE_FILES, _("Combine two signature files..."), _("Make a new .dsy file which can recognise more functions, by combining two existing files. The first input file has priority.")); - pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _("Apply signat&ure file..."), + pSymbolsMenu->Append(IDM_USE_SIGNATURE_FILE, _("Apply signat&ure file..."), _("Must use Generate symbol map first! Recognise names of any standard library functions used in multiple games, by loading them from a .dsy file.")); pSymbolsMenu->AppendSeparator(); - pSymbolsMenu->Append(IDM_PATCHHLEFUNCTIONS, _("&Patch HLE functions")); + pSymbolsMenu->Append(IDM_PATCH_HLE_FUNCTIONS, _("&Patch HLE functions")); pSymbolsMenu->Append(IDM_RENAME_SYMBOLS, _("&Rename symbols from file...")); pMenuBar->Append(pSymbolsMenu, _("&Symbols")); wxMenu *pProfilerMenu = new wxMenu; - pProfilerMenu->Append(IDM_PROFILEBLOCKS, _("&Profile blocks"), wxEmptyString, wxITEM_CHECK); + pProfilerMenu->Append(IDM_PROFILE_BLOCKS, _("&Profile blocks"), wxEmptyString, wxITEM_CHECK); pProfilerMenu->AppendSeparator(); - pProfilerMenu->Append(IDM_WRITEPROFILE, _("&Write to profile.txt, show")); + pProfilerMenu->Append(IDM_WRITE_PROFILE, _("&Write to profile.txt, show")); pMenuBar->Append(pProfilerMenu, _("&Profiler")); } @@ -196,14 +196,14 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) { switch (event.GetId()) { - case IDM_PROFILEBLOCKS: + case IDM_PROFILE_BLOCKS: Core::SetState(Core::CORE_PAUSE); if (jit != nullptr) jit->ClearCache(); - Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS); + Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILE_BLOCKS); Core::SetState(Core::CORE_RUN); break; - case IDM_WRITEPROFILE: + case IDM_WRITE_PROFILE: if (Core::GetState() == Core::CORE_RUN) Core::SetState(Core::CORE_PAUSE); @@ -245,12 +245,12 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) &title_id_str); switch (event.GetId()) { - case IDM_CLEARSYMBOLS: + case IDM_CLEAR_SYMBOLS: if (!AskYesNoT("Do you want to clear the list of symbol names?")) return; g_symbolDB.Clear(); Host_NotifyMapLoaded(); break; - case IDM_SCANFUNCTIONS: + case IDM_SCAN_FUNCTIONS: { PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB); SignatureDB db; @@ -269,7 +269,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) NotifyMapLoaded(); break; } - case IDM_LOADMAPFILE: + case IDM_LOAD_MAP_FILE: if (!map_exists) { g_symbolDB.Clear(); @@ -287,7 +287,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) HLE::PatchFunctions(); NotifyMapLoaded(); break; - case IDM_LOADMAPFILEAS: + case IDM_LOAD_MAP_FILE_AS: { const wxString path = wxFileSelector( _("Load map file"), File::GetUserPath(D_MAPS_IDX), @@ -304,7 +304,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) NotifyMapLoaded(); } break; - case IDM_LOADBADMAPFILE: + case IDM_LOAD_BAD_MAP_FILE: { const wxString path = wxFileSelector( _("Load bad map file"), File::GetUserPath(D_MAPS_IDX), @@ -324,7 +324,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) case IDM_SAVEMAPFILE: g_symbolDB.SaveMap(writable_map_file); break; - case IDM_SAVEMAPFILEAS: + case IDM_SAVE_MAP_FILE_AS: { const wxString path = wxFileSelector( _("Save map file as"), File::GetUserPath(D_MAPS_IDX), @@ -336,7 +336,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) g_symbolDB.SaveMap(WxStrToStr(path)); } break; - case IDM_SAVEMAPFILEWITHCODES: + case IDM_SAVE_MAP_FILE_WITH_CODES: g_symbolDB.SaveMap(writable_map_file, true); break; @@ -375,7 +375,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) } break; - case IDM_CREATESIGNATUREFILE: + case IDM_CREATE_SIGNATURE_FILE: { wxTextEntryDialog input_prefix( this, @@ -401,7 +401,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) } } break; - case IDM_APPENDSIGNATUREFILE: + case IDM_APPEND_SIGNATURE_FILE: { wxTextEntryDialog input_prefix( this, @@ -429,7 +429,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) } } break; - case IDM_USESIGNATUREFILE: + case IDM_USE_SIGNATURE_FILE: { wxString path = wxFileSelector( _("Apply signature file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, @@ -445,7 +445,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) } } break; - case IDM_COMBINESIGNATUREFILES: + case IDM_COMBINE_SIGNATURE_FILES: { wxString path1 = wxFileSelector( _("Choose priority input file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, @@ -473,7 +473,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) } } break; - case IDM_PATCHHLEFUNCTIONS: + case IDM_PATCH_HLE_FUNCTIONS: HLE::PatchFunctions(); Update(); break; @@ -541,21 +541,21 @@ void CCodeWindow::OpenPages() ToggleCodeWindow(true); if (bShowOnStart[0]) Parent->ToggleLogWindow(true); - if (bShowOnStart[IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW]) + if (bShowOnStart[IDM_LOG_CONFIG_WINDOW - IDM_LOG_WINDOW]) Parent->ToggleLogConfigWindow(true); - if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW]) + if (bShowOnStart[IDM_REGISTER_WINDOW - IDM_LOG_WINDOW]) ToggleRegisterWindow(true); - if (bShowOnStart[IDM_WATCHWINDOW - IDM_LOGWINDOW]) + if (bShowOnStart[IDM_WATCH_WINDOW - IDM_LOG_WINDOW]) ToggleWatchWindow(true); - if (bShowOnStart[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]) + if (bShowOnStart[IDM_BREAKPOINT_WINDOW - IDM_LOG_WINDOW]) ToggleBreakPointWindow(true); - if (bShowOnStart[IDM_MEMORYWINDOW - IDM_LOGWINDOW]) + if (bShowOnStart[IDM_MEMORY_WINDOW - IDM_LOG_WINDOW]) ToggleMemoryWindow(true); - if (bShowOnStart[IDM_JITWINDOW - IDM_LOGWINDOW]) + if (bShowOnStart[IDM_JIT_WINDOW - IDM_LOG_WINDOW]) ToggleJitWindow(true); - if (bShowOnStart[IDM_SOUNDWINDOW - IDM_LOGWINDOW]) + if (bShowOnStart[IDM_SOUND_WINDOW - IDM_LOG_WINDOW]) ToggleSoundWindow(true); - if (bShowOnStart[IDM_VIDEOWINDOW - IDM_LOGWINDOW]) + if (bShowOnStart[IDM_VIDEO_WINDOW - IDM_LOG_WINDOW]) ToggleVideoWindow(true); } @@ -563,22 +563,22 @@ void CCodeWindow::ToggleCodeWindow(bool bShow) { if (bShow) Parent->DoAddPage(this, - iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_CODE_WINDOW - IDM_LOG_WINDOW], + Parent->bFloatWindow[IDM_CODE_WINDOW - IDM_LOG_WINDOW]); else // Hide Parent->DoRemovePage(this); } void CCodeWindow::ToggleRegisterWindow(bool bShow) { - GetMenuBar()->FindItem(IDM_REGISTERWINDOW)->Check(bShow); + GetMenuBar()->FindItem(IDM_REGISTER_WINDOW)->Check(bShow); if (bShow) { if (!m_RegisterWindow) - m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTERWINDOW); + m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTER_WINDOW); Parent->DoAddPage(m_RegisterWindow, - iNbAffiliation[IDM_REGISTERWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_REGISTERWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_REGISTER_WINDOW - IDM_LOG_WINDOW], + Parent->bFloatWindow[IDM_REGISTER_WINDOW - IDM_LOG_WINDOW]); } else // Close { @@ -589,14 +589,14 @@ void CCodeWindow::ToggleRegisterWindow(bool bShow) void CCodeWindow::ToggleWatchWindow(bool bShow) { - GetMenuBar()->FindItem(IDM_WATCHWINDOW)->Check(bShow); + GetMenuBar()->FindItem(IDM_WATCH_WINDOW)->Check(bShow); if (bShow) { if (!m_WatchWindow) - m_WatchWindow = new CWatchWindow(Parent, IDM_WATCHWINDOW); + m_WatchWindow = new CWatchWindow(Parent, IDM_WATCH_WINDOW); Parent->DoAddPage(m_WatchWindow, - iNbAffiliation[IDM_WATCHWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_WATCHWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_WATCH_WINDOW - IDM_LOG_WINDOW], + Parent->bFloatWindow[IDM_WATCH_WINDOW - IDM_LOG_WINDOW]); } else // Close { @@ -607,14 +607,14 @@ void CCodeWindow::ToggleWatchWindow(bool bShow) void CCodeWindow::ToggleBreakPointWindow(bool bShow) { - GetMenuBar()->FindItem(IDM_BREAKPOINTWINDOW)->Check(bShow); + GetMenuBar()->FindItem(IDM_BREAKPOINT_WINDOW)->Check(bShow); if (bShow) { if (!m_BreakpointWindow) - m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW); + m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINT_WINDOW); Parent->DoAddPage(m_BreakpointWindow, - iNbAffiliation[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_BREAKPOINTWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_BREAKPOINT_WINDOW - IDM_LOG_WINDOW], + Parent->bFloatWindow[IDM_BREAKPOINT_WINDOW - IDM_LOG_WINDOW]); } else // Close { @@ -625,14 +625,14 @@ void CCodeWindow::ToggleBreakPointWindow(bool bShow) void CCodeWindow::ToggleMemoryWindow(bool bShow) { - GetMenuBar()->FindItem(IDM_MEMORYWINDOW)->Check(bShow); + GetMenuBar()->FindItem(IDM_MEMORY_WINDOW)->Check(bShow); if (bShow) { if (!m_MemoryWindow) - m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW); + m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORY_WINDOW); Parent->DoAddPage(m_MemoryWindow, - iNbAffiliation[IDM_MEMORYWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_MEMORYWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_MEMORY_WINDOW - IDM_LOG_WINDOW], + Parent->bFloatWindow[IDM_MEMORY_WINDOW - IDM_LOG_WINDOW]); } else // Close { @@ -643,14 +643,14 @@ void CCodeWindow::ToggleMemoryWindow(bool bShow) void CCodeWindow::ToggleJitWindow(bool bShow) { - GetMenuBar()->FindItem(IDM_JITWINDOW)->Check(bShow); + GetMenuBar()->FindItem(IDM_JIT_WINDOW)->Check(bShow); if (bShow) { if (!m_JitWindow) - m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW); + m_JitWindow = new CJitWindow(Parent, IDM_JIT_WINDOW); Parent->DoAddPage(m_JitWindow, - iNbAffiliation[IDM_JITWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_JITWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_JIT_WINDOW - IDM_LOG_WINDOW], + Parent->bFloatWindow[IDM_JIT_WINDOW - IDM_LOG_WINDOW]); } else // Close { @@ -662,14 +662,14 @@ void CCodeWindow::ToggleJitWindow(bool bShow) void CCodeWindow::ToggleSoundWindow(bool bShow) { - GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(bShow); + GetMenuBar()->FindItem(IDM_SOUND_WINDOW)->Check(bShow); if (bShow) { if (!m_SoundWindow) - m_SoundWindow = new DSPDebuggerLLE(Parent, IDM_SOUNDWINDOW); + m_SoundWindow = new DSPDebuggerLLE(Parent, IDM_SOUND_WINDOW); Parent->DoAddPage(m_SoundWindow, - iNbAffiliation[IDM_SOUNDWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_SOUNDWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_SOUND_WINDOW - IDM_LOG_WINDOW], + Parent->bFloatWindow[IDM_SOUND_WINDOW - IDM_LOG_WINDOW]); } else // Close { @@ -680,14 +680,14 @@ void CCodeWindow::ToggleSoundWindow(bool bShow) void CCodeWindow::ToggleVideoWindow(bool bShow) { - GetMenuBar()->FindItem(IDM_VIDEOWINDOW)->Check(bShow); + GetMenuBar()->FindItem(IDM_VIDEO_WINDOW)->Check(bShow); if (bShow) { if (!m_VideoWindow) - m_VideoWindow = new GFXDebuggerPanel(Parent, IDM_VIDEOWINDOW); + m_VideoWindow = new GFXDebuggerPanel(Parent, IDM_VIDEO_WINDOW); Parent->DoAddPage(m_VideoWindow, - iNbAffiliation[IDM_VIDEOWINDOW - IDM_LOGWINDOW], - Parent->bFloatWindow[IDM_VIDEOWINDOW - IDM_LOGWINDOW]); + iNbAffiliation[IDM_VIDEO_WINDOW - IDM_LOG_WINDOW], + Parent->bFloatWindow[IDM_VIDEO_WINDOW - IDM_LOG_WINDOW]); } else // Close { -- cgit v1.2.3 From a7e9aea7972c0a0af6fc7e9c4126ccda43118a0f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 8 May 2015 10:04:40 -0400 Subject: DolphinWX: Remove unnecessary includes --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 441c7688c5..93c82cc542 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -7,21 +7,14 @@ #include #include #include -#include -#include -#include #include #include #include #include #include #include -#include #include -#include #include -#include -#include #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" -- cgit v1.2.3 From cefcb0ace9d363b3679b4e93bcc9ec05f1e5f4f8 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 18 May 2015 01:08:10 +0200 Subject: Update license headers to GPLv2+ --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 93c82cc542..078cd3392b 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -1,5 +1,5 @@ // Copyright 2013 Dolphin Emulator Project -// Licensed under GPLv2 +// Licensed under GPLv2+ // Refer to the license.txt file included. #include -- cgit v1.2.3 From 30ebb2459eb97ba544547183854775df8460b475 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 24 May 2015 06:55:12 +0200 Subject: Set copyright year to when a file was created --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 078cd3392b..a6432edecb 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -1,4 +1,4 @@ -// Copyright 2013 Dolphin Emulator Project +// Copyright 2009 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. -- cgit v1.2.3