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 --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 660 ++++++++++++++++++++++++++ 1 file changed, 660 insertions(+) create mode 100644 Source/Core/DolphinWX/Debugger/CodeWindow.cpp (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp new file mode 100644 index 0000000000..2094455cec --- /dev/null +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -0,0 +1,660 @@ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +// Include +#include "Common.h" + +#include + +#include "Host.h" + +#include "RegisterWindow.h" +#include "BreakpointWindow.h" +#include "MemoryWindow.h" +#include "JitWindow.h" + +#include "CodeWindow.h" +#include "CodeView.h" + +#include "../WxUtils.h" +#include "FileUtil.h" +#include "Core.h" +#include "HW/Memmap.h" +#include "HLE/HLE.h" +#include "Boot/Boot.h" +#include "LogManager.h" +#include "HW/CPU.h" +#include "PowerPC/PowerPC.h" +#include "PowerPC/JitInterface.h" +#include "Debugger/PPCDebugInterface.h" +#include "Debugger/Debugger_SymbolMap.h" +#include "PowerPC/PPCAnalyst.h" +#include "PowerPC/PPCSymbolDB.h" +#include "PowerPC/SignatureDB.h" +#include "PowerPC/PPCTables.h" + +#include "ConfigManager.h" + +extern "C" // Bitmaps +{ + #include "../resources/toolbar_add_memorycheck.c" + #include "../resources/toolbar_add_breakpoint.c" +} + +// ------- +// Main + +BEGIN_EVENT_TABLE(CCodeWindow, wxPanel) + + // Menu bar + EVT_MENU_RANGE(IDM_INTERPRETER, IDM_JITSROFF, CCodeWindow::OnCPUMode) + EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont) + EVT_MENU_RANGE(IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu) + EVT_MENU_RANGE(IDM_CLEARSYMBOLS, IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu) + EVT_MENU_RANGE(IDM_PROFILEBLOCKS, IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu) + + // Toolbar + EVT_MENU_RANGE(IDM_STEP, IDM_GOTOPC, CCodeWindow::OnCodeStep) + EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange) + + // Other + EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange) + EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange) + EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange) + EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange) + + EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage) + +END_EVENT_TABLE() + +// Class +CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *parent, + wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) + : wxPanel((wxWindow*)parent, id, position, size, style, name) + , Parent(parent) + , m_RegisterWindow(NULL) + , m_BreakpointWindow(NULL) + , m_MemoryWindow(NULL) + , m_JitWindow(NULL) + , m_SoundWindow(NULL) + , m_VideoWindow(NULL) + , codeview(NULL) +{ + InitBitmaps(); + + wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL); + wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL); + + DebugInterface* di = &PowerPC::debug_interface; + + codeview = new CCodeView(di, &g_symbolDB, this, ID_CODEVIEW); + sizerBig->Add(sizerLeft, 2, wxEXPAND); + sizerBig->Add(codeview, 5, wxEXPAND); + + sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST, + wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); + sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST, + wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND); + sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition, + wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND); + sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition, + wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND); + + SetSizer(sizerBig); + + sizerLeft->Fit(this); + sizerBig->Fit(this); +} + +wxMenuBar *CCodeWindow::GetMenuBar() +{ + return Parent->GetMenuBar(); +} + +wxAuiToolBar *CCodeWindow::GetToolBar() +{ + return Parent->m_ToolBarDebug; +} + +// ---------- +// Events + +void CCodeWindow::OnHostMessage(wxCommandEvent& event) +{ + switch (event.GetId()) + { + case IDM_NOTIFYMAPLOADED: + NotifyMapLoaded(); + if (m_BreakpointWindow) m_BreakpointWindow->NotifyUpdate(); + break; + + case IDM_UPDATEDISASMDIALOG: + Update(); + if (codeview) codeview->Center(PC); + if (m_RegisterWindow) m_RegisterWindow->NotifyUpdate(); + break; + + case IDM_UPDATEBREAKPOINTS: + Update(); + if (m_BreakpointWindow) m_BreakpointWindow->NotifyUpdate(); + break; + } +} + +// The Play, Stop, Step, Skip, Go to PC and Show PC buttons go here +void CCodeWindow::OnCodeStep(wxCommandEvent& event) +{ + switch (event.GetId()) + { + case IDM_STEP: + SingleStep(); + break; + + case IDM_STEPOVER: + StepOver(); + break; + + case IDM_TOGGLE_BREAKPOINT: + ToggleBreakpoint(); + break; + + case IDM_SKIP: + PC += 4; + Update(); + break; + + case IDM_SETPC: + PC = codeview->GetSelection(); + Update(); + break; + + case IDM_GOTOPC: + JumpToAddress(PC); + break; + } + + UpdateButtonStates(); + // Update all toolbars in the aui manager + Parent->UpdateGUI(); +} + +void CCodeWindow::JumpToAddress(u32 _Address) +{ + codeview->Center(_Address); + UpdateLists(); +} + +void CCodeWindow::OnCodeViewChange(wxCommandEvent &event) +{ + UpdateLists(); +} + +void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) +{ + if (!GetToolBar()) return; + + wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX); + wxString txt = pAddrCtrl->GetValue(); + + std::string text(WxStrToStr(txt)); + text = StripSpaces(text); + if (text.size() == 8) + { + u32 addr; + sscanf(text.c_str(), "%08x", &addr); + JumpToAddress(addr); + } + + event.Skip(1); +} + +void CCodeWindow::OnCallstackListChange(wxCommandEvent& event) +{ + int index = callstack->GetSelection(); + if (index >= 0) + { + u32 address = (u32)(u64)(callstack->GetClientData(index)); + if (address) + JumpToAddress(address); + } +} + +void CCodeWindow::OnCallersListChange(wxCommandEvent& event) +{ + int index = callers->GetSelection(); + if (index >= 0) + { + u32 address = (u32)(u64)(callers->GetClientData(index)); + if (address) + JumpToAddress(address); + } +} + +void CCodeWindow::OnCallsListChange(wxCommandEvent& event) +{ + int index = calls->GetSelection(); + if (index >= 0) + { + u32 address = (u32)(u64)(calls->GetClientData(index)); + if (address) + JumpToAddress(address); + } +} + +void CCodeWindow::SingleStep() +{ + if (CCPU::IsStepping()) + { + JitInterface::InvalidateICache(PC, 4); + CCPU::StepOpcode(&sync_event); + wxThread::Sleep(20); + // need a short wait here + JumpToAddress(PC); + Update(); + Host_UpdateLogDisplay(); + } +} + +void CCodeWindow::StepOver() +{ + if (CCPU::IsStepping()) + { + UGeckoInstruction inst = Memory::Read_Instruction(PC); + if (inst.LK) + { + PowerPC::breakpoints.Add(PC + 4, true); + CCPU::EnableStepping(false); + JumpToAddress(PC); + Update(); + } + else + { + SingleStep(); + } + + UpdateButtonStates(); + // Update all toolbars in the aui manager + Parent->UpdateGUI(); + } +} + +void CCodeWindow::ToggleBreakpoint() +{ + if (CCPU::IsStepping()) + { + if (codeview) codeview->ToggleBreakpoint(codeview->GetSelection()); + Update(); + } +} + +void CCodeWindow::UpdateLists() +{ + callers->Clear(); + u32 addr = codeview->GetSelection(); + Symbol *symbol = g_symbolDB.GetSymbolFromAddr(addr); + if (!symbol) + return; + + for (auto& call : symbol->callers) + { + u32 caller_addr = call.callAddress; + Symbol *caller_symbol = g_symbolDB.GetSymbolFromAddr(caller_addr); + if (caller_symbol) + { + int idx = callers->Append(StrToWxStr(StringFromFormat + ("< %s (%08x)", caller_symbol->name.c_str(), caller_addr).c_str())); + callers->SetClientData(idx, (void*)(u64)caller_addr); + } + } + + calls->Clear(); + for (auto& call : symbol->calls) + { + u32 call_addr = call.function; + Symbol *call_symbol = g_symbolDB.GetSymbolFromAddr(call_addr); + if (call_symbol) + { + int idx = calls->Append(StrToWxStr(StringFromFormat + ("> %s (%08x)", call_symbol->name.c_str(), call_addr).c_str())); + calls->SetClientData(idx, (void*)(u64)call_addr); + } + } +} + +void CCodeWindow::UpdateCallstack() +{ + if (Core::GetState() == Core::CORE_STOPPING) return; + + callstack->Clear(); + + std::vector stack; + + bool ret = Dolphin_Debugger::GetCallstack(stack); + + for (auto& frame : stack) + { + int idx = callstack->Append(StrToWxStr(frame.Name)); + callstack->SetClientData(idx, (void*)(u64)frame.vAddress); + } + + if (!ret) + callstack->Append(StrToWxStr("invalid callstack")); +} + +// Create CPU Mode menus +void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar) +{ + // CPU Mode + wxMenu* pCoreMenu = new wxMenu; + + wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _("&Interpreter core"), + StrToWxStr("This is necessary to get break points" + " and stepping to work as explained in the Developer Documentation. But it can be very" + " slow, perhaps slower than 1 fps."), + wxITEM_CHECK); + interpreter->Check(_LocalCoreStartupParameter.iCPUCore == 0); + pCoreMenu->AppendSeparator(); + + pCoreMenu->Append(IDM_JITBLOCKLINKING, _("&JIT Block Linking off"), + _("Provide safer execution by not linking the JIT blocks."), + wxITEM_CHECK); + + pCoreMenu->Append(IDM_JITNOBLOCKCACHE, _("&Disable JIT Cache"), + _("Avoid any involuntary JIT cache clearing, this may prevent Zelda TP from crashing.\n[This option must be selected before a game is started.]"), + wxITEM_CHECK); + pCoreMenu->Append(IDM_CLEARCODECACHE, _("&Clear JIT cache")); + + pCoreMenu->AppendSeparator(); + pCoreMenu->Append(IDM_LOGINSTRUCTIONS, _("&Log JIT instruction coverage")); + pCoreMenu->Append(IDM_SEARCHINSTRUCTION, _("&Search for an op")); + + pCoreMenu->AppendSeparator(); + pCoreMenu->Append(IDM_JITOFF, _("&JIT off (JIT core)"), + _("Turn off all JIT functions, but still use the JIT core from Jit.cpp"), + wxITEM_CHECK); + pCoreMenu->Append(IDM_JITLSOFF, _("&JIT LoadStore off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITLSLBZXOFF, _(" &JIT LoadStore lbzx off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITLSLXZOFF, _(" &JIT LoadStore lXz off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITLSLWZOFF, _("&JIT LoadStore lwz off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITLSFOFF, _("&JIT LoadStore Floating off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITLSPOFF, _("&JIT LoadStore Paired off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITFPOFF, _("&JIT FloatingPoint off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITIOFF, _("&JIT Integer off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITPOFF, _("&JIT Paired off"), + wxEmptyString, wxITEM_CHECK); + pCoreMenu->Append(IDM_JITSROFF, _("&JIT SystemRegisters off"), + wxEmptyString, wxITEM_CHECK); + + pMenuBar->Append(pCoreMenu, _("&JIT")); + + + // Debug Menu + wxMenu* pDebugMenu = new wxMenu; + + pDebugMenu->Append(IDM_STEP, _("Step &Into\tF11")); + pDebugMenu->Append(IDM_STEPOVER, _("Step &Over\tF10")); + pDebugMenu->Append(IDM_TOGGLE_BREAKPOINT, _("Toggle &Breakpoint\tF9")); + + pMenuBar->Append(pDebugMenu, _("&Debug")); + + CreateMenuSymbols(pMenuBar); +} + +void CCodeWindow::CreateMenuOptions(wxMenu* pMenu) +{ + wxMenuItem* boottopause = pMenu->Append(IDM_BOOTTOPAUSE, _("Boot to pause"), + _("Start the game directly instead of booting to pause"), + wxITEM_CHECK); + boottopause->Check(bBootToPause); + + wxMenuItem* automaticstart = pMenu->Append(IDM_AUTOMATICSTART, _("&Automatic start"), + StrToWxStr( + "Automatically load the Default ISO when Dolphin starts, or the last game you loaded," + " if you have not given it an elf file with the --elf command line. [This can be" + " convenient if you are bug-testing with a certain game and want to rebuild" + " and retry it several times, either with changes to Dolphin or if you are" + " developing a homebrew game.]"), + wxITEM_CHECK); + automaticstart->Check(bAutomaticStart); + + pMenu->Append(IDM_FONTPICKER, _("&Font..."), wxEmptyString, wxITEM_NORMAL); +} + +// CPU Mode and JIT Menu +void CCodeWindow::OnCPUMode(wxCommandEvent& event) +{ + switch (event.GetId()) + { + case IDM_INTERPRETER: + PowerPC::SetMode(UseInterpreter() ? PowerPC::MODE_INTERPRETER : PowerPC::MODE_JIT); + break; + case IDM_BOOTTOPAUSE: + bBootToPause = !bBootToPause; + return; + case IDM_AUTOMATICSTART: + bAutomaticStart = !bAutomaticStart; + return; + case IDM_JITOFF: + Core::g_CoreStartupParameter.bJITOff = event.IsChecked(); + break; + case IDM_JITLSOFF: + Core::g_CoreStartupParameter.bJITLoadStoreOff = event.IsChecked(); + break; + case IDM_JITLSLXZOFF: + Core::g_CoreStartupParameter.bJITLoadStorelXzOff = event.IsChecked(); + break; + case IDM_JITLSLWZOFF: + Core::g_CoreStartupParameter.bJITLoadStorelwzOff = event.IsChecked(); + break; + case IDM_JITLSLBZXOFF: + Core::g_CoreStartupParameter.bJITLoadStorelbzxOff = event.IsChecked(); + break; + case IDM_JITLSFOFF: + Core::g_CoreStartupParameter.bJITLoadStoreFloatingOff = event.IsChecked(); + break; + case IDM_JITLSPOFF: + Core::g_CoreStartupParameter.bJITLoadStorePairedOff = event.IsChecked(); + break; + case IDM_JITFPOFF: + Core::g_CoreStartupParameter.bJITFloatingPointOff = event.IsChecked(); + break; + case IDM_JITIOFF: + Core::g_CoreStartupParameter.bJITIntegerOff = event.IsChecked(); + break; + case IDM_JITPOFF: + Core::g_CoreStartupParameter.bJITPairedOff = event.IsChecked(); + break; + case IDM_JITSROFF: + Core::g_CoreStartupParameter.bJITSystemRegistersOff = event.IsChecked(); + break; + } + + // Clear the JIT cache to enable these changes + JitInterface::ClearCache(); + + // Update + UpdateButtonStates(); +} + +void CCodeWindow::OnJitMenu(wxCommandEvent& event) +{ + switch (event.GetId()) + { + case IDM_LOGINSTRUCTIONS: + PPCTables::LogCompiledInstructions(); + break; + + case IDM_CLEARCODECACHE: + JitInterface::ClearCache(); + break; + + case IDM_SEARCHINSTRUCTION: + { + wxString str; + str = wxGetTextFromUser(_T(""), wxT("Op?"), wxEmptyString, this); + for (u32 addr = 0x80000000; addr < 0x80100000; addr += 4) + { + const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr)); + auto const wx_name = WxStrToStr(str); + if (name && (wx_name == name)) + { + NOTICE_LOG(POWERPC, "Found %s at %08x", wx_name.c_str(), addr); + } + } + break; + } + } +} + +// Shortcuts +bool CCodeWindow::UseInterpreter() +{ + return GetMenuBar()->IsChecked(IDM_INTERPRETER); +} + +bool CCodeWindow::BootToPause() +{ + return GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE); +} + +bool CCodeWindow::AutomaticStart() +{ + return GetMenuBar()->IsChecked(IDM_AUTOMATICSTART); +} + +bool CCodeWindow::JITNoBlockCache() +{ + return GetMenuBar()->IsChecked(IDM_JITNOBLOCKCACHE); +} + +bool CCodeWindow::JITBlockLinking() +{ + return GetMenuBar()->IsChecked(IDM_JITBLOCKLINKING); +} + +// Toolbar +void CCodeWindow::InitBitmaps() +{ + // load original size 48x48 + m_Bitmaps[Toolbar_Step] = wxGetBitmapFromMemory(toolbar_add_breakpoint_png); + m_Bitmaps[Toolbar_StepOver] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); + m_Bitmaps[Toolbar_Skip] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); + m_Bitmaps[Toolbar_GotoPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); + m_Bitmaps[Toolbar_SetPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); + + // scale to 24x24 for toolbar + for (auto& bitmap : m_Bitmaps) + bitmap = wxBitmap(bitmap.ConvertToImage().Scale(24, 24)); +} + +void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar) +{ + int w = m_Bitmaps[0].GetWidth(), + h = m_Bitmaps[0].GetHeight(); + + toolBar->SetToolBitmapSize(wxSize(w, h)); + toolBar->AddTool(IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step]); + toolBar->AddTool(IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver]); + toolBar->AddTool(IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip]); + toolBar->AddSeparator(); + toolBar->AddTool(IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC]); + toolBar->AddTool(IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC]); + toolBar->AddSeparator(); + toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, _T(""))); + + toolBar->Realize(); +} + +// Update GUI +void CCodeWindow::Update() +{ + if (!codeview) return; + + codeview->Refresh(); + UpdateCallstack(); + UpdateButtonStates(); + + // Do not automatically show the current PC position when a breakpoint is hit or + // when we pause since this can be called at other times too. + //codeview->Center(PC); +} + +void CCodeWindow::UpdateButtonStates() +{ + bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED); + bool Pause = (Core::GetState() == Core::CORE_PAUSE); + bool Stepping = CCPU::IsStepping(); + wxAuiToolBar* ToolBar = GetToolBar(); + + // Toolbar + if (!ToolBar) return; + + if (!Initialized) + { + ToolBar->EnableTool(IDM_STEPOVER, false); + ToolBar->EnableTool(IDM_SKIP, false); + } + else + { + if (!Stepping) + { + ToolBar->EnableTool(IDM_STEPOVER, false); + ToolBar->EnableTool(IDM_SKIP, false); + } + else + { + ToolBar->EnableTool(IDM_STEPOVER, true); + ToolBar->EnableTool(IDM_SKIP, true); + } + } + + ToolBar->EnableTool(IDM_STEP, Initialized && Stepping); + + if (ToolBar) ToolBar->Realize(); + + // Menu bar + // ------------------ + GetMenuBar()->Enable(IDM_INTERPRETER, Pause); // CPU Mode + + GetMenuBar()->Enable(IDM_JITNOBLOCKCACHE, !Initialized); + + GetMenuBar()->Enable(IDM_JITOFF, Pause); + GetMenuBar()->Enable(IDM_JITLSOFF, Pause); + GetMenuBar()->Enable(IDM_JITLSLXZOFF, Pause); + GetMenuBar()->Enable(IDM_JITLSLWZOFF, Pause); + GetMenuBar()->Enable(IDM_JITLSLBZXOFF, Pause); + GetMenuBar()->Enable(IDM_JITLSFOFF, Pause); + GetMenuBar()->Enable(IDM_JITLSPOFF, Pause); + GetMenuBar()->Enable(IDM_JITFPOFF, Pause); + GetMenuBar()->Enable(IDM_JITIOFF, Pause); + GetMenuBar()->Enable(IDM_JITPOFF, Pause); + GetMenuBar()->Enable(IDM_JITSROFF, Pause); + + GetMenuBar()->Enable(IDM_CLEARCODECACHE, Pause); // JIT Menu + GetMenuBar()->Enable(IDM_SEARCHINSTRUCTION, Initialized); + + GetMenuBar()->Enable(IDM_CLEARSYMBOLS, Initialized); // Symbols menu + GetMenuBar()->Enable(IDM_SCANFUNCTIONS, Initialized); + GetMenuBar()->Enable(IDM_LOADMAPFILE, Initialized); + GetMenuBar()->Enable(IDM_SAVEMAPFILE, Initialized); + GetMenuBar()->Enable(IDM_SAVEMAPFILEWITHCODES, Initialized); + GetMenuBar()->Enable(IDM_CREATESIGNATUREFILE, Initialized); + GetMenuBar()->Enable(IDM_RENAME_SYMBOLS, Initialized); + GetMenuBar()->Enable(IDM_USESIGNATUREFILE, Initialized); + GetMenuBar()->Enable(IDM_PATCHHLEFUNCTIONS, Initialized); + + // Update Fonts + callstack->SetFont(DebuggerFont); + symbols->SetFont(DebuggerFont); + callers->SetFont(DebuggerFont); + calls->SetFont(DebuggerFont); +} -- 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. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 2094455cec..1720dcb887 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -59,12 +59,12 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxPanel) EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange) // Other - EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange) - EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange) - EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange) - EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange) + EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange) + EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange) + EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange) + EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange) - EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage) + EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage) END_EVENT_TABLE() @@ -562,12 +562,12 @@ void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar) h = m_Bitmaps[0].GetHeight(); toolBar->SetToolBitmapSize(wxSize(w, h)); - toolBar->AddTool(IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step]); - toolBar->AddTool(IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver]); - toolBar->AddTool(IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip]); + toolBar->AddTool(IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step]); + toolBar->AddTool(IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver]); + toolBar->AddTool(IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip]); toolBar->AddSeparator(); - toolBar->AddTool(IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC]); - toolBar->AddTool(IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC]); + toolBar->AddTool(IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC]); + toolBar->AddTool(IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC]); toolBar->AddSeparator(); toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, _T(""))); -- 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. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 61 ++++++++++++--------------- 1 file changed, 28 insertions(+), 33 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 1720dcb887..83bcce660f 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -2,44 +2,39 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -// Include -#include "Common.h" - #include -#include "Host.h" - -#include "RegisterWindow.h" -#include "BreakpointWindow.h" -#include "MemoryWindow.h" -#include "JitWindow.h" - -#include "CodeWindow.h" -#include "CodeView.h" - -#include "../WxUtils.h" -#include "FileUtil.h" -#include "Core.h" -#include "HW/Memmap.h" -#include "HLE/HLE.h" -#include "Boot/Boot.h" -#include "LogManager.h" -#include "HW/CPU.h" -#include "PowerPC/PowerPC.h" -#include "PowerPC/JitInterface.h" -#include "Debugger/PPCDebugInterface.h" -#include "Debugger/Debugger_SymbolMap.h" -#include "PowerPC/PPCAnalyst.h" -#include "PowerPC/PPCSymbolDB.h" -#include "PowerPC/SignatureDB.h" -#include "PowerPC/PPCTables.h" - -#include "ConfigManager.h" +#include "Common/Common.h" +#include "Common/FileUtil.h" +#include "Common/LogManager.h" +#include "Core/Core.h" +#include "Core/Host.h" +#include "Core/Boot/Boot.h" +#include "Core/ConfigManager.h" +#include "Core/Debugger/PPCDebugInterface.h" +#include "Core/Debugger/Debugger_SymbolMap.h" +#include "Core/HLE/HLE.h" +#include "Core/HW/CPU.h" +#include "Core/HW/Memmap.h" +#include "Core/PowerPC/JitInterface.h" +#include "Core/PowerPC/PowerPC.h" +#include "Core/PowerPC/PPCAnalyst.h" +#include "Core/PowerPC/PPCSymbolDB.h" +#include "Core/PowerPC/PPCTables.h" +#include "Core/PowerPC/SignatureDB.h" +#include "DolphinWX/Debugger/BreakpointWindow.h" +#include "DolphinWX/Debugger/CodeView.h" +#include "DolphinWX/Debugger/CodeWindow.h" +#include "DolphinWX/Debugger/JitWindow.h" +#include "DolphinWX/Debugger/MemoryWindow.h" +#include "DolphinWX/Debugger/RegisterWindow.h" +#include "DolphinWX/WxUtils.h" + extern "C" // Bitmaps { - #include "../resources/toolbar_add_memorycheck.c" - #include "../resources/toolbar_add_breakpoint.c" + #include "DolphinWX/resources/toolbar_add_memorycheck.c" + #include "DolphinWX/resources/toolbar_add_breakpoint.c" } // ------- -- 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/CodeWindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 83bcce660f..8e58eaa152 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -7,12 +7,12 @@ #include "Common/Common.h" #include "Common/FileUtil.h" #include "Common/LogManager.h" +#include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/Host.h" #include "Core/Boot/Boot.h" -#include "Core/ConfigManager.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/HW/Memmap.h" @@ -22,19 +22,19 @@ #include "Core/PowerPC/PPCSymbolDB.h" #include "Core/PowerPC/PPCTables.h" #include "Core/PowerPC/SignatureDB.h" +#include "DolphinWX/WxUtils.h" #include "DolphinWX/Debugger/BreakpointWindow.h" #include "DolphinWX/Debugger/CodeView.h" #include "DolphinWX/Debugger/CodeWindow.h" #include "DolphinWX/Debugger/JitWindow.h" #include "DolphinWX/Debugger/MemoryWindow.h" #include "DolphinWX/Debugger/RegisterWindow.h" -#include "DolphinWX/WxUtils.h" extern "C" // Bitmaps { - #include "DolphinWX/resources/toolbar_add_memorycheck.c" - #include "DolphinWX/resources/toolbar_add_breakpoint.c" + #include "DolphinWX/resources/toolbar_add_memorycheck.c" // NOLINT + #include "DolphinWX/resources/toolbar_add_breakpoint.c" // NOLINT } // ------- -- 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. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 45 ++++++++++++++++++++------- 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 8e58eaa152..a5189fa3a3 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -2,41 +2,62 @@ // 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 +#include +#include + +#include "Common/BreakPoints.h" #include "Common/Common.h" -#include "Common/FileUtil.h" -#include "Common/LogManager.h" -#include "Core/ConfigManager.h" +#include "Common/StringUtil.h" +#include "Common/SymbolDB.h" #include "Core/Core.h" +#include "Core/CoreParameter.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/HW/Memmap.h" +#include "Core/PowerPC/Gekko.h" #include "Core/PowerPC/JitInterface.h" #include "Core/PowerPC/PowerPC.h" -#include "Core/PowerPC/PPCAnalyst.h" #include "Core/PowerPC/PPCSymbolDB.h" #include "Core/PowerPC/PPCTables.h" -#include "Core/PowerPC/SignatureDB.h" +#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/JitWindow.h" -#include "DolphinWX/Debugger/MemoryWindow.h" +#include "DolphinWX/Debugger/DebuggerUIUtil.h" #include "DolphinWX/Debugger/RegisterWindow.h" - extern "C" // Bitmaps { #include "DolphinWX/resources/toolbar_add_memorycheck.c" // NOLINT #include "DolphinWX/resources/toolbar_add_breakpoint.c" // NOLINT } +class DebugInterface; + // ------- // Main -- 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 --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index a5189fa3a3..7f04c03d48 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -89,13 +89,13 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) : wxPanel((wxWindow*)parent, id, position, size, style, name) , Parent(parent) - , m_RegisterWindow(NULL) - , m_BreakpointWindow(NULL) - , m_MemoryWindow(NULL) - , m_JitWindow(NULL) - , m_SoundWindow(NULL) - , m_VideoWindow(NULL) - , codeview(NULL) + , m_RegisterWindow(nullptr) + , m_BreakpointWindow(nullptr) + , m_MemoryWindow(nullptr) + , m_JitWindow(nullptr) + , m_SoundWindow(nullptr) + , m_VideoWindow(nullptr) + , codeview(nullptr) { InitBitmaps(); @@ -111,11 +111,11 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST, - wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND); + wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND); sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition, - wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND); + wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition, - wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND); + wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); SetSizer(sizerBig); -- 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. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 7f04c03d48..f2aa617b7b 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -365,7 +365,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam wxMenu* pCoreMenu = new wxMenu; wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _("&Interpreter core"), - StrToWxStr("This is necessary to get break points" + _("This is necessary to get break points" " and stepping to work as explained in the Developer Documentation. But it can be very" " slow, perhaps slower than 1 fps."), wxITEM_CHECK); @@ -433,7 +433,7 @@ void CCodeWindow::CreateMenuOptions(wxMenu* pMenu) boottopause->Check(bBootToPause); wxMenuItem* automaticstart = pMenu->Append(IDM_AUTOMATICSTART, _("&Automatic start"), - StrToWxStr( + _( "Automatically load the Default ISO when Dolphin starts, or the last game you loaded," " if you have not given it an elf file with the --elf command line. [This can be" " convenient if you are bug-testing with a certain game and want to rebuild" @@ -442,7 +442,7 @@ void CCodeWindow::CreateMenuOptions(wxMenu* pMenu) wxITEM_CHECK); automaticstart->Check(bAutomaticStart); - pMenu->Append(IDM_FONTPICKER, _("&Font..."), wxEmptyString, wxITEM_NORMAL); + pMenu->Append(IDM_FONTPICKER, _("&Font...")); } // CPU Mode and JIT Menu @@ -515,8 +515,7 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event) case IDM_SEARCHINSTRUCTION: { - wxString str; - str = wxGetTextFromUser(_T(""), wxT("Op?"), wxEmptyString, this); + wxString str = wxGetTextFromUser("", _("Op?"), wxEmptyString, this); for (u32 addr = 0x80000000; addr < 0x80100000; addr += 4) { const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr)); @@ -585,7 +584,7 @@ void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar) toolBar->AddTool(IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC]); toolBar->AddTool(IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC]); toolBar->AddSeparator(); - toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, _T(""))); + toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, "")); toolBar->Realize(); } -- cgit v1.2.3 From 554207a87c2e47f61d584c55ca01be3a0424606f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 18 May 2014 11:43:17 -0400 Subject: Remove an unnecessary null check in CodeWindow.cpp. The validity of ToolBar is checked at the beginning of the function --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index f2aa617b7b..b8185a85cc 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -611,7 +611,8 @@ void CCodeWindow::UpdateButtonStates() wxAuiToolBar* ToolBar = GetToolBar(); // Toolbar - if (!ToolBar) return; + if (!ToolBar) + return; if (!Initialized) { @@ -633,8 +634,7 @@ void CCodeWindow::UpdateButtonStates() } ToolBar->EnableTool(IDM_STEP, Initialized && Stepping); - - if (ToolBar) ToolBar->Realize(); + ToolBar->Realize(); // Menu bar // ------------------ -- cgit v1.2.3 From 311e9e655a6816aa7f51e29f5a89e68d10096252 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 28 Apr 2014 21:00:35 +0200 Subject: CoreParameter: add enum CPUBackend --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index b8185a85cc..234f798aa5 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -369,7 +369,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam " and stepping to work as explained in the Developer Documentation. But it can be very" " slow, perhaps slower than 1 fps."), wxITEM_CHECK); - interpreter->Check(_LocalCoreStartupParameter.iCPUCore == 0); + interpreter->Check(_LocalCoreStartupParameter.iCPUCore == CPU_INTERPRETER); pCoreMenu->AppendSeparator(); pCoreMenu->Append(IDM_JITBLOCKLINKING, _("&JIT Block Linking off"), -- cgit v1.2.3 From b0b70381f711f0acf5001f8d2cef8458b6473344 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Mon, 7 Jul 2014 05:30:06 +0200 Subject: Revert "Don't add segfault handler in interpreter mode" --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 234f798aa5..b8185a85cc 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -369,7 +369,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam " and stepping to work as explained in the Developer Documentation. But it can be very" " slow, perhaps slower than 1 fps."), wxITEM_CHECK); - interpreter->Check(_LocalCoreStartupParameter.iCPUCore == CPU_INTERPRETER); + interpreter->Check(_LocalCoreStartupParameter.iCPUCore == 0); pCoreMenu->AppendSeparator(); pCoreMenu->Append(IDM_JITBLOCKLINKING, _("&JIT Block Linking off"), -- cgit v1.2.3 From 32d53c7d1dc925e027be0823257467539ce8dd77 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 10 Jul 2014 20:26:08 -0400 Subject: DolphinWX: Get rid of an unneccessary cast in CodeWindow CFrame inherits from CRenderFrame which inherits from wxFrame which eventually inherits from wxWindow, so this cast is not required. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index b8185a85cc..e1c3aaf8ae 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -87,7 +87,7 @@ END_EVENT_TABLE() // Class CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *parent, wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) - : wxPanel((wxWindow*)parent, id, position, size, style, name) + : wxPanel(parent, id, position, size, style, name) , Parent(parent) , m_RegisterWindow(nullptr) , m_BreakpointWindow(nullptr) -- cgit v1.2.3 From 6f9483d161e19c8d655b2271c27a4d3f6eecd543 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 10 Jul 2014 20:39:26 -0400 Subject: DolphinWX: Remove unnecessary true within event Skip calls --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index e1c3aaf8ae..ff9758a8f9 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -222,7 +222,7 @@ void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) JumpToAddress(addr); } - event.Skip(1); + event.Skip(); } void CCodeWindow::OnCallstackListChange(wxCommandEvent& event) -- cgit v1.2.3 From 26f3867e205b132b67fde2d1a28ca39228b41776 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 10 Jul 2014 23:17:38 -0400 Subject: DolphinWX: Allow short-hand searching in the code window Lessens the restrictions on the searching in the code view. Now typing out the full 8 digit hex number isn't needed. For example, you don't need to type 000000FF to go to FF, you just literally type FF. Also makes JumpToAddress a boolean function to remain consistent with the DSP code view. This will also change the address search box to have a red background if either an invalid hex number is given, or if it's longer than 8 characters --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 37 +++++++++++++++++++-------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index ff9758a8f9..57ec740749 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -195,10 +195,18 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event) Parent->UpdateGUI(); } -void CCodeWindow::JumpToAddress(u32 _Address) +bool CCodeWindow::JumpToAddress(u32 address) { - codeview->Center(_Address); - UpdateLists(); + // Jump to anywhere in memory + if (address <= 0xFFFFFFFF) + { + codeview->Center(address); + UpdateLists(); + + return true; + } + + return false; } void CCodeWindow::OnCodeViewChange(wxCommandEvent &event) @@ -208,20 +216,27 @@ void CCodeWindow::OnCodeViewChange(wxCommandEvent &event) void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) { - if (!GetToolBar()) return; + if (!GetToolBar()) + return; wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX); - wxString txt = pAddrCtrl->GetValue(); + wxString txt = pAddrCtrl->GetValue().Strip(wxString::stripType::both); - std::string text(WxStrToStr(txt)); - text = StripSpaces(text); - if (text.size() == 8) + bool success = false; + unsigned long addr; + if (txt.ToULong(&addr, 16)) { - u32 addr; - sscanf(text.c_str(), "%08x", &addr); - JumpToAddress(addr); + if (JumpToAddress(addr)) + success = true; } + if (success) + pAddrCtrl->SetBackgroundColour(wxNullColour); + else + pAddrCtrl->SetBackgroundColour(*wxRED); + + pAddrCtrl->Refresh(); + event.Skip(); } -- cgit v1.2.3 From 5c57a1ef4b06f082207d6a578c224c4f0db473d0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 13 Jul 2014 14:29:03 -0400 Subject: DolphinWX: Remove the use of some wx 1.0 compatibility functions. Uses the recommended replacements. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 57ec740749..dbc2e50608 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -220,7 +220,9 @@ void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) return; wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX); - wxString txt = pAddrCtrl->GetValue().Strip(wxString::stripType::both); + + // Trim leading and trailing whitespace. + wxString txt = pAddrCtrl->GetValue().Trim().Trim(false); bool success = false; unsigned long addr; -- cgit v1.2.3 From 019d5aee498b04963c2a38cc200d607c288c9b64 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 8 Aug 2014 03:43:13 -0700 Subject: Changed toolbar to be static, increasing UI integration --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index dbc2e50608..4c75961715 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -128,7 +128,7 @@ wxMenuBar *CCodeWindow::GetMenuBar() return Parent->GetMenuBar(); } -wxAuiToolBar *CCodeWindow::GetToolBar() +wxToolBar *CCodeWindow::GetToolBar() { return Parent->m_ToolBarDebug; } @@ -588,7 +588,7 @@ void CCodeWindow::InitBitmaps() bitmap = wxBitmap(bitmap.ConvertToImage().Scale(24, 24)); } -void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar) +void CCodeWindow::PopulateToolbar(wxToolBar* toolBar) { int w = m_Bitmaps[0].GetWidth(), h = m_Bitmaps[0].GetHeight(); @@ -625,7 +625,7 @@ void CCodeWindow::UpdateButtonStates() bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED); bool Pause = (Core::GetState() == Core::CORE_PAUSE); bool Stepping = CCPU::IsStepping(); - wxAuiToolBar* ToolBar = GetToolBar(); + wxToolBar* ToolBar = GetToolBar(); // Toolbar if (!ToolBar) -- cgit v1.2.3 From 6cd0ebab9363f7c0335b6817379e77ddb0adb7a7 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 8 Aug 2014 15:02:35 -0700 Subject: Included toolbar headers, preventing forward-decl errors --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 4c75961715..8e5ad2597a 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 7bf82f19895f1f6b01d5b3971e1e9e4dae5dc154 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 5 Aug 2014 00:35:53 -0400 Subject: Core: Kill off Host_UpdateLogDisplay() This was actually never used as far as I can tell. There was no wx event handling done whatsoever for the global ID, So this is basically a dead function. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index dbc2e50608..a5717b2eb3 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -285,7 +285,6 @@ void CCodeWindow::SingleStep() // need a short wait here JumpToAddress(PC); Update(); - Host_UpdateLogDisplay(); } } -- cgit v1.2.3 From b8b72861b5a608add9e23a016ee18e02d7099ddb Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 9 Aug 2014 00:42:32 -0700 Subject: Removed AuiTB, moved functions to menubar (Debug->Perspectives) --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 8e5ad2597a..0fde18f6ff 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -437,6 +437,22 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam pDebugMenu->Append(IDM_STEP, _("Step &Into\tF11")); pDebugMenu->Append(IDM_STEPOVER, _("Step &Over\tF10")); pDebugMenu->Append(IDM_TOGGLE_BREAKPOINT, _("Toggle &Breakpoint\tF9")); + pDebugMenu->AppendSeparator(); + + wxMenu* pPerspectives = new wxMenu; + Parent->m_SavedPerspectives = new wxMenu; + pDebugMenu->AppendSubMenu(pPerspectives, _("Perspectives"), _("Edit Perspectives")); + pPerspectives->Append(IDM_SAVE_PERSPECTIVE, _("Save perspectives"), _("Save currently-toggled perspectives")); + pPerspectives->Append(IDM_EDIT_PERSPECTIVES, _("Edit perspectives"), _("Toggle editing of perspectives"), wxITEM_CHECK); + pPerspectives->AppendSeparator(); + pPerspectives->Append(IDM_ADD_PERSPECTIVE, _("Create new perspective")); + pPerspectives->AppendSubMenu(Parent->m_SavedPerspectives, _("Saved perspectives")); + Parent->PopulateSavedPerspectives(); + pPerspectives->AppendSeparator(); + pPerspectives->Append(IDM_PERSPECTIVES_ADD_PANE, _("Add new pane")); + pPerspectives->Append(IDM_TAB_SPLIT, _("Tab split"), "", wxITEM_CHECK); + pPerspectives->Append(IDM_NO_DOCKING, _("Disable docking"), "Disable docking of perspective panes to main window", wxITEM_CHECK); + pMenuBar->Append(pDebugMenu, _("&Debug")); -- cgit v1.2.3 From b81617fba1d618d3f0c9b645fc057645616caa1f Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 9 Aug 2014 00:56:20 -0700 Subject: Removed TBDebug, using TBMain instead. Fixed debugger assert. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 0fde18f6ff..315bd3c962 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -131,7 +131,7 @@ wxMenuBar *CCodeWindow::GetMenuBar() wxToolBar *CCodeWindow::GetToolBar() { - return Parent->m_ToolBarDebug; + return Parent->m_ToolBar; } // ---------- -- cgit v1.2.3 From cf46ac7dc952abf1ee67c3f938a4bd6b6c5973d5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 15 Aug 2014 15:10:41 -0400 Subject: Core: Kill off Host_ShowJitResults Another host function that can be killed off by simple wx event handling --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index fd0c296eb7..ffddd52902 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -49,6 +49,7 @@ #include "DolphinWX/Debugger/CodeView.h" #include "DolphinWX/Debugger/CodeWindow.h" #include "DolphinWX/Debugger/DebuggerUIUtil.h" +#include "DolphinWX/Debugger/JitWindow.h" #include "DolphinWX/Debugger/RegisterWindow.h" extern "C" // Bitmaps @@ -156,6 +157,13 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event) Update(); if (m_BreakpointWindow) m_BreakpointWindow->NotifyUpdate(); break; + + case IDM_UPDATEJITPANE: + // Check if the JIT pane is in the AUI notebook. If not, add it and switch to it. + if (!m_JitWindow) + ToggleJitWindow(true); + m_JitWindow->ViewAddr(codeview->GetSelection()); + break; } } -- cgit v1.2.3 From b74a34795ba7162e825e20679536c1ed9a62c083 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 15 Aug 2014 21:16:14 -0700 Subject: Fixed toolbar's disabled button color. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index ffddd52902..b67b836be6 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -618,12 +618,12 @@ void CCodeWindow::PopulateToolbar(wxToolBar* toolBar) h = m_Bitmaps[0].GetHeight(); toolBar->SetToolBitmapSize(wxSize(w, h)); - toolBar->AddTool(IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step]); - toolBar->AddTool(IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver]); - toolBar->AddTool(IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip]); + WxUtils::AddToolbarButton(toolBar, IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step], _("Step into the next instruction")); + WxUtils::AddToolbarButton(toolBar, IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver], _("Step over the next instruction")); + WxUtils::AddToolbarButton(toolBar, IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip], _("Skips the next instruction completely")); toolBar->AddSeparator(); - toolBar->AddTool(IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC]); - toolBar->AddTool(IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC]); + WxUtils::AddToolbarButton(toolBar, IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC], _("Go to the current instruction")); + WxUtils::AddToolbarButton(toolBar, IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC], _("Set the current instruction")); toolBar->AddSeparator(); toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, "")); -- cgit v1.2.3 From b7f379768914e04f31e61e2026b287ae9a9acee2 Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 15 Aug 2014 22:33:58 -0700 Subject: Wx: further cleanup to toolbar creation process --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index b67b836be6..8750dc7979 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -626,8 +626,6 @@ void CCodeWindow::PopulateToolbar(wxToolBar* toolBar) WxUtils::AddToolbarButton(toolBar, IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC], _("Set the current instruction")); toolBar->AddSeparator(); toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, "")); - - toolBar->Realize(); } // Update GUI -- 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/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 8750dc7979..bc5742fa6c 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -27,7 +27,7 @@ #include #include "Common/BreakPoints.h" -#include "Common/Common.h" +#include "Common/CommonTypes.h" #include "Common/StringUtil.h" #include "Common/SymbolDB.h" #include "Core/Core.h" -- cgit v1.2.3 From f93aa7087cb75e9d7539cac2b47befb5123f6ab8 Mon Sep 17 00:00:00 2001 From: Rachel Bryk Date: Tue, 9 Sep 2014 00:24:49 -0400 Subject: Kill Core::g_CoreStartupParameter. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 8750dc7979..ee86c0b61e 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -501,37 +501,37 @@ void CCodeWindow::OnCPUMode(wxCommandEvent& event) bAutomaticStart = !bAutomaticStart; return; case IDM_JITOFF: - Core::g_CoreStartupParameter.bJITOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITOff = event.IsChecked(); break; case IDM_JITLSOFF: - Core::g_CoreStartupParameter.bJITLoadStoreOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStoreOff = event.IsChecked(); break; case IDM_JITLSLXZOFF: - Core::g_CoreStartupParameter.bJITLoadStorelXzOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStorelXzOff = event.IsChecked(); break; case IDM_JITLSLWZOFF: - Core::g_CoreStartupParameter.bJITLoadStorelwzOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStorelwzOff = event.IsChecked(); break; case IDM_JITLSLBZXOFF: - Core::g_CoreStartupParameter.bJITLoadStorelbzxOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStorelbzxOff = event.IsChecked(); break; case IDM_JITLSFOFF: - Core::g_CoreStartupParameter.bJITLoadStoreFloatingOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStoreFloatingOff = event.IsChecked(); break; case IDM_JITLSPOFF: - Core::g_CoreStartupParameter.bJITLoadStorePairedOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStorePairedOff = event.IsChecked(); break; case IDM_JITFPOFF: - Core::g_CoreStartupParameter.bJITFloatingPointOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITFloatingPointOff = event.IsChecked(); break; case IDM_JITIOFF: - Core::g_CoreStartupParameter.bJITIntegerOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITIntegerOff = event.IsChecked(); break; case IDM_JITPOFF: - Core::g_CoreStartupParameter.bJITPairedOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITPairedOff = event.IsChecked(); break; case IDM_JITSROFF: - Core::g_CoreStartupParameter.bJITSystemRegistersOff = event.IsChecked(); + SConfig::GetInstance().m_LocalCoreStartupParameter.bJITSystemRegistersOff = event.IsChecked(); break; } -- cgit v1.2.3 From 8ce467660581d2bec299c1c3165f559d82d278f0 Mon Sep 17 00:00:00 2001 From: Fiora Date: Thu, 18 Sep 2014 03:46:39 -0700 Subject: Debugger: make opcode search a bit better Search a wider range (not all games fit in the originally searched range). Print a notice if the opcode isn't found, instead of silently failing. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 4d3f0ee044..194e72b11c 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -557,15 +557,19 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event) case IDM_SEARCHINSTRUCTION: { wxString str = wxGetTextFromUser("", _("Op?"), wxEmptyString, this); - for (u32 addr = 0x80000000; addr < 0x80100000; addr += 4) + auto const wx_name = WxStrToStr(str); + bool found = false; + for (u32 addr = 0x80000000; addr < 0x80180000; addr += 4) { const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr)); - auto const wx_name = WxStrToStr(str); if (name && (wx_name == name)) { NOTICE_LOG(POWERPC, "Found %s at %08x", wx_name.c_str(), addr); + found = true; } } + if (!found) + NOTICE_LOG(POWERPC, "Opcode %s not found", wx_name.c_str()); break; } } -- cgit v1.2.3 From 85547d94beb3e5c01b1b5dda2235344e2ab22dc1 Mon Sep 17 00:00:00 2001 From: Fiora Date: Fri, 26 Sep 2014 13:45:24 -0700 Subject: JIT: properly remove FIFO write addresses when code is invalidated Fixes a bug caused by interaction with carry optimizations; might fix other issues too. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 194e72b11c..5abbfc6bc8 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -288,7 +288,7 @@ void CCodeWindow::SingleStep() { if (CCPU::IsStepping()) { - JitInterface::InvalidateICache(PC, 4); + JitInterface::InvalidateICache(PC, 4, true); CCPU::StepOpcode(&sync_event); wxThread::Sleep(20); // need a short wait here -- cgit v1.2.3 From 8bf2cf064118107f5bfe14c3ff5c4b05b02c6130 Mon Sep 17 00:00:00 2001 From: Fiora Date: Wed, 8 Oct 2014 19:02:02 -0700 Subject: Debug: fix disable block linking option Previously it did the opposite of what it was supposed to; when checked, it'd turn block linking on, and when unchecked, it'd turn it off. Also update JITIL's block linking disabling in debug mode to match the behavior of the regular JIT. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 5abbfc6bc8..4af423e134 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -397,7 +397,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam interpreter->Check(_LocalCoreStartupParameter.iCPUCore == 0); pCoreMenu->AppendSeparator(); - pCoreMenu->Append(IDM_JITBLOCKLINKING, _("&JIT Block Linking off"), + pCoreMenu->Append(IDM_JITNOBLOCKLINKING, _("&JIT Block Linking off"), _("Provide safer execution by not linking the JIT blocks."), wxITEM_CHECK); @@ -596,9 +596,9 @@ bool CCodeWindow::JITNoBlockCache() return GetMenuBar()->IsChecked(IDM_JITNOBLOCKCACHE); } -bool CCodeWindow::JITBlockLinking() +bool CCodeWindow::JITNoBlockLinking() { - return GetMenuBar()->IsChecked(IDM_JITBLOCKLINKING); + return GetMenuBar()->IsChecked(IDM_JITNOBLOCKLINKING); } // Toolbar -- cgit v1.2.3 From 9f2b48ab07e1c92e3ba94ffbb3205b3b7e6f4f84 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 27 Sep 2014 15:54:07 -0400 Subject: Core: Use an enum for indicating CPU cores --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 4af423e134..94ca897a7b 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -384,7 +384,7 @@ void CCodeWindow::UpdateCallstack() } // Create CPU Mode menus -void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar) +void CCodeWindow::CreateMenu(const SCoreStartupParameter& core_startup_parameter, wxMenuBar *pMenuBar) { // CPU Mode wxMenu* pCoreMenu = new wxMenu; @@ -394,7 +394,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam " and stepping to work as explained in the Developer Documentation. But it can be very" " slow, perhaps slower than 1 fps."), wxITEM_CHECK); - interpreter->Check(_LocalCoreStartupParameter.iCPUCore == 0); + interpreter->Check(core_startup_parameter.iCPUCore == SCoreStartupParameter::CORE_INTERPRETER); pCoreMenu->AppendSeparator(); pCoreMenu->Append(IDM_JITNOBLOCKLINKING, _("&JIT Block Linking off"), -- cgit v1.2.3 From 219a5078e86ad05cdc90a91a41a337be2eb8e679 Mon Sep 17 00:00:00 2001 From: skidau Date: Wed, 15 Oct 2014 20:04:23 +1100 Subject: Added a "Step Out" (aka "Step return") function to the debugger. Conflicts: Source/Core/DolphinWX/Debugger/CodeWindow.h --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 94ca897a7b..f10421e860 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -180,6 +180,10 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event) StepOver(); break; + case IDM_STEPOUT: + StepOut(); + break; + case IDM_TOGGLE_BREAKPOINT: ToggleBreakpoint(); break; @@ -320,6 +324,21 @@ void CCodeWindow::StepOver() } } +void CCodeWindow::StepOut() +{ + if (CCPU::IsStepping()) + { + PowerPC::breakpoints.Add(LR, true); + CCPU::EnableStepping(false); + JumpToAddress(PC); + Update(); + + UpdateButtonStates(); + // Update all toolbars in the aui manager + Parent->UpdateGUI(); + } +} + void CCodeWindow::ToggleBreakpoint() { if (CCPU::IsStepping()) @@ -443,6 +462,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& core_startup_parameter pDebugMenu->Append(IDM_STEP, _("Step &Into\tF11")); pDebugMenu->Append(IDM_STEPOVER, _("Step &Over\tF10")); + pDebugMenu->Append(IDM_STEPOUT, _("Step O&ut\tSHIFT+F11")); pDebugMenu->Append(IDM_TOGGLE_BREAKPOINT, _("Toggle &Breakpoint\tF9")); pDebugMenu->AppendSeparator(); @@ -607,6 +627,7 @@ void CCodeWindow::InitBitmaps() // load original size 48x48 m_Bitmaps[Toolbar_Step] = wxGetBitmapFromMemory(toolbar_add_breakpoint_png); m_Bitmaps[Toolbar_StepOver] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); + m_Bitmaps[Toolbar_StepOut] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); m_Bitmaps[Toolbar_Skip] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); m_Bitmaps[Toolbar_GotoPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); m_Bitmaps[Toolbar_SetPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); @@ -624,6 +645,7 @@ void CCodeWindow::PopulateToolbar(wxToolBar* toolBar) toolBar->SetToolBitmapSize(wxSize(w, h)); WxUtils::AddToolbarButton(toolBar, IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step], _("Step into the next instruction")); WxUtils::AddToolbarButton(toolBar, IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver], _("Step over the next instruction")); + WxUtils::AddToolbarButton(toolBar, IDM_STEPOUT, _("Step Out"), m_Bitmaps[Toolbar_StepOut], _("Step out of the current function")); WxUtils::AddToolbarButton(toolBar, IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip], _("Skips the next instruction completely")); toolBar->AddSeparator(); WxUtils::AddToolbarButton(toolBar, IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC], _("Go to the current instruction")); @@ -660,6 +682,7 @@ void CCodeWindow::UpdateButtonStates() if (!Initialized) { ToolBar->EnableTool(IDM_STEPOVER, false); + ToolBar->EnableTool(IDM_STEPOUT, false); ToolBar->EnableTool(IDM_SKIP, false); } else @@ -667,11 +690,13 @@ void CCodeWindow::UpdateButtonStates() if (!Stepping) { ToolBar->EnableTool(IDM_STEPOVER, false); + ToolBar->EnableTool(IDM_STEPOUT, false); ToolBar->EnableTool(IDM_SKIP, false); } else { ToolBar->EnableTool(IDM_STEPOVER, true); + ToolBar->EnableTool(IDM_STEPOUT, true); ToolBar->EnableTool(IDM_SKIP, true); } } -- cgit v1.2.3 From df37649b9f8499ec732b7511e7fed2b075ef7781 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 18 Oct 2014 11:02:26 +1100 Subject: Changed the step over routine to a single stepping version that steps until a blr is encountered. Cleared out all temporary breakpoints on each step to prevent phantom breakpoints from stopping the debugger. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 38 +++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index f10421e860..c6ad04e8b7 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -37,6 +37,7 @@ #include "Core/Debugger/PPCDebugInterface.h" #include "Core/HW/CPU.h" #include "Core/HW/Memmap.h" +#include "Core/HW/SystemTimers.h" #include "Core/PowerPC/Gekko.h" #include "Core/PowerPC/JitInterface.h" #include "Core/PowerPC/PowerPC.h" @@ -292,6 +293,7 @@ void CCodeWindow::SingleStep() { if (CCPU::IsStepping()) { + PowerPC::breakpoints.ClearAllTemporary(); JitInterface::InvalidateICache(PC, 4, true); CCPU::StepOpcode(&sync_event); wxThread::Sleep(20); @@ -305,6 +307,7 @@ void CCodeWindow::StepOver() { if (CCPU::IsStepping()) { + PowerPC::breakpoints.ClearAllTemporary(); UGeckoInstruction inst = Memory::Read_Instruction(PC); if (inst.LK) { @@ -328,8 +331,39 @@ void CCodeWindow::StepOut() { if (CCPU::IsStepping()) { - PowerPC::breakpoints.Add(LR, true); - CCPU::EnableStepping(false); + PowerPC::breakpoints.ClearAllTemporary(); + + // Keep stepping until the next blr or timeout after one second + u64 timeout = SystemTimers::GetTicksPerSecond(); + u64 steps = 0; + PowerPC::CoreMode oldMode = PowerPC::GetMode(); + PowerPC::SetMode(PowerPC::MODE_INTERPRETER); + UGeckoInstruction inst = Memory::Read_Instruction(PC); + GekkoOPInfo *opinfo = GetOpInfo(inst); + while (inst.hex != 0x4e800020 && steps < timeout) // check for blr + { + if (inst.LK) + { + // Step over branches + u32 next_pc = PC + 4; + while (PC != next_pc && steps < timeout) + { + PowerPC::SingleStep(); + ++steps; + } + } + else + { + PowerPC::SingleStep(); + ++steps; + } + inst = Memory::Read_Instruction(PC); + opinfo = GetOpInfo(inst); + } + + PowerPC::SingleStep(); + PowerPC::SetMode(oldMode); + JumpToAddress(PC); Update(); -- 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 --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index c6ad04e8b7..b34dfa29b5 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -52,6 +52,7 @@ #include "DolphinWX/Debugger/DebuggerUIUtil.h" #include "DolphinWX/Debugger/JitWindow.h" #include "DolphinWX/Debugger/RegisterWindow.h" +#include "DolphinWX/Debugger/WatchWindow.h" extern "C" // Bitmaps { @@ -93,6 +94,7 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter : wxPanel(parent, id, position, size, style, name) , Parent(parent) , m_RegisterWindow(nullptr) + , m_WatchWindow(nullptr) , m_BreakpointWindow(nullptr) , m_MemoryWindow(nullptr) , m_JitWindow(nullptr) @@ -152,6 +154,7 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event) Update(); if (codeview) codeview->Center(PC); if (m_RegisterWindow) m_RegisterWindow->NotifyUpdate(); + if (m_WatchWindow) m_WatchWindow->NotifyUpdate(); break; case IDM_UPDATEBREAKPOINTS: -- cgit v1.2.3 From 290e1bed378d570667eb66170986696ca207d2d6 Mon Sep 17 00:00:00 2001 From: skidau Date: Fri, 24 Oct 2014 12:57:17 +1100 Subject: Disable block linking while debugger stepping or if there are breakpoints --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index b34dfa29b5..481240c498 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -310,10 +310,10 @@ void CCodeWindow::StepOver() { if (CCPU::IsStepping()) { - PowerPC::breakpoints.ClearAllTemporary(); UGeckoInstruction inst = Memory::Read_Instruction(PC); if (inst.LK) { + PowerPC::breakpoints.ClearAllTemporary(); PowerPC::breakpoints.Add(PC + 4, true); CCPU::EnableStepping(false); JumpToAddress(PC); -- cgit v1.2.3 From 4570dd7eeb9033c0e349d3a9f0126f24010b0699 Mon Sep 17 00:00:00 2001 From: skidau Date: Sun, 26 Oct 2014 23:23:45 +1100 Subject: Fixed a crash that would occur if a new watch were added by entering a watch name. Code style updates. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 481240c498..35678e43dd 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -342,7 +342,7 @@ void CCodeWindow::StepOut() PowerPC::CoreMode oldMode = PowerPC::GetMode(); PowerPC::SetMode(PowerPC::MODE_INTERPRETER); UGeckoInstruction inst = Memory::Read_Instruction(PC); - GekkoOPInfo *opinfo = GetOpInfo(inst); + GekkoOPInfo* opinfo = GetOpInfo(inst); while (inst.hex != 0x4e800020 && steps < timeout) // check for blr { if (inst.LK) -- cgit v1.2.3 From b70a75776e7ad152cdab86b34c39b1a5b9482184 Mon Sep 17 00:00:00 2001 From: Rohit Nirmal Date: Tue, 28 Oct 2014 21:02:47 -0500 Subject: DolphinWX: Remove unused variable. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 35678e43dd..4989cecff0 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -342,7 +342,6 @@ void CCodeWindow::StepOut() PowerPC::CoreMode oldMode = PowerPC::GetMode(); PowerPC::SetMode(PowerPC::MODE_INTERPRETER); UGeckoInstruction inst = Memory::Read_Instruction(PC); - GekkoOPInfo* opinfo = GetOpInfo(inst); while (inst.hex != 0x4e800020 && steps < timeout) // check for blr { if (inst.LK) @@ -361,7 +360,6 @@ void CCodeWindow::StepOut() ++steps; } inst = Memory::Read_Instruction(PC); - opinfo = GetOpInfo(inst); } PowerPC::SingleStep(); -- cgit v1.2.3 From ee22d091a0058eb12acad673bfc4e7346a195484 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 5 Nov 2014 22:19:52 -0500 Subject: DolphinWX: Eliminate most usages of event tables in the debugger. Moves things over to Bind. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 64 +++++++++++---------------- 1 file changed, 26 insertions(+), 38 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 4989cecff0..debf26345d 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -60,35 +60,6 @@ extern "C" // Bitmaps #include "DolphinWX/resources/toolbar_add_breakpoint.c" // NOLINT } -class DebugInterface; - -// ------- -// Main - -BEGIN_EVENT_TABLE(CCodeWindow, wxPanel) - - // Menu bar - EVT_MENU_RANGE(IDM_INTERPRETER, IDM_JITSROFF, CCodeWindow::OnCPUMode) - EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont) - EVT_MENU_RANGE(IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu) - EVT_MENU_RANGE(IDM_CLEARSYMBOLS, IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu) - EVT_MENU_RANGE(IDM_PROFILEBLOCKS, IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu) - - // Toolbar - EVT_MENU_RANGE(IDM_STEP, IDM_GOTOPC, CCodeWindow::OnCodeStep) - EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange) - - // Other - EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange) - EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange) - EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange) - EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange) - - EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage) - -END_EVENT_TABLE() - -// Class CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *parent, wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) : wxPanel(parent, id, position, size, style, name) @@ -109,23 +80,40 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter DebugInterface* di = &PowerPC::debug_interface; - codeview = new CCodeView(di, &g_symbolDB, this, ID_CODEVIEW); + codeview = new CCodeView(di, &g_symbolDB, this, wxID_ANY); sizerBig->Add(sizerLeft, 2, wxEXPAND); sizerBig->Add(codeview, 5, wxEXPAND); - sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST, - wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); - sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST, - wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND); - sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition, - wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); - sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition, - wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + sizerLeft->Add(callstack = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); + callstack->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallstackListChange, this); + + sizerLeft->Add(symbols = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND); + symbols->Bind(wxEVT_LISTBOX, &CCodeWindow::OnSymbolListChange, this); + + sizerLeft->Add(calls = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + calls->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallsListChange, this); + + sizerLeft->Add(callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + callers->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallersListChange, this); SetSizer(sizerBig); sizerLeft->Fit(this); sizerBig->Fit(this); + + // Menu + Bind(wxEVT_MENU, &CCodeWindow::OnCPUMode, this, IDM_INTERPRETER, IDM_JITSROFF); + Bind(wxEVT_MENU, &CCodeWindow::OnChangeFont, this, IDM_FONTPICKER); + Bind(wxEVT_MENU, &CCodeWindow::OnJitMenu, this, IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION); + Bind(wxEVT_MENU, &CCodeWindow::OnSymbolsMenu, this, IDM_CLEARSYMBOLS, IDM_PATCHHLEFUNCTIONS); + Bind(wxEVT_MENU, &CCodeWindow::OnProfilerMenu, this, IDM_PROFILEBLOCKS, IDM_WRITEPROFILE); + + // Toolbar + Bind(wxEVT_MENU, &CCodeWindow::OnCodeStep, this, IDM_STEP, IDM_GOTOPC); + Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this, IDM_ADDRBOX); + + // Other + Bind(wxEVT_HOST_COMMAND, &CCodeWindow::OnHostMessage, this); } wxMenuBar *CCodeWindow::GetMenuBar() -- 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. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index debf26345d..fb69650567 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -752,8 +752,12 @@ void CCodeWindow::UpdateButtonStates() GetMenuBar()->Enable(IDM_SCANFUNCTIONS, Initialized); GetMenuBar()->Enable(IDM_LOADMAPFILE, Initialized); GetMenuBar()->Enable(IDM_SAVEMAPFILE, Initialized); + GetMenuBar()->Enable(IDM_LOADMAPFILEAS, Initialized); + GetMenuBar()->Enable(IDM_SAVEMAPFILEAS, Initialized); GetMenuBar()->Enable(IDM_SAVEMAPFILEWITHCODES, Initialized); GetMenuBar()->Enable(IDM_CREATESIGNATUREFILE, Initialized); + GetMenuBar()->Enable(IDM_APPENDSIGNATUREFILE, Initialized); + GetMenuBar()->Enable(IDM_COMBINESIGNATUREFILES, Initialized); GetMenuBar()->Enable(IDM_RENAME_SYMBOLS, Initialized); GetMenuBar()->Enable(IDM_USESIGNATUREFILE, Initialized); GetMenuBar()->Enable(IDM_PATCHHLEFUNCTIONS, Initialized); -- 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. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index fb69650567..822913d078 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -754,6 +754,7 @@ void CCodeWindow::UpdateButtonStates() GetMenuBar()->Enable(IDM_SAVEMAPFILE, Initialized); GetMenuBar()->Enable(IDM_LOADMAPFILEAS, Initialized); GetMenuBar()->Enable(IDM_SAVEMAPFILEAS, Initialized); + GetMenuBar()->Enable(IDM_LOADBADMAPFILE, Initialized); GetMenuBar()->Enable(IDM_SAVEMAPFILEWITHCODES, Initialized); GetMenuBar()->Enable(IDM_CREATESIGNATUREFILE, Initialized); GetMenuBar()->Enable(IDM_APPENDSIGNATUREFILE, Initialized); -- 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 --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 154 +++++++++++++------------- 1 file changed, 77 insertions(+), 77 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 822913d078..8d5137430e 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -102,11 +102,11 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter sizerBig->Fit(this); // Menu - Bind(wxEVT_MENU, &CCodeWindow::OnCPUMode, this, IDM_INTERPRETER, IDM_JITSROFF); - Bind(wxEVT_MENU, &CCodeWindow::OnChangeFont, this, IDM_FONTPICKER); - Bind(wxEVT_MENU, &CCodeWindow::OnJitMenu, this, IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION); - Bind(wxEVT_MENU, &CCodeWindow::OnSymbolsMenu, this, IDM_CLEARSYMBOLS, IDM_PATCHHLEFUNCTIONS); - Bind(wxEVT_MENU, &CCodeWindow::OnProfilerMenu, this, IDM_PROFILEBLOCKS, IDM_WRITEPROFILE); + Bind(wxEVT_MENU, &CCodeWindow::OnCPUMode, this, IDM_INTERPRETER, IDM_JIT_SR_OFF); + Bind(wxEVT_MENU, &CCodeWindow::OnChangeFont, this, IDM_FONT_PICKER); + Bind(wxEVT_MENU, &CCodeWindow::OnJitMenu, this, IDM_CLEAR_CODE_CACHE, IDM_SEARCH_INSTRUCTION); + Bind(wxEVT_MENU, &CCodeWindow::OnSymbolsMenu, this, IDM_CLEAR_SYMBOLS, IDM_PATCH_HLE_FUNCTIONS); + Bind(wxEVT_MENU, &CCodeWindow::OnProfilerMenu, this, IDM_PROFILE_BLOCKS, IDM_WRITE_PROFILE); // Toolbar Bind(wxEVT_MENU, &CCodeWindow::OnCodeStep, this, IDM_STEP, IDM_GOTOPC); @@ -133,24 +133,24 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event) { switch (event.GetId()) { - case IDM_NOTIFYMAPLOADED: + case IDM_NOTIFY_MAP_LOADED: NotifyMapLoaded(); if (m_BreakpointWindow) m_BreakpointWindow->NotifyUpdate(); break; - case IDM_UPDATEDISASMDIALOG: + case IDM_UPDATE_DISASM_DIALOG: Update(); if (codeview) codeview->Center(PC); if (m_RegisterWindow) m_RegisterWindow->NotifyUpdate(); if (m_WatchWindow) m_WatchWindow->NotifyUpdate(); break; - case IDM_UPDATEBREAKPOINTS: + case IDM_UPDATE_BREAKPOINTS: Update(); if (m_BreakpointWindow) m_BreakpointWindow->NotifyUpdate(); break; - case IDM_UPDATEJITPANE: + case IDM_UPDATE_JIT_PANE: // Check if the JIT pane is in the AUI notebook. If not, add it and switch to it. if (!m_JitWindow) ToggleJitWindow(true); @@ -439,42 +439,42 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& core_startup_parameter interpreter->Check(core_startup_parameter.iCPUCore == SCoreStartupParameter::CORE_INTERPRETER); pCoreMenu->AppendSeparator(); - pCoreMenu->Append(IDM_JITNOBLOCKLINKING, _("&JIT Block Linking off"), + pCoreMenu->Append(IDM_JIT_NO_BLOCK_LINKING, _("&JIT Block Linking off"), _("Provide safer execution by not linking the JIT blocks."), wxITEM_CHECK); - pCoreMenu->Append(IDM_JITNOBLOCKCACHE, _("&Disable JIT Cache"), + pCoreMenu->Append(IDM_JIT_NO_BLOCK_CACHE, _("&Disable JIT Cache"), _("Avoid any involuntary JIT cache clearing, this may prevent Zelda TP from crashing.\n[This option must be selected before a game is started.]"), wxITEM_CHECK); - pCoreMenu->Append(IDM_CLEARCODECACHE, _("&Clear JIT cache")); + pCoreMenu->Append(IDM_CLEAR_CODE_CACHE, _("&Clear JIT cache")); pCoreMenu->AppendSeparator(); - pCoreMenu->Append(IDM_LOGINSTRUCTIONS, _("&Log JIT instruction coverage")); - pCoreMenu->Append(IDM_SEARCHINSTRUCTION, _("&Search for an op")); + pCoreMenu->Append(IDM_LOG_INSTRUCTIONS, _("&Log JIT instruction coverage")); + pCoreMenu->Append(IDM_SEARCH_INSTRUCTION, _("&Search for an op")); pCoreMenu->AppendSeparator(); - pCoreMenu->Append(IDM_JITOFF, _("&JIT off (JIT core)"), + pCoreMenu->Append(IDM_JIT_OFF, _("&JIT off (JIT core)"), _("Turn off all JIT functions, but still use the JIT core from Jit.cpp"), wxITEM_CHECK); - pCoreMenu->Append(IDM_JITLSOFF, _("&JIT LoadStore off"), + pCoreMenu->Append(IDM_JIT_LS_OFF, _("&JIT LoadStore off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITLSLBZXOFF, _(" &JIT LoadStore lbzx off"), + pCoreMenu->Append(IDM_JIT_LSLBZX_OFF, _(" &JIT LoadStore lbzx off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITLSLXZOFF, _(" &JIT LoadStore lXz off"), + pCoreMenu->Append(IDM_JIT_LSLXZ_OFF, _(" &JIT LoadStore lXz off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITLSLWZOFF, _("&JIT LoadStore lwz off"), + pCoreMenu->Append(IDM_JIT_LSLWZ_OFF, _("&JIT LoadStore lwz off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITLSFOFF, _("&JIT LoadStore Floating off"), + pCoreMenu->Append(IDM_JIT_LSF_OFF, _("&JIT LoadStore Floating off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITLSPOFF, _("&JIT LoadStore Paired off"), + pCoreMenu->Append(IDM_JIT_LSP_OFF, _("&JIT LoadStore Paired off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITFPOFF, _("&JIT FloatingPoint off"), + pCoreMenu->Append(IDM_JIT_FP_OFF, _("&JIT FloatingPoint off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITIOFF, _("&JIT Integer off"), + pCoreMenu->Append(IDM_JIT_I_OFF, _("&JIT Integer off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITPOFF, _("&JIT Paired off"), + pCoreMenu->Append(IDM_JIT_P_OFF, _("&JIT Paired off"), wxEmptyString, wxITEM_CHECK); - pCoreMenu->Append(IDM_JITSROFF, _("&JIT SystemRegisters off"), + pCoreMenu->Append(IDM_JIT_SR_OFF, _("&JIT SystemRegisters off"), wxEmptyString, wxITEM_CHECK); pMenuBar->Append(pCoreMenu, _("&JIT")); @@ -511,12 +511,12 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& core_startup_parameter void CCodeWindow::CreateMenuOptions(wxMenu* pMenu) { - wxMenuItem* boottopause = pMenu->Append(IDM_BOOTTOPAUSE, _("Boot to pause"), + wxMenuItem* boottopause = pMenu->Append(IDM_BOOT_TO_PAUSE, _("Boot to pause"), _("Start the game directly instead of booting to pause"), wxITEM_CHECK); boottopause->Check(bBootToPause); - wxMenuItem* automaticstart = pMenu->Append(IDM_AUTOMATICSTART, _("&Automatic start"), + wxMenuItem* automaticstart = pMenu->Append(IDM_AUTOMATIC_START, _("&Automatic start"), _( "Automatically load the Default ISO when Dolphin starts, or the last game you loaded," " if you have not given it an elf file with the --elf command line. [This can be" @@ -526,7 +526,7 @@ void CCodeWindow::CreateMenuOptions(wxMenu* pMenu) wxITEM_CHECK); automaticstart->Check(bAutomaticStart); - pMenu->Append(IDM_FONTPICKER, _("&Font...")); + pMenu->Append(IDM_FONT_PICKER, _("&Font...")); } // CPU Mode and JIT Menu @@ -537,43 +537,43 @@ void CCodeWindow::OnCPUMode(wxCommandEvent& event) case IDM_INTERPRETER: PowerPC::SetMode(UseInterpreter() ? PowerPC::MODE_INTERPRETER : PowerPC::MODE_JIT); break; - case IDM_BOOTTOPAUSE: + case IDM_BOOT_TO_PAUSE: bBootToPause = !bBootToPause; return; - case IDM_AUTOMATICSTART: + case IDM_AUTOMATIC_START: bAutomaticStart = !bAutomaticStart; return; - case IDM_JITOFF: + case IDM_JIT_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITOff = event.IsChecked(); break; - case IDM_JITLSOFF: + case IDM_JIT_LS_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStoreOff = event.IsChecked(); break; - case IDM_JITLSLXZOFF: + case IDM_JIT_LSLXZ_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStorelXzOff = event.IsChecked(); break; - case IDM_JITLSLWZOFF: + case IDM_JIT_LSLWZ_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStorelwzOff = event.IsChecked(); break; - case IDM_JITLSLBZXOFF: + case IDM_JIT_LSLBZX_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStorelbzxOff = event.IsChecked(); break; - case IDM_JITLSFOFF: + case IDM_JIT_LSF_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStoreFloatingOff = event.IsChecked(); break; - case IDM_JITLSPOFF: + case IDM_JIT_LSP_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITLoadStorePairedOff = event.IsChecked(); break; - case IDM_JITFPOFF: + case IDM_JIT_FP_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITFloatingPointOff = event.IsChecked(); break; - case IDM_JITIOFF: + case IDM_JIT_I_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITIntegerOff = event.IsChecked(); break; - case IDM_JITPOFF: + case IDM_JIT_P_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITPairedOff = event.IsChecked(); break; - case IDM_JITSROFF: + case IDM_JIT_SR_OFF: SConfig::GetInstance().m_LocalCoreStartupParameter.bJITSystemRegistersOff = event.IsChecked(); break; } @@ -589,15 +589,15 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event) { switch (event.GetId()) { - case IDM_LOGINSTRUCTIONS: + case IDM_LOG_INSTRUCTIONS: PPCTables::LogCompiledInstructions(); break; - case IDM_CLEARCODECACHE: + case IDM_CLEAR_CODE_CACHE: JitInterface::ClearCache(); break; - case IDM_SEARCHINSTRUCTION: + case IDM_SEARCH_INSTRUCTION: { wxString str = wxGetTextFromUser("", _("Op?"), wxEmptyString, this); auto const wx_name = WxStrToStr(str); @@ -626,22 +626,22 @@ bool CCodeWindow::UseInterpreter() bool CCodeWindow::BootToPause() { - return GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE); + return GetMenuBar()->IsChecked(IDM_BOOT_TO_PAUSE); } bool CCodeWindow::AutomaticStart() { - return GetMenuBar()->IsChecked(IDM_AUTOMATICSTART); + return GetMenuBar()->IsChecked(IDM_AUTOMATIC_START); } bool CCodeWindow::JITNoBlockCache() { - return GetMenuBar()->IsChecked(IDM_JITNOBLOCKCACHE); + return GetMenuBar()->IsChecked(IDM_JIT_NO_BLOCK_CACHE); } bool CCodeWindow::JITNoBlockLinking() { - return GetMenuBar()->IsChecked(IDM_JITNOBLOCKLINKING); + return GetMenuBar()->IsChecked(IDM_JIT_NO_BLOCK_LINKING); } // Toolbar @@ -731,37 +731,37 @@ void CCodeWindow::UpdateButtonStates() // ------------------ GetMenuBar()->Enable(IDM_INTERPRETER, Pause); // CPU Mode - GetMenuBar()->Enable(IDM_JITNOBLOCKCACHE, !Initialized); - - GetMenuBar()->Enable(IDM_JITOFF, Pause); - GetMenuBar()->Enable(IDM_JITLSOFF, Pause); - GetMenuBar()->Enable(IDM_JITLSLXZOFF, Pause); - GetMenuBar()->Enable(IDM_JITLSLWZOFF, Pause); - GetMenuBar()->Enable(IDM_JITLSLBZXOFF, Pause); - GetMenuBar()->Enable(IDM_JITLSFOFF, Pause); - GetMenuBar()->Enable(IDM_JITLSPOFF, Pause); - GetMenuBar()->Enable(IDM_JITFPOFF, Pause); - GetMenuBar()->Enable(IDM_JITIOFF, Pause); - GetMenuBar()->Enable(IDM_JITPOFF, Pause); - GetMenuBar()->Enable(IDM_JITSROFF, Pause); - - GetMenuBar()->Enable(IDM_CLEARCODECACHE, Pause); // JIT Menu - GetMenuBar()->Enable(IDM_SEARCHINSTRUCTION, Initialized); - - GetMenuBar()->Enable(IDM_CLEARSYMBOLS, Initialized); // Symbols menu - GetMenuBar()->Enable(IDM_SCANFUNCTIONS, Initialized); - GetMenuBar()->Enable(IDM_LOADMAPFILE, Initialized); + GetMenuBar()->Enable(IDM_JIT_NO_BLOCK_CACHE, !Initialized); + + GetMenuBar()->Enable(IDM_JIT_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_LS_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_LSLXZ_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_LSLWZ_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_LSLBZX_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_LSF_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_LSP_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_FP_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_I_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_P_OFF, Pause); + GetMenuBar()->Enable(IDM_JIT_SR_OFF, Pause); + + GetMenuBar()->Enable(IDM_CLEAR_CODE_CACHE, Pause); // JIT Menu + GetMenuBar()->Enable(IDM_SEARCH_INSTRUCTION, Initialized); + + GetMenuBar()->Enable(IDM_CLEAR_SYMBOLS, Initialized); // Symbols menu + GetMenuBar()->Enable(IDM_SCAN_FUNCTIONS, Initialized); + GetMenuBar()->Enable(IDM_LOAD_MAP_FILE, Initialized); GetMenuBar()->Enable(IDM_SAVEMAPFILE, Initialized); - GetMenuBar()->Enable(IDM_LOADMAPFILEAS, Initialized); - GetMenuBar()->Enable(IDM_SAVEMAPFILEAS, Initialized); - GetMenuBar()->Enable(IDM_LOADBADMAPFILE, Initialized); - GetMenuBar()->Enable(IDM_SAVEMAPFILEWITHCODES, Initialized); - GetMenuBar()->Enable(IDM_CREATESIGNATUREFILE, Initialized); - GetMenuBar()->Enable(IDM_APPENDSIGNATUREFILE, Initialized); - GetMenuBar()->Enable(IDM_COMBINESIGNATUREFILES, Initialized); + GetMenuBar()->Enable(IDM_LOAD_MAP_FILE_AS, Initialized); + GetMenuBar()->Enable(IDM_SAVE_MAP_FILE_AS, Initialized); + GetMenuBar()->Enable(IDM_LOAD_BAD_MAP_FILE, Initialized); + GetMenuBar()->Enable(IDM_SAVE_MAP_FILE_WITH_CODES, Initialized); + GetMenuBar()->Enable(IDM_CREATE_SIGNATURE_FILE, Initialized); + GetMenuBar()->Enable(IDM_APPEND_SIGNATURE_FILE, Initialized); + GetMenuBar()->Enable(IDM_COMBINE_SIGNATURE_FILES, Initialized); GetMenuBar()->Enable(IDM_RENAME_SYMBOLS, Initialized); - GetMenuBar()->Enable(IDM_USESIGNATUREFILE, Initialized); - GetMenuBar()->Enable(IDM_PATCHHLEFUNCTIONS, Initialized); + GetMenuBar()->Enable(IDM_USE_SIGNATURE_FILE, Initialized); + GetMenuBar()->Enable(IDM_PATCH_HLE_FUNCTIONS, Initialized); // Update Fonts callstack->SetFont(DebuggerFont); -- cgit v1.2.3 From ac54c6a4e2f6790f628f8a8112ff1940732f5068 Mon Sep 17 00:00:00 2001 From: magumagu Date: Sat, 17 Jan 2015 13:17:36 -0800 Subject: Make address translation respect the CPU translation mode. The PowerPC CPU has bits in MSR (DR and IR) which control whether addresses are translated. We should respect these instead of mixing physical addresses and translated addresses into the same address space. This is mostly mass-renaming calls to memory accesses APIs from places which expect address translation to use a different version from those which do not expect address translation. This does very little on its own, but it's the first step to a correct BAT implementation. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 8d5137430e..fcf42756ca 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -298,7 +298,7 @@ void CCodeWindow::StepOver() { if (CCPU::IsStepping()) { - UGeckoInstruction inst = Memory::Read_Instruction(PC); + UGeckoInstruction inst = PowerPC::HostRead_Instruction(PC); if (inst.LK) { PowerPC::breakpoints.ClearAllTemporary(); @@ -329,7 +329,7 @@ void CCodeWindow::StepOut() u64 steps = 0; PowerPC::CoreMode oldMode = PowerPC::GetMode(); PowerPC::SetMode(PowerPC::MODE_INTERPRETER); - UGeckoInstruction inst = Memory::Read_Instruction(PC); + UGeckoInstruction inst = PowerPC::HostRead_Instruction(PC); while (inst.hex != 0x4e800020 && steps < timeout) // check for blr { if (inst.LK) @@ -347,7 +347,7 @@ void CCodeWindow::StepOut() PowerPC::SingleStep(); ++steps; } - inst = Memory::Read_Instruction(PC); + inst = PowerPC::HostRead_Instruction(PC); } PowerPC::SingleStep(); @@ -604,7 +604,7 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event) bool found = false; for (u32 addr = 0x80000000; addr < 0x80180000; addr += 4) { - const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr)); + const char *name = PPCTables::GetInstructionName(PowerPC::HostRead_U32(addr)); if (name && (wx_name == name)) { NOTICE_LOG(POWERPC, "Found %s at %08x", wx_name.c_str(), addr); -- cgit v1.2.3 From a60d3306b116d53735374730095f0231bae72a32 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Feb 2015 10:29:21 -0500 Subject: PowerPC: Get rid of magic numbers related to interp/JIT initialization. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index fcf42756ca..aa7e65c3b6 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -436,7 +436,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& core_startup_parameter " and stepping to work as explained in the Developer Documentation. But it can be very" " slow, perhaps slower than 1 fps."), wxITEM_CHECK); - interpreter->Check(core_startup_parameter.iCPUCore == SCoreStartupParameter::CORE_INTERPRETER); + interpreter->Check(core_startup_parameter.iCPUCore == PowerPC::CORE_INTERPRETER); pCoreMenu->AppendSeparator(); pCoreMenu->Append(IDM_JIT_NO_BLOCK_LINKING, _("&JIT Block Linking off"), -- cgit v1.2.3 From fd11f8fd290fbbfe23cf2e8de07e0a7ecbc094c5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Feb 2015 10:56:01 -0500 Subject: DolphinWX: Use AUI in the code window. Allows for resizing of the callstack, function call/callers windows etc. First step in slightly improving the code window. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 31 +++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index aa7e65c3b6..2b23f85ef9 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -75,31 +74,30 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter { InitBitmaps(); - wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL); - wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL); - DebugInterface* di = &PowerPC::debug_interface; codeview = new CCodeView(di, &g_symbolDB, this, wxID_ANY); - sizerBig->Add(sizerLeft, 2, wxEXPAND); - sizerBig->Add(codeview, 5, wxEXPAND); - sizerLeft->Add(callstack = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); + callstack = new wxListBox(this, wxID_ANY); callstack->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallstackListChange, this); - sizerLeft->Add(symbols = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND); + symbols = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); symbols->Bind(wxEVT_LISTBOX, &CCodeWindow::OnSymbolListChange, this); - sizerLeft->Add(calls = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + calls = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); calls->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallsListChange, this); - sizerLeft->Add(callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); callers->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallersListChange, this); - SetSizer(sizerBig); - - sizerLeft->Fit(this); - sizerBig->Fit(this); + m_aui_manager.SetManagedWindow(this); + m_aui_manager.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); + m_aui_manager.AddPane(callstack, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Callstack"))); + m_aui_manager.AddPane(symbols, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Symbols"))); + m_aui_manager.AddPane(calls, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Function calls"))); + m_aui_manager.AddPane(callers, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Function callers"))); + m_aui_manager.AddPane(codeview, wxAuiPaneInfo().CenterPane().CloseButton(false).Floatable(false)); + m_aui_manager.Update(); // Menu Bind(wxEVT_MENU, &CCodeWindow::OnCPUMode, this, IDM_INTERPRETER, IDM_JIT_SR_OFF); @@ -116,6 +114,11 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter Bind(wxEVT_HOST_COMMAND, &CCodeWindow::OnHostMessage, this); } +CCodeWindow::~CCodeWindow() +{ + m_aui_manager.UnInit(); +} + wxMenuBar *CCodeWindow::GetMenuBar() { return Parent->GetMenuBar(); -- cgit v1.2.3 From ce4b73388a6a690fb216eebe3911c8cde3d66779 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 25 Feb 2015 00:06:45 -0500 Subject: DolphinWX: Relocate the address search into the code window It's only function is in this pane. Leaving it on the main application toolbar not only looks gross, but subverts what a user might think it applies to. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 2b23f85ef9..8c7bbb4927 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -90,8 +91,19 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); callers->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallersListChange, this); + m_aui_toolbar = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORIZONTAL | wxAUI_TB_PLAIN_BACKGROUND); + + wxTextCtrl* const address_textctrl = new wxTextCtrl(m_aui_toolbar, IDM_ADDRBOX); + address_textctrl->Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this); + + m_aui_toolbar->AddControl(new wxStaticText(m_aui_toolbar, wxID_ANY, _("Address Search:"))); + m_aui_toolbar->AddSpacer(5); + m_aui_toolbar->AddControl(address_textctrl); + m_aui_toolbar->Realize(); + m_aui_manager.SetManagedWindow(this); m_aui_manager.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); + m_aui_manager.AddPane(m_aui_toolbar, wxAuiPaneInfo().ToolbarPane().Top().Floatable(false)); m_aui_manager.AddPane(callstack, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Callstack"))); m_aui_manager.AddPane(symbols, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Symbols"))); m_aui_manager.AddPane(calls, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Function calls"))); @@ -108,7 +120,6 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter // Toolbar Bind(wxEVT_MENU, &CCodeWindow::OnCodeStep, this, IDM_STEP, IDM_GOTOPC); - Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this, IDM_ADDRBOX); // Other Bind(wxEVT_HOST_COMMAND, &CCodeWindow::OnHostMessage, this); @@ -224,10 +235,7 @@ void CCodeWindow::OnCodeViewChange(wxCommandEvent &event) void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) { - if (!GetToolBar()) - return; - - wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX); + wxTextCtrl* pAddrCtrl = (wxTextCtrl*)m_aui_toolbar->FindControl(IDM_ADDRBOX); // Trim leading and trailing whitespace. wxString txt = pAddrCtrl->GetValue().Trim().Trim(false); @@ -676,8 +684,6 @@ void CCodeWindow::PopulateToolbar(wxToolBar* toolBar) toolBar->AddSeparator(); WxUtils::AddToolbarButton(toolBar, IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC], _("Go to the current instruction")); WxUtils::AddToolbarButton(toolBar, IDM_SETPC, _("Set PC"), m_Bitmaps[Toolbar_SetPC], _("Set the current instruction")); - toolBar->AddSeparator(); - toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, "")); } // Update GUI -- cgit v1.2.3 From 12155ddee45588b2d17a36e0ac037b2d79349e8c Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 7 Mar 2015 12:33:33 +1100 Subject: Added the ability to split the Debugger window horizontally and vertically via the Add Panes menu. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 8c7bbb4927..23f4d5c989 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -510,7 +510,13 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& core_startup_parameter pPerspectives->AppendSubMenu(Parent->m_SavedPerspectives, _("Saved perspectives")); Parent->PopulateSavedPerspectives(); pPerspectives->AppendSeparator(); - pPerspectives->Append(IDM_PERSPECTIVES_ADD_PANE, _("Add new pane")); + wxMenu* pAddPane = new wxMenu; + pPerspectives->AppendSubMenu(pAddPane, _("Add new pane to")); + pAddPane->Append(IDM_PERSPECTIVES_ADD_PANE_TOP, _("Top")); + pAddPane->Append(IDM_PERSPECTIVES_ADD_PANE_BOTTOM, _("Bottom")); + pAddPane->Append(IDM_PERSPECTIVES_ADD_PANE_LEFT, _("Left")); + pAddPane->Append(IDM_PERSPECTIVES_ADD_PANE_RIGHT, _("Right")); + pAddPane->Append(IDM_PERSPECTIVES_ADD_PANE_CENTER, _("Center")); pPerspectives->Append(IDM_TAB_SPLIT, _("Tab split"), "", wxITEM_CHECK); pPerspectives->Append(IDM_NO_DOCKING, _("Disable docking"), "Disable docking of perspective panes to main window", wxITEM_CHECK); -- 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/CodeWindow.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index 23f4d5c989..d8bc4bd13a 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -6,24 +6,15 @@ #include #include #include -#include -#include -#include -#include #include #include #include -#include #include #include -#include #include #include #include #include -#include -#include -#include #include #include "Common/BreakPoints.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/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index d8bc4bd13a..a550ee525b 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.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/CodeWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index a550ee525b..b6bbe2596b 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -1,4 +1,4 @@ -// Copyright 2013 Dolphin Emulator Project +// Copyright 2008 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. -- cgit v1.2.3