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/DSPDebugWindow.cpp | 279 ++++++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp new file mode 100644 index 0000000000..3be7432eca --- /dev/null +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -0,0 +1,279 @@ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#include "Common.h" +#include +#include +#include + +#include + +#include "../WxUtils.h" +#include "StringUtil.h" +#include "DSPDebugWindow.h" +#include "DSPRegisterView.h" +#include "CodeView.h" +#include "MemoryView.h" +#include "HW/DSPLLE/DSPSymbols.h" + +DSPDebuggerLLE* m_DebuggerFrame = NULL; + +BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel) + EVT_CLOSE(DSPDebuggerLLE::OnClose) + EVT_MENU_RANGE(ID_RUNTOOL, ID_SHOWPCTOOL, DSPDebuggerLLE::OnChangeState) + EVT_TEXT_ENTER(ID_ADDRBOX, DSPDebuggerLLE::OnAddrBoxChange) + EVT_LISTBOX(ID_SYMBOLLIST, DSPDebuggerLLE::OnSymbolListChange) +END_EVENT_TABLE() + + +DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) + : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, + wxTAB_TRAVERSAL, _("DSP LLE Debugger")) + , m_CachedStepCounter(-1) +{ + m_DebuggerFrame = this; + + // notify wxAUI which frame to use + m_mgr.SetManagedWindow(this); + m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); + + m_Toolbar = new wxAuiToolBar(this, ID_TOOLBAR, + wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_TEXT); + m_Toolbar->AddTool(ID_RUNTOOL, wxT("Pause"), + wxArtProvider::GetBitmap(wxART_TICK_MARK, wxART_OTHER, wxSize(10,10))); + m_Toolbar->AddTool(ID_STEPTOOL, wxT("Step"), + wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_OTHER, wxSize(10,10))); + m_Toolbar->AddTool(ID_SHOWPCTOOL, wxT("Show PC"), + wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_OTHER, wxSize(10,10))); + m_Toolbar->AddSeparator(); + m_Toolbar->AddControl(new wxTextCtrl(m_Toolbar, ID_ADDRBOX, wxEmptyString, + wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER)); + m_Toolbar->Realize(); + + m_SymbolList = new wxListBox(this, ID_SYMBOLLIST, wxDefaultPosition, + wxSize(140, 100), 0, NULL, wxLB_SORT); + + m_MainNotebook = new wxAuiNotebook(this, wxID_ANY, + wxDefaultPosition, wxDefaultSize, + wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE); + + wxPanel *code_panel = new wxPanel(m_MainNotebook, wxID_ANY); + wxBoxSizer *code_sizer = new wxBoxSizer(wxVERTICAL); + m_CodeView = new CCodeView(&debug_interface, &DSPSymbols::g_dsp_symbol_db, code_panel); + m_CodeView->SetPlain(); + code_sizer->Add(m_CodeView, 1, wxALL | wxEXPAND); + code_panel->SetSizer(code_sizer); + m_MainNotebook->AddPage(code_panel, wxT("Disasm"), true); + + wxPanel *mem_panel = new wxPanel(m_MainNotebook, wxID_ANY); + wxBoxSizer *mem_sizer = new wxBoxSizer(wxVERTICAL); + // TODO insert memViewer class + m_MemView = new CMemoryView(&debug_interface, mem_panel); + mem_sizer->Add(m_MemView, 1, wxALL | wxEXPAND); + mem_panel->SetSizer(mem_sizer); + m_MainNotebook->AddPage(mem_panel, wxT("Mem")); + + m_Regs = new DSPRegisterView(this, ID_DSP_REGS); + + // add the panes to the manager + m_mgr.AddPane(m_Toolbar, wxAuiPaneInfo(). + ToolbarPane().Top(). + LeftDockable(false).RightDockable(false)); + + m_mgr.AddPane(m_SymbolList, wxAuiPaneInfo(). + Left().CloseButton(false). + Caption(wxT("Symbols")).Dockable(true)); + + m_mgr.AddPane(m_MainNotebook, wxAuiPaneInfo(). + Name(wxT("m_MainNotebook")).Center(). + CloseButton(false).MaximizeButton(true)); + + m_mgr.AddPane(m_Regs, wxAuiPaneInfo().Right(). + CloseButton(false).Caption(wxT("Registers")). + Dockable(true)); + + UpdateState(); + + m_mgr.Update(); +} + +DSPDebuggerLLE::~DSPDebuggerLLE() +{ + m_mgr.UnInit(); + m_DebuggerFrame = NULL; +} + +void DSPDebuggerLLE::OnClose(wxCloseEvent& event) +{ + event.Skip(); +} + +void DSPDebuggerLLE::OnChangeState(wxCommandEvent& event) +{ + if (DSPCore_GetState() == DSPCORE_STOP) + return; + + switch (event.GetId()) + { + case ID_RUNTOOL: + if (DSPCore_GetState() == DSPCORE_RUNNING) + DSPCore_SetState(DSPCORE_STEPPING); + else + DSPCore_SetState(DSPCORE_RUNNING); + break; + + case ID_STEPTOOL: + if (DSPCore_GetState() == DSPCORE_STEPPING) + { + DSPCore_Step(); + Update(); + } + break; + + case ID_SHOWPCTOOL: + FocusOnPC(); + break; + } + + UpdateState(); + m_mgr.Update(); +} + +void Host_RefreshDSPDebuggerWindow() +{ + if (m_DebuggerFrame) + m_DebuggerFrame->Update(); +} + +void DSPDebuggerLLE::Update() +{ +#if defined __WXGTK__ + if (!wxIsMainThread()) + wxMutexGuiEnter(); +#endif + UpdateSymbolMap(); + UpdateDisAsmListView(); + UpdateRegisterFlags(); + UpdateState(); + m_mgr.Update(); +#if defined __WXGTK__ + if (!wxIsMainThread()) + wxMutexGuiLeave(); +#endif +} + +void DSPDebuggerLLE::FocusOnPC() +{ + JumpToAddress(g_dsp.pc); +} + +void DSPDebuggerLLE::UpdateState() +{ + if (DSPCore_GetState() == DSPCORE_RUNNING) + { + m_Toolbar->SetToolLabel(ID_RUNTOOL, wxT("Pause")); + m_Toolbar->SetToolBitmap(ID_RUNTOOL, + wxArtProvider::GetBitmap(wxART_TICK_MARK, wxART_OTHER, wxSize(10,10))); + m_Toolbar->EnableTool(ID_STEPTOOL, false); + } + else + { + m_Toolbar->SetToolLabel(ID_RUNTOOL, wxT("Run")); + m_Toolbar->SetToolBitmap(ID_RUNTOOL, + wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_OTHER, wxSize(10,10))); + m_Toolbar->EnableTool(ID_STEPTOOL, true); + } + m_Toolbar->Realize(); +} + +void DSPDebuggerLLE::UpdateDisAsmListView() +{ + if (m_CachedStepCounter == g_dsp.step_counter) + return; + + // show PC + FocusOnPC(); + m_CachedStepCounter = g_dsp.step_counter; + m_Regs->Update(); +} + +void DSPDebuggerLLE::UpdateSymbolMap() +{ + if (g_dsp.dram == NULL) + return; + + m_SymbolList->Freeze(); // HyperIris: wx style fast filling + m_SymbolList->Clear(); + for (SymbolDB::XFuncMap::iterator iter = DSPSymbols::g_dsp_symbol_db.GetIterator(); + iter != DSPSymbols::g_dsp_symbol_db.End(); ++iter) + { + int idx = m_SymbolList->Append(StrToWxStr(iter->second.name)); + m_SymbolList->SetClientData(idx, (void*)&iter->second); + } + m_SymbolList->Thaw(); +} + +void DSPDebuggerLLE::OnSymbolListChange(wxCommandEvent& event) +{ + int index = m_SymbolList->GetSelection(); + if (index >= 0) { + Symbol* pSymbol = static_cast(m_SymbolList->GetClientData(index)); + if (pSymbol != NULL) + { + if (pSymbol->type == Symbol::SYMBOL_FUNCTION) + { + JumpToAddress(pSymbol->address); + } + } + } +} + +void DSPDebuggerLLE::UpdateRegisterFlags() +{ +} + +void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event) +{ + wxTextCtrl* pAddrCtrl = (wxTextCtrl*)m_Toolbar->FindControl(ID_ADDRBOX); + wxString txt = pAddrCtrl->GetValue(); + + auto text = StripSpaces(WxStrToStr(txt)); + if (text.size()) + { + u32 addr; + sscanf(text.c_str(), "%04x", &addr); + if (JumpToAddress(addr)) + pAddrCtrl->SetBackgroundColour(*wxWHITE); + else + pAddrCtrl->SetBackgroundColour(*wxRED); + } + event.Skip(); +} + +bool DSPDebuggerLLE::JumpToAddress(u16 addr) +{ + int page = m_MainNotebook->GetSelection(); + if (page == 0) + { + // Center on valid instruction in IRAM/IROM + int new_line = DSPSymbols::Addr2Line(addr); + if (new_line >= 0) { + m_CodeView->Center(new_line); + return true; + } + } + else if (page == 1) + { + // Center on any location in any valid ROM/RAM + int seg = addr >> 12; + if (seg == 0 || seg == 1 || + seg == 8 || seg == 0xf) + { + m_MemView->Center(addr); + return true; + } + } + + return false; +} -- cgit v1.2.3 From 404624bf0b0125e5a408021c616ee9b9e2dde382 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Wed, 12 Feb 2014 16:00:34 +0100 Subject: Turn loops into range-based form and some things suggested by cppcheck and compiler warnings. --- Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 3be7432eca..48435c73a2 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -205,11 +205,10 @@ void DSPDebuggerLLE::UpdateSymbolMap() m_SymbolList->Freeze(); // HyperIris: wx style fast filling m_SymbolList->Clear(); - for (SymbolDB::XFuncMap::iterator iter = DSPSymbols::g_dsp_symbol_db.GetIterator(); - iter != DSPSymbols::g_dsp_symbol_db.End(); ++iter) + for (const auto& symbol : DSPSymbols::g_dsp_symbol_db.Symbols()) { - int idx = m_SymbolList->Append(StrToWxStr(iter->second.name)); - m_SymbolList->SetClientData(idx, (void*)&iter->second); + int idx = m_SymbolList->Append(StrToWxStr(symbol.second.name)); + m_SymbolList->SetClientData(idx, (void*)&symbol.second); } m_SymbolList->Thaw(); } -- 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/DSPDebugWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 48435c73a2..3a120cacb8 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -203,7 +203,7 @@ void DSPDebuggerLLE::UpdateSymbolMap() if (g_dsp.dram == NULL) return; - m_SymbolList->Freeze(); // HyperIris: wx style fast filling + m_SymbolList->Freeze(); // HyperIris: wx style fast filling m_SymbolList->Clear(); for (const auto& symbol : DSPSymbols::g_dsp_symbol_db.Symbols()) { -- 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/DSPDebugWindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 3a120cacb8..6dcb0e4e1c 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -2,20 +2,20 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include "Common.h" #include #include #include #include -#include "../WxUtils.h" -#include "StringUtil.h" -#include "DSPDebugWindow.h" -#include "DSPRegisterView.h" -#include "CodeView.h" -#include "MemoryView.h" -#include "HW/DSPLLE/DSPSymbols.h" +#include "Common/Common.h" +#include "Common/StringUtil.h" +#include "Core/HW/DSPLLE/DSPSymbols.h" +#include "DolphinWX/WxUtils.h" +#include "DolphinWX/Debugger/CodeView.h" +#include "DolphinWX/Debugger/DSPDebugWindow.h" +#include "DolphinWX/Debugger/DSPRegisterView.h" +#include "DolphinWX/Debugger/MemoryView.h" DSPDebuggerLLE* m_DebuggerFrame = NULL; -- 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/DSPDebugWindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 6dcb0e4e1c..681209c39c 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include #include +#include #include - #include #include "Common/Common.h" -- cgit v1.2.3 From f344a43657f609343fec125f374e014692e4ca6a Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sat, 22 Feb 2014 23:36:30 +0100 Subject: Make DolphinWX/ mostly IWYU clean. --- Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp | 24 ++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 681209c39c..b755af5993 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -2,13 +2,29 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "Common/Common.h" #include "Common/StringUtil.h" +#include "Common/SymbolDB.h" +#include "Core/DSP/DSPCore.h" +#include "Core/HW/DSPLLE/DSPDebugInterface.h" #include "Core/HW/DSPLLE/DSPSymbols.h" #include "DolphinWX/WxUtils.h" #include "DolphinWX/Debugger/CodeView.h" @@ -16,6 +32,8 @@ #include "DolphinWX/Debugger/DSPRegisterView.h" #include "DolphinWX/Debugger/MemoryView.h" +class wxWindow; + DSPDebuggerLLE* m_DebuggerFrame = NULL; BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel) -- 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/DSPDebugWindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index b755af5993..f9fd51eec0 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -34,7 +34,7 @@ class wxWindow; -DSPDebuggerLLE* m_DebuggerFrame = NULL; +DSPDebuggerLLE* m_DebuggerFrame = nullptr; BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel) EVT_CLOSE(DSPDebuggerLLE::OnClose) @@ -69,7 +69,7 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) m_Toolbar->Realize(); m_SymbolList = new wxListBox(this, ID_SYMBOLLIST, wxDefaultPosition, - wxSize(140, 100), 0, NULL, wxLB_SORT); + wxSize(140, 100), 0, nullptr, wxLB_SORT); m_MainNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, @@ -118,7 +118,7 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) DSPDebuggerLLE::~DSPDebuggerLLE() { m_mgr.UnInit(); - m_DebuggerFrame = NULL; + m_DebuggerFrame = nullptr; } void DSPDebuggerLLE::OnClose(wxCloseEvent& event) @@ -217,7 +217,7 @@ void DSPDebuggerLLE::UpdateDisAsmListView() void DSPDebuggerLLE::UpdateSymbolMap() { - if (g_dsp.dram == NULL) + if (g_dsp.dram == nullptr) return; m_SymbolList->Freeze(); // HyperIris: wx style fast filling @@ -235,7 +235,7 @@ void DSPDebuggerLLE::OnSymbolListChange(wxCommandEvent& event) int index = m_SymbolList->GetSelection(); if (index >= 0) { Symbol* pSymbol = static_cast(m_SymbolList->GetClientData(index)); - if (pSymbol != NULL) + if (pSymbol != nullptr) { if (pSymbol->type == Symbol::SYMBOL_FUNCTION) { -- 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/DSPDebugWindow.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index f9fd51eec0..56b729e999 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -57,11 +57,11 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) m_Toolbar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_TEXT); - m_Toolbar->AddTool(ID_RUNTOOL, wxT("Pause"), + m_Toolbar->AddTool(ID_RUNTOOL, _("Pause"), wxArtProvider::GetBitmap(wxART_TICK_MARK, wxART_OTHER, wxSize(10,10))); - m_Toolbar->AddTool(ID_STEPTOOL, wxT("Step"), + m_Toolbar->AddTool(ID_STEPTOOL, _("Step"), wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_OTHER, wxSize(10,10))); - m_Toolbar->AddTool(ID_SHOWPCTOOL, wxT("Show PC"), + m_Toolbar->AddTool(ID_SHOWPCTOOL, _("Show PC"), wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_OTHER, wxSize(10,10))); m_Toolbar->AddSeparator(); m_Toolbar->AddControl(new wxTextCtrl(m_Toolbar, ID_ADDRBOX, wxEmptyString, @@ -81,7 +81,7 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) m_CodeView->SetPlain(); code_sizer->Add(m_CodeView, 1, wxALL | wxEXPAND); code_panel->SetSizer(code_sizer); - m_MainNotebook->AddPage(code_panel, wxT("Disasm"), true); + m_MainNotebook->AddPage(code_panel, _("Disassembly"), true); wxPanel *mem_panel = new wxPanel(m_MainNotebook, wxID_ANY); wxBoxSizer *mem_sizer = new wxBoxSizer(wxVERTICAL); @@ -89,7 +89,7 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) m_MemView = new CMemoryView(&debug_interface, mem_panel); mem_sizer->Add(m_MemView, 1, wxALL | wxEXPAND); mem_panel->SetSizer(mem_sizer); - m_MainNotebook->AddPage(mem_panel, wxT("Mem")); + m_MainNotebook->AddPage(mem_panel, _("Memory")); m_Regs = new DSPRegisterView(this, ID_DSP_REGS); @@ -100,14 +100,14 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) m_mgr.AddPane(m_SymbolList, wxAuiPaneInfo(). Left().CloseButton(false). - Caption(wxT("Symbols")).Dockable(true)); + Caption(_("Symbols")).Dockable(true)); m_mgr.AddPane(m_MainNotebook, wxAuiPaneInfo(). - Name(wxT("m_MainNotebook")).Center(). + Name("m_MainNotebook").Center(). CloseButton(false).MaximizeButton(true)); m_mgr.AddPane(m_Regs, wxAuiPaneInfo().Right(). - CloseButton(false).Caption(wxT("Registers")). + CloseButton(false).Caption(_("Registers")). Dockable(true)); UpdateState(); @@ -189,14 +189,14 @@ void DSPDebuggerLLE::UpdateState() { if (DSPCore_GetState() == DSPCORE_RUNNING) { - m_Toolbar->SetToolLabel(ID_RUNTOOL, wxT("Pause")); + m_Toolbar->SetToolLabel(ID_RUNTOOL, _("Pause")); m_Toolbar->SetToolBitmap(ID_RUNTOOL, wxArtProvider::GetBitmap(wxART_TICK_MARK, wxART_OTHER, wxSize(10,10))); m_Toolbar->EnableTool(ID_STEPTOOL, false); } else { - m_Toolbar->SetToolLabel(ID_RUNTOOL, wxT("Run")); + m_Toolbar->SetToolLabel(ID_RUNTOOL, _("Run")); m_Toolbar->SetToolBitmap(ID_RUNTOOL, wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_OTHER, wxSize(10,10))); m_Toolbar->EnableTool(ID_STEPTOOL, true); -- cgit v1.2.3 From 22e1aa5bb4a159d6d66a321f978917614aa36331 Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 8 Jul 2014 14:29:26 +0200 Subject: mark all local functions as static --- Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 56b729e999..857f681e20 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -23,6 +23,7 @@ #include "Common/Common.h" #include "Common/StringUtil.h" #include "Common/SymbolDB.h" +#include "Core/Host.h" #include "Core/DSP/DSPCore.h" #include "Core/HW/DSPLLE/DSPDebugInterface.h" #include "Core/HW/DSPLLE/DSPSymbols.h" -- cgit v1.2.3 From 7e79806efcd5c5e41efea89fa385b480ac1882f5 Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 8 Jul 2014 22:37:58 +0200 Subject: remove unused globals Also change globals into statics which are only used in one file --- Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 857f681e20..9e606c4016 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -35,7 +35,7 @@ class wxWindow; -DSPDebuggerLLE* m_DebuggerFrame = nullptr; +static DSPDebuggerLLE* m_DebuggerFrame = nullptr; BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel) EVT_CLOSE(DSPDebuggerLLE::OnClose) -- cgit v1.2.3 From 8553b0f27b50ef6b78e043c349a0c3a983293d4b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 30 Aug 2014 17:01:19 -0400 Subject: DolphinWX: Clean up brace placements --- Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 9e606c4016..b2a9ac7ea2 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -234,7 +234,8 @@ void DSPDebuggerLLE::UpdateSymbolMap() void DSPDebuggerLLE::OnSymbolListChange(wxCommandEvent& event) { int index = m_SymbolList->GetSelection(); - if (index >= 0) { + if (index >= 0) + { Symbol* pSymbol = static_cast(m_SymbolList->GetClientData(index)); if (pSymbol != nullptr) { @@ -275,7 +276,8 @@ bool DSPDebuggerLLE::JumpToAddress(u16 addr) { // Center on valid instruction in IRAM/IROM int new_line = DSPSymbols::Addr2Line(addr); - if (new_line >= 0) { + if (new_line >= 0) + { m_CodeView->Center(new_line); return true; } -- 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/DSPDebugWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index b2a9ac7ea2..917945522e 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -20,7 +20,7 @@ #include #include -#include "Common/Common.h" +#include "Common/CommonTypes.h" #include "Common/StringUtil.h" #include "Common/SymbolDB.h" #include "Core/Host.h" -- 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/DSPDebugWindow.cpp | 30 ++++++++++------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 917945522e..830bfe97a3 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -33,23 +33,16 @@ #include "DolphinWX/Debugger/DSPRegisterView.h" #include "DolphinWX/Debugger/MemoryView.h" -class wxWindow; - static DSPDebuggerLLE* m_DebuggerFrame = nullptr; -BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel) - EVT_CLOSE(DSPDebuggerLLE::OnClose) - EVT_MENU_RANGE(ID_RUNTOOL, ID_SHOWPCTOOL, DSPDebuggerLLE::OnChangeState) - EVT_TEXT_ENTER(ID_ADDRBOX, DSPDebuggerLLE::OnAddrBoxChange) - EVT_LISTBOX(ID_SYMBOLLIST, DSPDebuggerLLE::OnSymbolListChange) -END_EVENT_TABLE() - - DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("DSP LLE Debugger")) , m_CachedStepCounter(-1) { + Bind(wxEVT_CLOSE_WINDOW, &DSPDebuggerLLE::OnClose, this); + Bind(wxEVT_MENU, &DSPDebuggerLLE::OnChangeState, this, ID_RUNTOOL, ID_SHOWPCTOOL); + m_DebuggerFrame = this; // notify wxAUI which frame to use @@ -65,12 +58,16 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) m_Toolbar->AddTool(ID_SHOWPCTOOL, _("Show PC"), wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_OTHER, wxSize(10,10))); m_Toolbar->AddSeparator(); - m_Toolbar->AddControl(new wxTextCtrl(m_Toolbar, ID_ADDRBOX, wxEmptyString, - wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER)); + + m_addr_txtctrl = new wxTextCtrl(m_Toolbar, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); + m_addr_txtctrl->Bind(wxEVT_TEXT_ENTER, &DSPDebuggerLLE::OnAddrBoxChange, this); + + m_Toolbar->AddControl(m_addr_txtctrl); m_Toolbar->Realize(); - m_SymbolList = new wxListBox(this, ID_SYMBOLLIST, wxDefaultPosition, + m_SymbolList = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(140, 100), 0, nullptr, wxLB_SORT); + m_SymbolList->Bind(wxEVT_LISTBOX, &DSPDebuggerLLE::OnSymbolListChange, this); m_MainNotebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, @@ -253,8 +250,7 @@ void DSPDebuggerLLE::UpdateRegisterFlags() void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event) { - wxTextCtrl* pAddrCtrl = (wxTextCtrl*)m_Toolbar->FindControl(ID_ADDRBOX); - wxString txt = pAddrCtrl->GetValue(); + wxString txt = m_addr_txtctrl->GetValue(); auto text = StripSpaces(WxStrToStr(txt)); if (text.size()) @@ -262,9 +258,9 @@ void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event) u32 addr; sscanf(text.c_str(), "%04x", &addr); if (JumpToAddress(addr)) - pAddrCtrl->SetBackgroundColour(*wxWHITE); + m_addr_txtctrl->SetBackgroundColour(*wxWHITE); else - pAddrCtrl->SetBackgroundColour(*wxRED); + m_addr_txtctrl->SetBackgroundColour(*wxRED); } event.Skip(); } -- cgit v1.2.3 From 73b77f55bab2a18b52b3b8e62fa287e7f0b502d4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 28 Jan 2015 14:01:11 -0500 Subject: DSPDebugWindow: Fix issue where the DSPLLE window would hang Dolphin on OSX --- Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 830bfe97a3..a9195cab9a 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -171,7 +171,6 @@ void DSPDebuggerLLE::Update() UpdateDisAsmListView(); UpdateRegisterFlags(); UpdateState(); - m_mgr.Update(); #if defined __WXGTK__ if (!wxIsMainThread()) wxMutexGuiLeave(); -- cgit v1.2.3 From 30c91a300377d7ddf86931acb655be78fa10b5ad Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Feb 2015 08:31:50 -0500 Subject: DolphinWX: Remove unnecessary control IDs These don't need to be specifically identified. --- Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index a9195cab9a..0c04fa3daf 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -89,7 +89,7 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) mem_panel->SetSizer(mem_sizer); m_MainNotebook->AddPage(mem_panel, _("Memory")); - m_Regs = new DSPRegisterView(this, ID_DSP_REGS); + m_Regs = new DSPRegisterView(this); // add the panes to the manager m_mgr.AddPane(m_Toolbar, wxAuiPaneInfo(). -- 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/DSPDebugWindow.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 0c04fa3daf..a0edbc96df 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -4,18 +4,11 @@ #include #include -#include -#include -#include -#include #include #include #include -#include #include #include -#include -#include #include #include #include -- 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/DSPDebugWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index a0edbc96df..df328b5b3b 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.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/DSPDebugWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp') diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index df328b5b3b..ce65c0834c 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -1,4 +1,4 @@ -// Copyright 2013 Dolphin Emulator Project +// Copyright 2009 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. -- cgit v1.2.3