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/CodeView.cpp | 573 ++++++++++++++++++++++++++++ 1 file changed, 573 insertions(+) create mode 100644 Source/Core/DolphinWX/Debugger/CodeView.cpp (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp new file mode 100644 index 0000000000..b4d6c4378d --- /dev/null +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -0,0 +1,573 @@ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#include "Common.h" +#include "StringUtil.h" +#include "DebuggerUIUtil.h" +#include "DebugInterface.h" + +#include "Host.h" +#include "CodeView.h" +#include "SymbolDB.h" +#include "../WxUtils.h" + +#include +#include +#include + +DEFINE_EVENT_TYPE(wxEVT_CODEVIEW_CHANGE); + +enum +{ + IDM_GOTOINMEMVIEW = 12000, + IDM_COPYADDRESS, + IDM_COPYHEX, + IDM_COPYCODE, + IDM_INSERTBLR, IDM_INSERTNOP, + IDM_RUNTOHERE, + IDM_JITRESULTS, + IDM_FOLLOWBRANCH, + IDM_RENAMESYMBOL, + IDM_PATCHALERT, + IDM_COPYFUNCTION, + IDM_ADDFUNCTION, +}; + +BEGIN_EVENT_TABLE(CCodeView, wxControl) + EVT_ERASE_BACKGROUND(CCodeView::OnErase) + EVT_PAINT(CCodeView::OnPaint) + EVT_LEFT_DOWN(CCodeView::OnMouseDown) + EVT_LEFT_UP(CCodeView::OnMouseUpL) + EVT_MOTION(CCodeView::OnMouseMove) + EVT_RIGHT_DOWN(CCodeView::OnMouseDown) + EVT_RIGHT_UP(CCodeView::OnMouseUpR) + EVT_MENU(-1, CCodeView::OnPopupMenu) + EVT_SIZE(CCodeView::OnResize) +END_EVENT_TABLE() + +CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, + wxWindow* parent, wxWindowID Id) + : wxControl(parent, Id), + debugger(debuginterface), + symbol_db(symboldb), + plain(false), + curAddress(debuginterface->getPC()), + align(debuginterface->getInstructionSize(0)), + rowHeight(13), + selection(0), + oldSelection(0), + selecting(false), + lx(-1), + ly(-1) +{ +} + +int CCodeView::YToAddress(int y) +{ + wxRect rc = GetClientRect(); + int ydiff = y - rc.height / 2 - rowHeight / 2; + ydiff = (int)(floorf((float)ydiff / (float)rowHeight)) + 1; + return curAddress + ydiff * align; +} + +void CCodeView::OnMouseDown(wxMouseEvent& event) +{ + int x = event.m_x; + int y = event.m_y; + + if (x > 16) + { + oldSelection = selection; + selection = YToAddress(y); + // SetCapture(wnd); + bool oldselecting = selecting; + selecting = true; + + if (!oldselecting || (selection != oldSelection)) + Refresh(); + } + else + { + ToggleBreakpoint(YToAddress(y)); + } + + event.Skip(true); +} + +void CCodeView::ToggleBreakpoint(u32 address) +{ + debugger->toggleBreakpoint(address); + Refresh(); + Host_UpdateBreakPointView(); +} + +void CCodeView::OnMouseMove(wxMouseEvent& event) +{ + wxRect rc = GetClientRect(); + + if (event.m_leftDown && event.m_x > 16) + { + if (event.m_y < 0) + { + curAddress -= align; + Refresh(); + } + else if (event.m_y > rc.height) + { + curAddress += align; + Refresh(); + } + else + { + OnMouseDown(event); + } + } + + event.Skip(true); +} + +void CCodeView::RaiseEvent() +{ + wxCommandEvent ev(wxEVT_CODEVIEW_CHANGE, GetId()); + ev.SetEventObject(this); + ev.SetInt(selection); + GetEventHandler()->ProcessEvent(ev); +} + +void CCodeView::OnMouseUpL(wxMouseEvent& event) +{ + if (event.m_x > 16) + { + curAddress = YToAddress(event.m_y); + selecting = false; + Refresh(); + } + RaiseEvent(); + event.Skip(true); +} + +u32 CCodeView::AddrToBranch(u32 addr) +{ + char disasm[256]; + debugger->disasm(addr, disasm, 256); + const char *mojs = strstr(disasm, "->0x"); + if (mojs) + { + u32 dest; + sscanf(mojs+4,"%08x", &dest); + return dest; + } + return 0; +} + +void CCodeView::InsertBlrNop(int Blr) +{ + // Check if this address has been modified + int find = -1; + for(u32 i = 0; i < BlrList.size(); i++) + { + if(BlrList.at(i).Address == selection) + { + find = i; + break; + } + } + + // Save the old value + if (find >= 0) + { + debugger->writeExtraMemory(0, BlrList.at(find).OldValue, selection); + BlrList.erase(BlrList.begin() + find); + } + else + { + BlrStruct Temp; + Temp.Address = selection; + Temp.OldValue = debugger->readMemory(selection); + BlrList.push_back(Temp); + if (Blr == 0) + debugger->insertBLR(selection, 0x4e800020); + else + debugger->insertBLR(selection, 0x60000000); + } + Refresh(); +} + +void CCodeView::OnPopupMenu(wxCommandEvent& event) +{ +#if wxUSE_CLIPBOARD + wxTheClipboard->Open(); +#endif + + switch (event.GetId()) + { + case IDM_GOTOINMEMVIEW: + // CMemoryDlg::Goto(selection); + break; + +#if wxUSE_CLIPBOARD + case IDM_COPYADDRESS: + wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection))); + break; + + case IDM_COPYCODE: + { + char disasm[256]; + debugger->disasm(selection, disasm, 256); + wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(disasm))); + } + break; + + case IDM_COPYHEX: + { + char temp[24]; + sprintf(temp, "%08x", debugger->readInstruction(selection)); + wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp))); + } + break; + + + case IDM_COPYFUNCTION: + { + Symbol *symbol = symbol_db->GetSymbolFromAddr(selection); + if (symbol) + { + std::string text; + text = text + symbol->name + "\r\n"; + // we got a function + u32 start = symbol->address; + u32 end = start + symbol->size; + for (u32 addr = start; addr != end; addr += 4) + { + char disasm[256]; + debugger->disasm(addr, disasm, 256); + text = text + StringFromFormat("%08x: ", addr) + disasm + "\r\n"; + } + wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(text))); + } + } + break; +#endif + + case IDM_RUNTOHERE: + debugger->setBreakpoint(selection); + debugger->runToBreakpoint(); + Refresh(); + break; + + // Insert blr or restore old value + case IDM_INSERTBLR: + InsertBlrNop(0); + Refresh(); + break; + case IDM_INSERTNOP: + InsertBlrNop(1); + Refresh(); + break; + + case IDM_JITRESULTS: + debugger->showJitResults(selection); + break; + + case IDM_FOLLOWBRANCH: + { + u32 dest = AddrToBranch(selection); + if (dest) + { + Center(dest); + RaiseEvent(); + } + } + break; + + case IDM_ADDFUNCTION: + symbol_db->AddFunction(selection); + Host_NotifyMapLoaded(); + break; + + case IDM_RENAMESYMBOL: + { + Symbol *symbol = symbol_db->GetSymbolFromAddr(selection); + if (symbol) + { + wxTextEntryDialog input_symbol(this, StrToWxStr("Rename symbol:"), + wxGetTextFromUserPromptStr, + StrToWxStr(symbol->name)); + if (input_symbol.ShowModal() == wxID_OK) + { + symbol->name = WxStrToStr(input_symbol.GetValue()); + Refresh(); // Redraw to show the renamed symbol + } + Host_NotifyMapLoaded(); + } + } + break; + + case IDM_PATCHALERT: + break; + } + +#if wxUSE_CLIPBOARD + wxTheClipboard->Close(); +#endif + event.Skip(true); +} + +void CCodeView::OnMouseUpR(wxMouseEvent& event) +{ + bool isSymbol = symbol_db->GetSymbolFromAddr(selection) != 0; + // popup menu + wxMenu* menu = new wxMenu; + //menu->Append(IDM_GOTOINMEMVIEW, "&Goto in mem view"); + menu->Append(IDM_FOLLOWBRANCH, + StrToWxStr("&Follow branch"))->Enable(AddrToBranch(selection) ? true : false); + menu->AppendSeparator(); +#if wxUSE_CLIPBOARD + menu->Append(IDM_COPYADDRESS, StrToWxStr("Copy &address")); + menu->Append(IDM_COPYFUNCTION, StrToWxStr("Copy &function"))->Enable(isSymbol); + menu->Append(IDM_COPYCODE, StrToWxStr("Copy &code line")); + menu->Append(IDM_COPYHEX, StrToWxStr("Copy &hex")); + menu->AppendSeparator(); +#endif + menu->Append(IDM_RENAMESYMBOL, StrToWxStr("Rename &symbol"))->Enable(isSymbol); + menu->AppendSeparator(); + menu->Append(IDM_RUNTOHERE, _("&Run To Here")); + menu->Append(IDM_ADDFUNCTION, _("&Add function")); + menu->Append(IDM_JITRESULTS, StrToWxStr("PPC vs X86")); + menu->Append(IDM_INSERTBLR, StrToWxStr("Insert &blr")); + menu->Append(IDM_INSERTNOP, StrToWxStr("Insert &nop")); + menu->Append(IDM_PATCHALERT, StrToWxStr("Patch alert")); + PopupMenu(menu); + event.Skip(true); +} + +void CCodeView::OnErase(wxEraseEvent& event) +{} + +void CCodeView::OnPaint(wxPaintEvent& event) +{ + // -------------------------------------------------------------------- + // General settings + // ------------------------- + wxPaintDC dc(this); + wxRect rc = GetClientRect(); + + dc.SetFont(DebuggerFont); + + wxCoord w,h; + dc.GetTextExtent(_T("0WJyq"),&w,&h); + + if (h > rowHeight) + rowHeight = h; + + dc.GetTextExtent(_T("W"),&w,&h); + int charWidth = w; + + struct branch + { + int src, dst, srcAddr; + }; + + branch branches[256]; + int numBranches = 0; + // TODO: Add any drawing code here... + int width = rc.width; + int numRows = (rc.height / rowHeight) / 2 + 2; + // ------------ + + // -------------------------------------------------------------------- + // Colors and brushes + // ------------------------- + dc.SetBackgroundMode(wxTRANSPARENT); // the text background + const wxChar* bgColor = _T("#ffffff"); + wxPen nullPen(bgColor); + wxPen currentPen(_T("#000000")); + wxPen selPen(_T("#808080")); // gray + nullPen.SetStyle(wxTRANSPARENT); + currentPen.SetStyle(wxSOLID); + wxBrush currentBrush(_T("#FFEfE8")); // light gray + wxBrush pcBrush(_T("#70FF70")); // green + wxBrush bpBrush(_T("#FF3311")); // red + + wxBrush bgBrush(bgColor); + wxBrush nullBrush(bgColor); + nullBrush.SetStyle(wxTRANSPARENT); + + dc.SetPen(nullPen); + dc.SetBrush(bgBrush); + dc.DrawRectangle(0, 0, 16, rc.height); + dc.DrawRectangle(0, 0, rc.width, 5); + // ------------ + + // -------------------------------------------------------------------- + // Walk through all visible rows + // ------------------------- + for (int i = -numRows; i <= numRows; i++) + { + unsigned int address = curAddress + i * align; + + int rowY1 = rc.height / 2 + rowHeight * i - rowHeight / 2; + int rowY2 = rc.height / 2 + rowHeight * i + rowHeight / 2; + + wxString temp = wxString::Format(_T("%08x"), address); + u32 col = debugger->getColor(address); + wxBrush rowBrush(wxColor(col >> 16, col >> 8, col)); + dc.SetBrush(nullBrush); + dc.SetPen(nullPen); + dc.DrawRectangle(0, rowY1, 16, rowY2 - rowY1 + 2); + + if (selecting && (address == selection)) + dc.SetPen(selPen); + else + dc.SetPen(i == 0 ? currentPen : nullPen); + + if (address == debugger->getPC()) + dc.SetBrush(pcBrush); + else + dc.SetBrush(rowBrush); + + dc.DrawRectangle(16, rowY1, width, rowY2 - rowY1 + 1); + dc.SetBrush(currentBrush); + if (!plain) + { + dc.SetTextForeground(_T("#600000")); // the address text is dark red + dc.DrawText(temp, 17, rowY1); + dc.SetTextForeground(_T("#000000")); + } + + // If running + if (debugger->isAlive()) + { + char dis[256]; + debugger->disasm(address, dis, 256); + char* dis2 = strchr(dis, '\t'); + char desc[256] = ""; + + // If we have a code + if (dis2) + { + *dis2 = 0; + dis2++; + // look for hex strings to decode branches + const char* mojs = strstr(dis2, "0x8"); + if (mojs) + { + for (int k = 0; k < 8; k++) + { + bool found = false; + for (int j = 0; j < 22; j++) + { + if (mojs[k + 2] == "0123456789ABCDEFabcdef"[j]) + found = true; + } + if (!found) + { + mojs = 0; + break; + } + } + } + if (mojs) + { + int offs; + sscanf(mojs + 2, "%08x", &offs); + branches[numBranches].src = rowY1 + rowHeight / 2; + branches[numBranches].srcAddr = address / align; + branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * rowHeight / align + rowHeight / 2); + sprintf(desc, "-->%s", debugger->getDescription(offs).c_str()); + dc.SetTextForeground(_T("#600060")); // the -> arrow illustrations are purple + } + else + { + dc.SetTextForeground(_T("#000000")); + } + + dc.DrawText(StrToWxStr(dis2), 17 + 17*charWidth, rowY1); + // ------------ + } + + // Show blr as its' own color + if (strcmp(dis, "blr")) + dc.SetTextForeground(_T("#007000")); // dark green + else + dc.SetTextForeground(_T("#8000FF")); // purple + + dc.DrawText(StrToWxStr(dis), 17 + (plain ? 1*charWidth : 9*charWidth), rowY1); + + if (desc[0] == 0) + { + strcpy(desc, debugger->getDescription(address).c_str()); + } + + if (!plain) + { + dc.SetTextForeground(_T("#0000FF")); // blue + + //char temp[256]; + //UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE); + if (strlen(desc)) + { + dc.DrawText(StrToWxStr(desc), 17 + 35 * charWidth, rowY1); + } + } + + // Show red breakpoint dot + if (debugger->isBreakpoint(address)) + { + dc.SetBrush(bpBrush); + dc.DrawRectangle(2, rowY1 + 1, 11, 11); + } + } + } // end of for + // ------------ + + // -------------------------------------------------------------------- + // Colors and brushes + // ------------------------- + dc.SetPen(currentPen); + + for (int i = 0; i < numBranches; i++) + { + int x = 17 + 49 * charWidth + (branches[i].srcAddr % 9) * 8; + _MoveTo(x-2, branches[i].src); + + if (branches[i].dst < rc.height + 400 && branches[i].dst > -400) + { + _LineTo(dc, x+2, branches[i].src); + _LineTo(dc, x+2, branches[i].dst); + _LineTo(dc, x-4, branches[i].dst); + + _MoveTo(x, branches[i].dst - 4); + _LineTo(dc, x-4, branches[i].dst); + _LineTo(dc, x+1, branches[i].dst+5); + } + //else + //{ + // This can be re-enabled when there is a scrollbar or + // something on the codeview (the lines are too long) + + //_LineTo(dc, x+4, branches[i].src); + //_MoveTo(x+2, branches[i].dst-4); + //_LineTo(dc, x+6, branches[i].dst); + //_LineTo(dc, x+1, branches[i].dst+5); + //} + + //_LineTo(dc, x, branches[i].dst+4); + //_LineTo(dc, x-2, branches[i].dst); + } + // ------------ +} + +void CCodeView::_LineTo(wxPaintDC &dc, int x, int y) +{ + dc.DrawLine(lx, ly, x, y); + lx = x; + ly = y; +} + +void CCodeView::OnResize(wxSizeEvent& event) +{ + Refresh(); + event.Skip(); +} -- 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/CodeView.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index b4d6c4378d..9dc5237461 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -2,20 +2,19 @@ // Licensed under GPLv2 // Refer to the license.txt file included. -#include "Common.h" -#include "StringUtil.h" -#include "DebuggerUIUtil.h" -#include "DebugInterface.h" - -#include "Host.h" -#include "CodeView.h" -#include "SymbolDB.h" -#include "../WxUtils.h" - -#include #include +#include #include +#include "Common/Common.h" +#include "Common/DebugInterface.h" +#include "Common/StringUtil.h" +#include "Common/SymbolDB.h" +#include "Core/Host.h" +#include "DolphinWX/WxUtils.h" +#include "DolphinWX/Debugger/CodeView.h" +#include "DolphinWX/Debugger/DebuggerUIUtil.h" + DEFINE_EVENT_TYPE(wxEVT_CODEVIEW_CHANGE); enum -- 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/CodeView.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 9dc5237461..bd27777399 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -2,9 +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 +#include +#include #include "Common/Common.h" #include "Common/DebugInterface.h" -- cgit v1.2.3 From 279a8c014804499b150ec9c41276a6b6c912a874 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 3 Mar 2014 00:39:08 -0500 Subject: Change the DebugInterface, PPCDebugInterface, and DSPDebugInterface to use CamelCase names. This is the standard coding convention in the codebase, so our interfaces should use it too. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index bd27777399..04abd447cb 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -71,8 +71,8 @@ CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, debugger(debuginterface), symbol_db(symboldb), plain(false), - curAddress(debuginterface->getPC()), - align(debuginterface->getInstructionSize(0)), + curAddress(debuginterface->GetPC()), + align(debuginterface->GetInstructionSize(0)), rowHeight(13), selection(0), oldSelection(0), @@ -116,7 +116,7 @@ void CCodeView::OnMouseDown(wxMouseEvent& event) void CCodeView::ToggleBreakpoint(u32 address) { - debugger->toggleBreakpoint(address); + debugger->ToggleBreakpoint(address); Refresh(); Host_UpdateBreakPointView(); } @@ -169,7 +169,7 @@ void CCodeView::OnMouseUpL(wxMouseEvent& event) u32 CCodeView::AddrToBranch(u32 addr) { char disasm[256]; - debugger->disasm(addr, disasm, 256); + debugger->Disassemble(addr, disasm, 256); const char *mojs = strstr(disasm, "->0x"); if (mojs) { @@ -196,19 +196,19 @@ void CCodeView::InsertBlrNop(int Blr) // Save the old value if (find >= 0) { - debugger->writeExtraMemory(0, BlrList.at(find).OldValue, selection); + debugger->WriteExtraMemory(0, BlrList.at(find).OldValue, selection); BlrList.erase(BlrList.begin() + find); } else { BlrStruct Temp; Temp.Address = selection; - Temp.OldValue = debugger->readMemory(selection); + Temp.OldValue = debugger->ReadMemory(selection); BlrList.push_back(Temp); if (Blr == 0) - debugger->insertBLR(selection, 0x4e800020); + debugger->InsertBLR(selection, 0x4e800020); else - debugger->insertBLR(selection, 0x60000000); + debugger->InsertBLR(selection, 0x60000000); } Refresh(); } @@ -233,7 +233,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) case IDM_COPYCODE: { char disasm[256]; - debugger->disasm(selection, disasm, 256); + debugger->Disassemble(selection, disasm, 256); wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(disasm))); } break; @@ -241,7 +241,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) case IDM_COPYHEX: { char temp[24]; - sprintf(temp, "%08x", debugger->readInstruction(selection)); + sprintf(temp, "%08x", debugger->ReadInstruction(selection)); wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp))); } break; @@ -260,7 +260,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) for (u32 addr = start; addr != end; addr += 4) { char disasm[256]; - debugger->disasm(addr, disasm, 256); + debugger->Disassemble(addr, disasm, 256); text = text + StringFromFormat("%08x: ", addr) + disasm + "\r\n"; } wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(text))); @@ -270,8 +270,8 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) #endif case IDM_RUNTOHERE: - debugger->setBreakpoint(selection); - debugger->runToBreakpoint(); + debugger->SetBreakpoint(selection); + debugger->RunToBreakpoint(); Refresh(); break; @@ -286,7 +286,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) break; case IDM_JITRESULTS: - debugger->showJitResults(selection); + debugger->ShowJitResults(selection); break; case IDM_FOLLOWBRANCH: @@ -430,7 +430,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) int rowY2 = rc.height / 2 + rowHeight * i + rowHeight / 2; wxString temp = wxString::Format(_T("%08x"), address); - u32 col = debugger->getColor(address); + u32 col = debugger->GetColor(address); wxBrush rowBrush(wxColor(col >> 16, col >> 8, col)); dc.SetBrush(nullBrush); dc.SetPen(nullPen); @@ -441,7 +441,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) else dc.SetPen(i == 0 ? currentPen : nullPen); - if (address == debugger->getPC()) + if (address == debugger->GetPC()) dc.SetBrush(pcBrush); else dc.SetBrush(rowBrush); @@ -456,10 +456,10 @@ void CCodeView::OnPaint(wxPaintEvent& event) } // If running - if (debugger->isAlive()) + if (debugger->IsAlive()) { char dis[256]; - debugger->disasm(address, dis, 256); + debugger->Disassemble(address, dis, 256); char* dis2 = strchr(dis, '\t'); char desc[256] = ""; @@ -494,7 +494,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) branches[numBranches].src = rowY1 + rowHeight / 2; branches[numBranches].srcAddr = address / align; branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * rowHeight / align + rowHeight / 2); - sprintf(desc, "-->%s", debugger->getDescription(offs).c_str()); + sprintf(desc, "-->%s", debugger->GetDescription(offs).c_str()); dc.SetTextForeground(_T("#600060")); // the -> arrow illustrations are purple } else @@ -516,7 +516,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) if (desc[0] == 0) { - strcpy(desc, debugger->getDescription(address).c_str()); + strcpy(desc, debugger->GetDescription(address).c_str()); } if (!plain) @@ -532,7 +532,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) } // Show red breakpoint dot - if (debugger->isBreakpoint(address)) + if (debugger->IsBreakpoint(address)) { dc.SetBrush(bpBrush); dc.DrawRectangle(2, rowY1 + 1, 11, 11); -- 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/CodeView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 04abd447cb..3e1596e8fa 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -335,7 +335,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) void CCodeView::OnMouseUpR(wxMouseEvent& event) { - bool isSymbol = symbol_db->GetSymbolFromAddr(selection) != 0; + bool isSymbol = symbol_db->GetSymbolFromAddr(selection) != nullptr; // popup menu wxMenu* menu = new wxMenu; //menu->Append(IDM_GOTOINMEMVIEW, "&Goto in mem view"); @@ -482,7 +482,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) } if (!found) { - mojs = 0; + mojs = nullptr; break; } } -- cgit v1.2.3 From 31cfc73a09a8685cbab20502b4bc132e98e2feb5 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Tue, 11 Mar 2014 00:30:55 +1300 Subject: Fixes spacing for "for", "while", "switch" and "if" Also moved && and || to ends of lines instead of start. Fixed misc vertical alignments and some { needed newlining. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 3e1596e8fa..0d8ce7042e 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -184,9 +184,9 @@ void CCodeView::InsertBlrNop(int Blr) { // Check if this address has been modified int find = -1; - for(u32 i = 0; i < BlrList.size(); i++) + for (u32 i = 0; i < BlrList.size(); i++) { - if(BlrList.at(i).Address == selection) + if (BlrList.at(i).Address == selection) { find = i; break; -- 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/CodeView.cpp | 59 ++++++++++++++--------------- 1 file changed, 29 insertions(+), 30 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 0d8ce7042e..968fa816f8 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -227,7 +227,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) #if wxUSE_CLIPBOARD case IDM_COPYADDRESS: - wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection))); + wxTheClipboard->SetData(new wxTextDataObject(wxString::Format("%08x", selection))); break; case IDM_COPYCODE: @@ -310,7 +310,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) Symbol *symbol = symbol_db->GetSymbolFromAddr(selection); if (symbol) { - wxTextEntryDialog input_symbol(this, StrToWxStr("Rename symbol:"), + wxTextEntryDialog input_symbol(this, _("Rename symbol:"), wxGetTextFromUserPromptStr, StrToWxStr(symbol->name)); if (input_symbol.ShowModal() == wxID_OK) @@ -339,24 +339,23 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event) // popup menu wxMenu* menu = new wxMenu; //menu->Append(IDM_GOTOINMEMVIEW, "&Goto in mem view"); - menu->Append(IDM_FOLLOWBRANCH, - StrToWxStr("&Follow branch"))->Enable(AddrToBranch(selection) ? true : false); + menu->Append(IDM_FOLLOWBRANCH, _("&Follow branch"))->Enable(AddrToBranch(selection) ? true : false); menu->AppendSeparator(); #if wxUSE_CLIPBOARD - menu->Append(IDM_COPYADDRESS, StrToWxStr("Copy &address")); - menu->Append(IDM_COPYFUNCTION, StrToWxStr("Copy &function"))->Enable(isSymbol); - menu->Append(IDM_COPYCODE, StrToWxStr("Copy &code line")); - menu->Append(IDM_COPYHEX, StrToWxStr("Copy &hex")); + menu->Append(IDM_COPYADDRESS, _("Copy &address")); + menu->Append(IDM_COPYFUNCTION, _("Copy &function"))->Enable(isSymbol); + menu->Append(IDM_COPYCODE, _("Copy &code line")); + menu->Append(IDM_COPYHEX, _("Copy &hex")); menu->AppendSeparator(); #endif - menu->Append(IDM_RENAMESYMBOL, StrToWxStr("Rename &symbol"))->Enable(isSymbol); + menu->Append(IDM_RENAMESYMBOL, _("Rename &symbol"))->Enable(isSymbol); menu->AppendSeparator(); menu->Append(IDM_RUNTOHERE, _("&Run To Here")); menu->Append(IDM_ADDFUNCTION, _("&Add function")); - menu->Append(IDM_JITRESULTS, StrToWxStr("PPC vs X86")); - menu->Append(IDM_INSERTBLR, StrToWxStr("Insert &blr")); - menu->Append(IDM_INSERTNOP, StrToWxStr("Insert &nop")); - menu->Append(IDM_PATCHALERT, StrToWxStr("Patch alert")); + menu->Append(IDM_JITRESULTS, _("PPC vs X86")); + menu->Append(IDM_INSERTBLR, _("Insert &blr")); + menu->Append(IDM_INSERTNOP, _("Insert &nop")); + menu->Append(IDM_PATCHALERT, _("Patch alert")); PopupMenu(menu); event.Skip(true); } @@ -375,12 +374,12 @@ void CCodeView::OnPaint(wxPaintEvent& event) dc.SetFont(DebuggerFont); wxCoord w,h; - dc.GetTextExtent(_T("0WJyq"),&w,&h); + dc.GetTextExtent("0WJyq", &w, &h); if (h > rowHeight) rowHeight = h; - dc.GetTextExtent(_T("W"),&w,&h); + dc.GetTextExtent("W", &w, &h); int charWidth = w; struct branch @@ -399,15 +398,15 @@ void CCodeView::OnPaint(wxPaintEvent& event) // Colors and brushes // ------------------------- dc.SetBackgroundMode(wxTRANSPARENT); // the text background - const wxChar* bgColor = _T("#ffffff"); + const wxColour bgColor = *wxWHITE; wxPen nullPen(bgColor); - wxPen currentPen(_T("#000000")); - wxPen selPen(_T("#808080")); // gray + wxPen currentPen(*wxBLACK_PEN); + wxPen selPen(*wxGREY_PEN); nullPen.SetStyle(wxTRANSPARENT); currentPen.SetStyle(wxSOLID); - wxBrush currentBrush(_T("#FFEfE8")); // light gray - wxBrush pcBrush(_T("#70FF70")); // green - wxBrush bpBrush(_T("#FF3311")); // red + wxBrush currentBrush(*wxLIGHT_GREY_BRUSH); + wxBrush pcBrush(*wxGREEN_BRUSH); + wxBrush bpBrush(*wxRED_BRUSH); wxBrush bgBrush(bgColor); wxBrush nullBrush(bgColor); @@ -429,9 +428,9 @@ void CCodeView::OnPaint(wxPaintEvent& event) int rowY1 = rc.height / 2 + rowHeight * i - rowHeight / 2; int rowY2 = rc.height / 2 + rowHeight * i + rowHeight / 2; - wxString temp = wxString::Format(_T("%08x"), address); + wxString temp = wxString::Format("%08x", address); u32 col = debugger->GetColor(address); - wxBrush rowBrush(wxColor(col >> 16, col >> 8, col)); + wxBrush rowBrush(wxColour(col >> 16, col >> 8, col)); dc.SetBrush(nullBrush); dc.SetPen(nullPen); dc.DrawRectangle(0, rowY1, 16, rowY2 - rowY1 + 2); @@ -450,9 +449,9 @@ void CCodeView::OnPaint(wxPaintEvent& event) dc.SetBrush(currentBrush); if (!plain) { - dc.SetTextForeground(_T("#600000")); // the address text is dark red + dc.SetTextForeground("#600000"); // the address text is dark red dc.DrawText(temp, 17, rowY1); - dc.SetTextForeground(_T("#000000")); + dc.SetTextForeground(*wxBLACK); } // If running @@ -495,11 +494,11 @@ void CCodeView::OnPaint(wxPaintEvent& event) branches[numBranches].srcAddr = address / align; branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * rowHeight / align + rowHeight / 2); sprintf(desc, "-->%s", debugger->GetDescription(offs).c_str()); - dc.SetTextForeground(_T("#600060")); // the -> arrow illustrations are purple + dc.SetTextForeground(wxTheColourDatabase->Find("PURPLE")); // the -> arrow illustrations are purple } else { - dc.SetTextForeground(_T("#000000")); + dc.SetTextForeground(*wxBLACK); } dc.DrawText(StrToWxStr(dis2), 17 + 17*charWidth, rowY1); @@ -508,9 +507,9 @@ void CCodeView::OnPaint(wxPaintEvent& event) // Show blr as its' own color if (strcmp(dis, "blr")) - dc.SetTextForeground(_T("#007000")); // dark green + dc.SetTextForeground(wxTheColourDatabase->Find("DARK GREEN")); else - dc.SetTextForeground(_T("#8000FF")); // purple + dc.SetTextForeground(wxTheColourDatabase->Find("VIOLET")); dc.DrawText(StrToWxStr(dis), 17 + (plain ? 1*charWidth : 9*charWidth), rowY1); @@ -521,7 +520,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) if (!plain) { - dc.SetTextForeground(_T("#0000FF")); // blue + dc.SetTextForeground(*wxBLUE); //char temp[256]; //UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE); -- 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/CodeView.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 968fa816f8..0b725e75d4 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -111,7 +111,7 @@ void CCodeView::OnMouseDown(wxMouseEvent& event) ToggleBreakpoint(YToAddress(y)); } - event.Skip(true); + event.Skip(); } void CCodeView::ToggleBreakpoint(u32 address) @@ -143,7 +143,7 @@ void CCodeView::OnMouseMove(wxMouseEvent& event) } } - event.Skip(true); + event.Skip(); } void CCodeView::RaiseEvent() @@ -163,7 +163,7 @@ void CCodeView::OnMouseUpL(wxMouseEvent& event) Refresh(); } RaiseEvent(); - event.Skip(true); + event.Skip(); } u32 CCodeView::AddrToBranch(u32 addr) @@ -330,7 +330,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) #if wxUSE_CLIPBOARD wxTheClipboard->Close(); #endif - event.Skip(true); + event.Skip(); } void CCodeView::OnMouseUpR(wxMouseEvent& event) @@ -357,7 +357,7 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event) menu->Append(IDM_INSERTNOP, _("Insert &nop")); menu->Append(IDM_PATCHALERT, _("Patch alert")); PopupMenu(menu); - event.Skip(true); + event.Skip(); } void CCodeView::OnErase(wxEraseEvent& event) -- cgit v1.2.3 From 9c1b427687e6760b227d164af1ff6cbcbb047bdd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 15 Jul 2014 21:35:11 -0400 Subject: DolphinWX: Implement scrolling in the code view and DSP disassembly view. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 0b725e75d4..d7e06e4585 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -56,6 +56,7 @@ enum BEGIN_EVENT_TABLE(CCodeView, wxControl) EVT_ERASE_BACKGROUND(CCodeView::OnErase) EVT_PAINT(CCodeView::OnPaint) + EVT_MOUSEWHEEL(CCodeView::OnScrollWheel) EVT_LEFT_DOWN(CCodeView::OnMouseDown) EVT_LEFT_UP(CCodeView::OnMouseUpL) EVT_MOTION(CCodeView::OnMouseMove) @@ -114,6 +115,24 @@ void CCodeView::OnMouseDown(wxMouseEvent& event) event.Skip(); } +void CCodeView::OnScrollWheel(wxMouseEvent& event) +{ + const bool scroll_down = (event.GetWheelRotation() < 0); + const int num_lines = event.GetLinesPerAction(); + + if (scroll_down) + { + curAddress += num_lines; + } + else + { + curAddress -= num_lines; + } + + Refresh(); + event.Skip(); +} + void CCodeView::ToggleBreakpoint(u32 address) { debugger->ToggleBreakpoint(address); -- cgit v1.2.3 From 48ca800b13cd958373e8e28bb799093a74946b64 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 15 Jul 2014 23:01:17 -0400 Subject: DolphinWX: Mild readability clean up of CodeView. - Gets rid of the underscore in some function names - Appends the 'm_' prefix to class member variables. Now it isn't a pain to see what is being modified in terms of state. Especially in the OnPaint call. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 177 ++++++++++++++-------------- 1 file changed, 89 insertions(+), 88 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index d7e06e4585..582ff88042 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -69,26 +69,26 @@ END_EVENT_TABLE() CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, wxWindow* parent, wxWindowID Id) : wxControl(parent, Id), - debugger(debuginterface), - symbol_db(symboldb), - plain(false), - curAddress(debuginterface->GetPC()), - align(debuginterface->GetInstructionSize(0)), - rowHeight(13), - selection(0), - oldSelection(0), - selecting(false), - lx(-1), - ly(-1) + m_debugger(debuginterface), + m_symbol_db(symboldb), + m_plain(false), + m_curAddress(debuginterface->GetPC()), + m_align(debuginterface->GetInstructionSize(0)), + m_rowHeight(13), + m_selection(0), + m_oldSelection(0), + m_selecting(false), + m_lx(-1), + m_ly(-1) { } int CCodeView::YToAddress(int y) { wxRect rc = GetClientRect(); - int ydiff = y - rc.height / 2 - rowHeight / 2; - ydiff = (int)(floorf((float)ydiff / (float)rowHeight)) + 1; - return curAddress + ydiff * align; + int ydiff = y - rc.height / 2 - m_rowHeight / 2; + ydiff = (int)(floorf((float)ydiff / (float)m_rowHeight)) + 1; + return m_curAddress + ydiff * m_align; } void CCodeView::OnMouseDown(wxMouseEvent& event) @@ -98,13 +98,13 @@ void CCodeView::OnMouseDown(wxMouseEvent& event) if (x > 16) { - oldSelection = selection; - selection = YToAddress(y); + m_oldSelection = m_selection; + m_selection = YToAddress(y); // SetCapture(wnd); - bool oldselecting = selecting; - selecting = true; + bool oldselecting = m_selecting; + m_selecting = true; - if (!oldselecting || (selection != oldSelection)) + if (!oldselecting || (m_selection != m_oldSelection)) Refresh(); } else @@ -122,11 +122,11 @@ void CCodeView::OnScrollWheel(wxMouseEvent& event) if (scroll_down) { - curAddress += num_lines; + m_curAddress += num_lines; } else { - curAddress -= num_lines; + m_curAddress -= num_lines; } Refresh(); @@ -135,7 +135,7 @@ void CCodeView::OnScrollWheel(wxMouseEvent& event) void CCodeView::ToggleBreakpoint(u32 address) { - debugger->ToggleBreakpoint(address); + m_debugger->ToggleBreakpoint(address); Refresh(); Host_UpdateBreakPointView(); } @@ -148,12 +148,12 @@ void CCodeView::OnMouseMove(wxMouseEvent& event) { if (event.m_y < 0) { - curAddress -= align; + m_curAddress -= m_align; Refresh(); } else if (event.m_y > rc.height) { - curAddress += align; + m_curAddress += m_align; Refresh(); } else @@ -169,7 +169,7 @@ void CCodeView::RaiseEvent() { wxCommandEvent ev(wxEVT_CODEVIEW_CHANGE, GetId()); ev.SetEventObject(this); - ev.SetInt(selection); + ev.SetInt(m_selection); GetEventHandler()->ProcessEvent(ev); } @@ -177,10 +177,11 @@ void CCodeView::OnMouseUpL(wxMouseEvent& event) { if (event.m_x > 16) { - curAddress = YToAddress(event.m_y); - selecting = false; + m_curAddress = YToAddress(event.m_y); + m_selecting = false; Refresh(); } + RaiseEvent(); event.Skip(); } @@ -188,7 +189,7 @@ void CCodeView::OnMouseUpL(wxMouseEvent& event) u32 CCodeView::AddrToBranch(u32 addr) { char disasm[256]; - debugger->Disassemble(addr, disasm, 256); + m_debugger->Disassemble(addr, disasm, 256); const char *mojs = strstr(disasm, "->0x"); if (mojs) { @@ -203,9 +204,9 @@ void CCodeView::InsertBlrNop(int Blr) { // Check if this address has been modified int find = -1; - for (u32 i = 0; i < BlrList.size(); i++) + for (u32 i = 0; i < m_blrList.size(); i++) { - if (BlrList.at(i).Address == selection) + if (m_blrList.at(i).address == m_selection) { find = i; break; @@ -215,19 +216,19 @@ void CCodeView::InsertBlrNop(int Blr) // Save the old value if (find >= 0) { - debugger->WriteExtraMemory(0, BlrList.at(find).OldValue, selection); - BlrList.erase(BlrList.begin() + find); + m_debugger->WriteExtraMemory(0, m_blrList.at(find).oldValue, m_selection); + m_blrList.erase(m_blrList.begin() + find); } else { - BlrStruct Temp; - Temp.Address = selection; - Temp.OldValue = debugger->ReadMemory(selection); - BlrList.push_back(Temp); + BlrStruct temp; + temp.address = m_selection; + temp.oldValue = m_debugger->ReadMemory(m_selection); + m_blrList.push_back(temp); if (Blr == 0) - debugger->InsertBLR(selection, 0x4e800020); + m_debugger->InsertBLR(m_selection, 0x4e800020); else - debugger->InsertBLR(selection, 0x60000000); + m_debugger->InsertBLR(m_selection, 0x60000000); } Refresh(); } @@ -246,13 +247,13 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) #if wxUSE_CLIPBOARD case IDM_COPYADDRESS: - wxTheClipboard->SetData(new wxTextDataObject(wxString::Format("%08x", selection))); + wxTheClipboard->SetData(new wxTextDataObject(wxString::Format("%08x", m_selection))); break; case IDM_COPYCODE: { char disasm[256]; - debugger->Disassemble(selection, disasm, 256); + m_debugger->Disassemble(m_selection, disasm, 256); wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(disasm))); } break; @@ -260,7 +261,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) case IDM_COPYHEX: { char temp[24]; - sprintf(temp, "%08x", debugger->ReadInstruction(selection)); + sprintf(temp, "%08x", m_debugger->ReadInstruction(m_selection)); wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp))); } break; @@ -268,7 +269,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) case IDM_COPYFUNCTION: { - Symbol *symbol = symbol_db->GetSymbolFromAddr(selection); + Symbol *symbol = m_symbol_db->GetSymbolFromAddr(m_selection); if (symbol) { std::string text; @@ -279,7 +280,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) for (u32 addr = start; addr != end; addr += 4) { char disasm[256]; - debugger->Disassemble(addr, disasm, 256); + m_debugger->Disassemble(addr, disasm, 256); text = text + StringFromFormat("%08x: ", addr) + disasm + "\r\n"; } wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(text))); @@ -289,8 +290,8 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) #endif case IDM_RUNTOHERE: - debugger->SetBreakpoint(selection); - debugger->RunToBreakpoint(); + m_debugger->SetBreakpoint(m_selection); + m_debugger->RunToBreakpoint(); Refresh(); break; @@ -305,12 +306,12 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) break; case IDM_JITRESULTS: - debugger->ShowJitResults(selection); + m_debugger->ShowJitResults(m_selection); break; case IDM_FOLLOWBRANCH: { - u32 dest = AddrToBranch(selection); + u32 dest = AddrToBranch(m_selection); if (dest) { Center(dest); @@ -320,13 +321,13 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) break; case IDM_ADDFUNCTION: - symbol_db->AddFunction(selection); + m_symbol_db->AddFunction(m_selection); Host_NotifyMapLoaded(); break; case IDM_RENAMESYMBOL: { - Symbol *symbol = symbol_db->GetSymbolFromAddr(selection); + Symbol *symbol = m_symbol_db->GetSymbolFromAddr(m_selection); if (symbol) { wxTextEntryDialog input_symbol(this, _("Rename symbol:"), @@ -354,11 +355,11 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) void CCodeView::OnMouseUpR(wxMouseEvent& event) { - bool isSymbol = symbol_db->GetSymbolFromAddr(selection) != nullptr; + bool isSymbol = m_symbol_db->GetSymbolFromAddr(m_selection) != nullptr; // popup menu wxMenu* menu = new wxMenu; //menu->Append(IDM_GOTOINMEMVIEW, "&Goto in mem view"); - menu->Append(IDM_FOLLOWBRANCH, _("&Follow branch"))->Enable(AddrToBranch(selection) ? true : false); + menu->Append(IDM_FOLLOWBRANCH, _("&Follow branch"))->Enable(AddrToBranch(m_selection) ? true : false); menu->AppendSeparator(); #if wxUSE_CLIPBOARD menu->Append(IDM_COPYADDRESS, _("Copy &address")); @@ -395,8 +396,8 @@ void CCodeView::OnPaint(wxPaintEvent& event) wxCoord w,h; dc.GetTextExtent("0WJyq", &w, &h); - if (h > rowHeight) - rowHeight = h; + if (h > m_rowHeight) + m_rowHeight = h; dc.GetTextExtent("W", &w, &h); int charWidth = w; @@ -410,7 +411,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) int numBranches = 0; // TODO: Add any drawing code here... int width = rc.width; - int numRows = (rc.height / rowHeight) / 2 + 2; + int numRows = (rc.height / m_rowHeight) / 2 + 2; // ------------ // -------------------------------------------------------------------- @@ -442,31 +443,31 @@ void CCodeView::OnPaint(wxPaintEvent& event) // ------------------------- for (int i = -numRows; i <= numRows; i++) { - unsigned int address = curAddress + i * align; + unsigned int address = m_curAddress + i * m_align; - int rowY1 = rc.height / 2 + rowHeight * i - rowHeight / 2; - int rowY2 = rc.height / 2 + rowHeight * i + rowHeight / 2; + int rowY1 = rc.height / 2 + m_rowHeight * i - m_rowHeight / 2; + int rowY2 = rc.height / 2 + m_rowHeight * i + m_rowHeight / 2; wxString temp = wxString::Format("%08x", address); - u32 col = debugger->GetColor(address); + u32 col = m_debugger->GetColor(address); wxBrush rowBrush(wxColour(col >> 16, col >> 8, col)); dc.SetBrush(nullBrush); dc.SetPen(nullPen); dc.DrawRectangle(0, rowY1, 16, rowY2 - rowY1 + 2); - if (selecting && (address == selection)) + if (m_selecting && (address == m_selection)) dc.SetPen(selPen); else dc.SetPen(i == 0 ? currentPen : nullPen); - if (address == debugger->GetPC()) + if (address == m_debugger->GetPC()) dc.SetBrush(pcBrush); else dc.SetBrush(rowBrush); dc.DrawRectangle(16, rowY1, width, rowY2 - rowY1 + 1); dc.SetBrush(currentBrush); - if (!plain) + if (!m_plain) { dc.SetTextForeground("#600000"); // the address text is dark red dc.DrawText(temp, 17, rowY1); @@ -474,10 +475,10 @@ void CCodeView::OnPaint(wxPaintEvent& event) } // If running - if (debugger->IsAlive()) + if (m_debugger->IsAlive()) { char dis[256]; - debugger->Disassemble(address, dis, 256); + m_debugger->Disassemble(address, dis, 256); char* dis2 = strchr(dis, '\t'); char desc[256] = ""; @@ -509,10 +510,10 @@ void CCodeView::OnPaint(wxPaintEvent& event) { int offs; sscanf(mojs + 2, "%08x", &offs); - branches[numBranches].src = rowY1 + rowHeight / 2; - branches[numBranches].srcAddr = address / align; - branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * rowHeight / align + rowHeight / 2); - sprintf(desc, "-->%s", debugger->GetDescription(offs).c_str()); + branches[numBranches].src = rowY1 + m_rowHeight / 2; + branches[numBranches].srcAddr = address / m_align; + branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * m_rowHeight / m_align + m_rowHeight / 2); + sprintf(desc, "-->%s", m_debugger->GetDescription(offs).c_str()); dc.SetTextForeground(wxTheColourDatabase->Find("PURPLE")); // the -> arrow illustrations are purple } else @@ -530,14 +531,14 @@ void CCodeView::OnPaint(wxPaintEvent& event) else dc.SetTextForeground(wxTheColourDatabase->Find("VIOLET")); - dc.DrawText(StrToWxStr(dis), 17 + (plain ? 1*charWidth : 9*charWidth), rowY1); + dc.DrawText(StrToWxStr(dis), 17 + (m_plain ? 1*charWidth : 9*charWidth), rowY1); if (desc[0] == 0) { - strcpy(desc, debugger->GetDescription(address).c_str()); + strcpy(desc, m_debugger->GetDescription(address).c_str()); } - if (!plain) + if (!m_plain) { dc.SetTextForeground(*wxBLUE); @@ -550,7 +551,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) } // Show red breakpoint dot - if (debugger->IsBreakpoint(address)) + if (m_debugger->IsBreakpoint(address)) { dc.SetBrush(bpBrush); dc.DrawRectangle(2, rowY1 + 1, 11, 11); @@ -567,40 +568,40 @@ void CCodeView::OnPaint(wxPaintEvent& event) for (int i = 0; i < numBranches; i++) { int x = 17 + 49 * charWidth + (branches[i].srcAddr % 9) * 8; - _MoveTo(x-2, branches[i].src); + MoveTo(x-2, branches[i].src); if (branches[i].dst < rc.height + 400 && branches[i].dst > -400) { - _LineTo(dc, x+2, branches[i].src); - _LineTo(dc, x+2, branches[i].dst); - _LineTo(dc, x-4, branches[i].dst); + LineTo(dc, x+2, branches[i].src); + LineTo(dc, x+2, branches[i].dst); + LineTo(dc, x-4, branches[i].dst); - _MoveTo(x, branches[i].dst - 4); - _LineTo(dc, x-4, branches[i].dst); - _LineTo(dc, x+1, branches[i].dst+5); + MoveTo(x, branches[i].dst - 4); + LineTo(dc, x-4, branches[i].dst); + LineTo(dc, x+1, branches[i].dst+5); } //else //{ // This can be re-enabled when there is a scrollbar or // something on the codeview (the lines are too long) - //_LineTo(dc, x+4, branches[i].src); - //_MoveTo(x+2, branches[i].dst-4); - //_LineTo(dc, x+6, branches[i].dst); - //_LineTo(dc, x+1, branches[i].dst+5); + //LineTo(dc, x+4, branches[i].src); + //MoveTo(x+2, branches[i].dst-4); + //LineTo(dc, x+6, branches[i].dst); + //LineTo(dc, x+1, branches[i].dst+5); //} - //_LineTo(dc, x, branches[i].dst+4); - //_LineTo(dc, x-2, branches[i].dst); + //LineTo(dc, x, branches[i].dst+4); + //LineTo(dc, x-2, branches[i].dst); } // ------------ } -void CCodeView::_LineTo(wxPaintDC &dc, int x, int y) +void CCodeView::LineTo(wxPaintDC &dc, int x, int y) { - dc.DrawLine(lx, ly, x, y); - lx = x; - ly = y; + dc.DrawLine(m_lx, m_ly, x, y); + m_lx = x; + m_ly = y; } void CCodeView::OnResize(wxSizeEvent& event) -- cgit v1.2.3 From bc172f488320a41b8a5bbf216a589ddac4215f06 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 17 Jul 2014 04:49:45 -0400 Subject: DolphinWX: Enable certain Code View context options only when the core is running. Prior to this, attempting to execute these contextual menu options would crash the application. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 582ff88042..9d7b869518 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -30,6 +30,7 @@ #include "Common/DebugInterface.h" #include "Common/StringUtil.h" #include "Common/SymbolDB.h" +#include "Core/Core.h" #include "Core/Host.h" #include "DolphinWX/WxUtils.h" #include "DolphinWX/Debugger/CodeView.h" @@ -370,12 +371,12 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event) #endif menu->Append(IDM_RENAMESYMBOL, _("Rename &symbol"))->Enable(isSymbol); menu->AppendSeparator(); - menu->Append(IDM_RUNTOHERE, _("&Run To Here")); - menu->Append(IDM_ADDFUNCTION, _("&Add function")); - menu->Append(IDM_JITRESULTS, _("PPC vs X86")); - menu->Append(IDM_INSERTBLR, _("Insert &blr")); - menu->Append(IDM_INSERTNOP, _("Insert &nop")); - menu->Append(IDM_PATCHALERT, _("Patch alert")); + menu->Append(IDM_RUNTOHERE, _("&Run To Here"))->Enable(Core::IsRunning()); + menu->Append(IDM_ADDFUNCTION, _("&Add function"))->Enable(Core::IsRunning()); + menu->Append(IDM_JITRESULTS, _("PPC vs X86"))->Enable(Core::IsRunning()); + menu->Append(IDM_INSERTBLR, _("Insert &blr"))->Enable(Core::IsRunning()); + menu->Append(IDM_INSERTNOP, _("Insert &nop"))->Enable(Core::IsRunning()); + menu->Append(IDM_PATCHALERT, _("Patch alert"))->Enable(Core::IsRunning()); PopupMenu(menu); event.Skip(); } -- cgit v1.2.3 From 0718937237db22d26e1b764b4733645c2b9f1562 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 17 Jul 2014 21:33:51 -0400 Subject: Common: Introduce the new Gekko disassembler to Common. This moves the Gekko disassembler to Common where it should be. Having it in the Bochs disassembly Externals is incorrect. Unlike the PowerPC disassembler prior however, this one is updated to have an API that is more fitting for C++. e.g. Not needing to specify a string buffer and size. It does all of this under the hood. This modifies all the DebuggingInterfaces as necessary to handle this. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 108 ++++++++++++---------------- 1 file changed, 46 insertions(+), 62 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 9d7b869518..7b18a5e9d8 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 // Refer to the license.txt file included. +#include #include #include #include @@ -189,15 +190,15 @@ void CCodeView::OnMouseUpL(wxMouseEvent& event) u32 CCodeView::AddrToBranch(u32 addr) { - char disasm[256]; - m_debugger->Disassemble(addr, disasm, 256); - const char *mojs = strstr(disasm, "->0x"); - if (mojs) + std::string disasm = m_debugger->Disassemble(addr); + size_t pos = disasm.find("->0x"); + + if (pos != std::string::npos) { - u32 dest; - sscanf(mojs+4,"%08x", &dest); - return dest; + std::string hex = disasm.substr(pos + 2); + return std::stoul(hex, nullptr, 16); } + return 0; } @@ -253,16 +254,14 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) case IDM_COPYCODE: { - char disasm[256]; - m_debugger->Disassemble(m_selection, disasm, 256); + std::string disasm = m_debugger->Disassemble(m_selection); wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(disasm))); } break; case IDM_COPYHEX: { - char temp[24]; - sprintf(temp, "%08x", m_debugger->ReadInstruction(m_selection)); + std::string temp = StringFromFormat("%08x", m_debugger->ReadInstruction(m_selection)); wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp))); } break; @@ -280,9 +279,8 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) u32 end = start + symbol->size; for (u32 addr = start; addr != end; addr += 4) { - char disasm[256]; - m_debugger->Disassemble(addr, disasm, 256); - text = text + StringFromFormat("%08x: ", addr) + disasm + "\r\n"; + std::string disasm = m_debugger->Disassemble(addr); + text += StringFromFormat("%08x: ", addr) + disasm + "\r\n"; } wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(text))); } @@ -478,65 +476,51 @@ void CCodeView::OnPaint(wxPaintEvent& event) // If running if (m_debugger->IsAlive()) { - char dis[256]; - m_debugger->Disassemble(address, dis, 256); - char* dis2 = strchr(dis, '\t'); - char desc[256] = ""; + std::vector dis; + SplitString(m_debugger->Disassemble(address), '\t', dis); + + static const size_t VALID_BRANCH_LENGTH = 10; + const std::string& opcode = dis[0]; + const std::string& operands = dis[1]; + std::string desc; + + // look for hex strings to decode branches + std::string hex_str; + size_t pos = operands.find("0x8"); + if (pos != std::string::npos) + { + hex_str = operands.substr(pos); + } - // If we have a code - if (dis2) + if (hex_str.length() == VALID_BRANCH_LENGTH) { - *dis2 = 0; - dis2++; - // look for hex strings to decode branches - const char* mojs = strstr(dis2, "0x8"); - if (mojs) - { - for (int k = 0; k < 8; k++) - { - bool found = false; - for (int j = 0; j < 22; j++) - { - if (mojs[k + 2] == "0123456789ABCDEFabcdef"[j]) - found = true; - } - if (!found) - { - mojs = nullptr; - break; - } - } - } - if (mojs) - { - int offs; - sscanf(mojs + 2, "%08x", &offs); - branches[numBranches].src = rowY1 + m_rowHeight / 2; - branches[numBranches].srcAddr = address / m_align; - branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * m_rowHeight / m_align + m_rowHeight / 2); - sprintf(desc, "-->%s", m_debugger->GetDescription(offs).c_str()); - dc.SetTextForeground(wxTheColourDatabase->Find("PURPLE")); // the -> arrow illustrations are purple - } - else - { - dc.SetTextForeground(*wxBLACK); - } + u32 offs = std::stoul(hex_str, nullptr, 16); - dc.DrawText(StrToWxStr(dis2), 17 + 17*charWidth, rowY1); - // ------------ + branches[numBranches].src = rowY1 + m_rowHeight / 2; + branches[numBranches].srcAddr = address / m_align; + branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * m_rowHeight / m_align + m_rowHeight / 2); + desc = StringFromFormat("-->%s", m_debugger->GetDescription(offs).c_str()); + dc.SetTextForeground(wxTheColourDatabase->Find("PURPLE")); // the -> arrow illustrations are purple } + else + { + dc.SetTextForeground(*wxBLACK); + } + + dc.DrawText(StrToWxStr(operands), 17 + 17*charWidth, rowY1); + // ------------ // Show blr as its' own color - if (strcmp(dis, "blr")) + if (opcode == "blr") dc.SetTextForeground(wxTheColourDatabase->Find("DARK GREEN")); else dc.SetTextForeground(wxTheColourDatabase->Find("VIOLET")); - dc.DrawText(StrToWxStr(dis), 17 + (m_plain ? 1*charWidth : 9*charWidth), rowY1); + dc.DrawText(StrToWxStr(opcode), 17 + (m_plain ? 1*charWidth : 9*charWidth), rowY1); - if (desc[0] == 0) + if (desc.empty()) { - strcpy(desc, m_debugger->GetDescription(address).c_str()); + desc = m_debugger->GetDescription(address); } if (!m_plain) @@ -545,7 +529,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) //char temp[256]; //UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE); - if (strlen(desc)) + if (!desc.empty()) { dc.DrawText(StrToWxStr(desc), 17 + 35 * charWidth, rowY1); } -- cgit v1.2.3 From c051ae333818954dbf056340b0fad8dddf5ecbff Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 4 Aug 2014 03:06:13 -0400 Subject: DolphinWX: Ensure the code view string vector is always a size of two. This way if any entries are not populated, then an empty string will be used. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 7b18a5e9d8..80b5598dfc 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -478,9 +478,10 @@ void CCodeView::OnPaint(wxPaintEvent& event) { std::vector dis; SplitString(m_debugger->Disassemble(address), '\t', dis); + dis.resize(2); static const size_t VALID_BRANCH_LENGTH = 10; - const std::string& opcode = dis[0]; + const std::string& opcode = dis[0]; const std::string& operands = dis[1]; std::string desc; -- cgit v1.2.3 From d4eb0684f76b012dbec22285100808608fd2b914 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 4 Aug 2014 23:46:37 -0400 Subject: Core: Kill off Host_UpdateBreakPointView() Uses wxWidgets event propagation to the parent window which then appropriately handles the breakpoint list updating. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 80b5598dfc..182451beac 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -33,6 +33,7 @@ #include "Common/SymbolDB.h" #include "Core/Core.h" #include "Core/Host.h" +#include "DolphinWX/Globals.h" #include "DolphinWX/WxUtils.h" #include "DolphinWX/Debugger/CodeView.h" #include "DolphinWX/Debugger/DebuggerUIUtil.h" @@ -139,7 +140,10 @@ void CCodeView::ToggleBreakpoint(u32 address) { m_debugger->ToggleBreakpoint(address); Refresh(); - Host_UpdateBreakPointView(); + + // Propagate back to the parent window to update the breakpoint list. + wxCommandEvent evt(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS); + GetEventHandler()->AddPendingEvent(evt); } void CCodeView::OnMouseMove(wxMouseEvent& event) -- 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/CodeView.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 182451beac..0c74b3dbd9 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -309,7 +309,12 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) break; case IDM_JITRESULTS: - m_debugger->ShowJitResults(m_selection); + { + // Propagate back to the parent window and tell it + // to flip to the JIT tab for the current address. + wxCommandEvent jit_event(wxEVT_HOST_COMMAND, IDM_UPDATEJITPANE); + GetEventHandler()->AddPendingEvent(jit_event); + } break; case IDM_FOLLOWBRANCH: -- cgit v1.2.3 From 6a8dfda0ea0cb9b566a536e3cc76b2bed003fe83 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 17 Aug 2014 16:18:54 -0400 Subject: DolphinWX: Use the typesafe equivalents for declaring wx event types The others were used when wx 2.4 was around --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 0c74b3dbd9..d723d9aa6b 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -38,7 +38,7 @@ #include "DolphinWX/Debugger/CodeView.h" #include "DolphinWX/Debugger/DebuggerUIUtil.h" -DEFINE_EVENT_TYPE(wxEVT_CODEVIEW_CHANGE); +wxDEFINE_EVENT(wxEVT_CODEVIEW_CHANGE, wxCommandEvent); enum { -- cgit v1.2.3 From c3e41809d9d43e3c251ac6bb6e5bb21fcc1e7442 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 24 Aug 2014 14:59:02 -0400 Subject: DolphinWX: Move the CodeView debugger view over to wxGraphicsContext This is a more advanced drawing 'backend' over the previous one and allows us to control things like transparency and anti-aliasing, etc. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 105 +++++++++++++++------------- 1 file changed, 55 insertions(+), 50 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index d723d9aa6b..961c74fc17 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -393,21 +395,21 @@ void CCodeView::OnErase(wxEraseEvent& event) void CCodeView::OnPaint(wxPaintEvent& event) { - // -------------------------------------------------------------------- + // ------------------------- // General settings // ------------------------- - wxPaintDC dc(this); + std::unique_ptr ctx(wxGraphicsContext::Create(wxPaintDC(this))); wxRect rc = GetClientRect(); - dc.SetFont(DebuggerFont); + ctx->SetFont(DebuggerFont, *wxBLACK); - wxCoord w,h; - dc.GetTextExtent("0WJyq", &w, &h); + wxDouble w,h; + ctx->GetTextExtent("0WJyq", &w, &h); if (h > m_rowHeight) m_rowHeight = h; - dc.GetTextExtent("W", &w, &h); + ctx->GetTextExtent("W", &w, &h); int charWidth = w; struct branch @@ -422,10 +424,10 @@ void CCodeView::OnPaint(wxPaintEvent& event) int numRows = (rc.height / m_rowHeight) / 2 + 2; // ------------ - // -------------------------------------------------------------------- + // ------------------------- // Colors and brushes // ------------------------- - dc.SetBackgroundMode(wxTRANSPARENT); // the text background + const wxColour bgColor = *wxWHITE; wxPen nullPen(bgColor); wxPen currentPen(*wxBLACK_PEN); @@ -440,15 +442,15 @@ void CCodeView::OnPaint(wxPaintEvent& event) wxBrush nullBrush(bgColor); nullBrush.SetStyle(wxTRANSPARENT); - dc.SetPen(nullPen); - dc.SetBrush(bgBrush); - dc.DrawRectangle(0, 0, 16, rc.height); - dc.DrawRectangle(0, 0, rc.width, 5); + ctx->SetPen(nullPen); + ctx->SetBrush(bgBrush); + ctx->DrawRectangle(0, 0, 16, rc.height); + ctx->DrawRectangle(0, 0, rc.width, 5); // ------------ - // -------------------------------------------------------------------- + // ----------------------------- // Walk through all visible rows - // ------------------------- + // ----------------------------- for (int i = -numRows; i <= numRows; i++) { unsigned int address = m_curAddress + i * m_align; @@ -459,27 +461,28 @@ void CCodeView::OnPaint(wxPaintEvent& event) wxString temp = wxString::Format("%08x", address); u32 col = m_debugger->GetColor(address); wxBrush rowBrush(wxColour(col >> 16, col >> 8, col)); - dc.SetBrush(nullBrush); - dc.SetPen(nullPen); - dc.DrawRectangle(0, rowY1, 16, rowY2 - rowY1 + 2); + ctx->SetBrush(nullBrush); + ctx->SetPen(nullPen); + ctx->DrawRectangle(0, rowY1, 16, rowY2 - rowY1 + 2); if (m_selecting && (address == m_selection)) - dc.SetPen(selPen); + ctx->SetPen(selPen); else - dc.SetPen(i == 0 ? currentPen : nullPen); + ctx->SetPen(i == 0 ? currentPen : nullPen); if (address == m_debugger->GetPC()) - dc.SetBrush(pcBrush); + ctx->SetBrush(pcBrush); else - dc.SetBrush(rowBrush); + ctx->SetBrush(rowBrush); - dc.DrawRectangle(16, rowY1, width, rowY2 - rowY1 + 1); - dc.SetBrush(currentBrush); + ctx->DrawRectangle(16, rowY1, width, rowY2 - rowY1 + 1); + ctx->SetBrush(currentBrush); if (!m_plain) { - dc.SetTextForeground("#600000"); // the address text is dark red - dc.DrawText(temp, 17, rowY1); - dc.SetTextForeground(*wxBLACK); + // the address text is dark red + ctx->SetFont(DebuggerFont, wxColour("#600000")); + ctx->DrawText(temp, 17, rowY1); + ctx->SetFont(DebuggerFont, *wxBLACK); } // If running @@ -510,23 +513,23 @@ void CCodeView::OnPaint(wxPaintEvent& event) branches[numBranches].srcAddr = address / m_align; branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * m_rowHeight / m_align + m_rowHeight / 2); desc = StringFromFormat("-->%s", m_debugger->GetDescription(offs).c_str()); - dc.SetTextForeground(wxTheColourDatabase->Find("PURPLE")); // the -> arrow illustrations are purple + ctx->SetFont(DebuggerFont, wxTheColourDatabase->Find("PURPLE")); // the -> arrow illustrations are purple } else { - dc.SetTextForeground(*wxBLACK); + ctx->SetFont(DebuggerFont, *wxBLACK); } - dc.DrawText(StrToWxStr(operands), 17 + 17*charWidth, rowY1); + ctx->DrawText(StrToWxStr(operands), 17 + 17*charWidth, rowY1); // ------------ // Show blr as its' own color if (opcode == "blr") - dc.SetTextForeground(wxTheColourDatabase->Find("DARK GREEN")); + ctx->SetFont(DebuggerFont, wxTheColourDatabase->Find("DARK GREEN")); else - dc.SetTextForeground(wxTheColourDatabase->Find("VIOLET")); + ctx->SetFont(DebuggerFont, wxTheColourDatabase->Find("VIOLET")); - dc.DrawText(StrToWxStr(opcode), 17 + (m_plain ? 1*charWidth : 9*charWidth), rowY1); + ctx->DrawText(StrToWxStr(opcode), 17 + (m_plain ? 1*charWidth : 9*charWidth), rowY1); if (desc.empty()) { @@ -535,30 +538,30 @@ void CCodeView::OnPaint(wxPaintEvent& event) if (!m_plain) { - dc.SetTextForeground(*wxBLUE); + ctx->SetFont(DebuggerFont, *wxBLUE); //char temp[256]; //UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE); if (!desc.empty()) { - dc.DrawText(StrToWxStr(desc), 17 + 35 * charWidth, rowY1); + ctx->DrawText(StrToWxStr(desc), 17 + 35 * charWidth, rowY1); } } // Show red breakpoint dot if (m_debugger->IsBreakpoint(address)) { - dc.SetBrush(bpBrush); - dc.DrawRectangle(2, rowY1 + 1, 11, 11); + ctx->SetBrush(bpBrush); + ctx->DrawRectangle(2, rowY1 + 1, 11, 11); } } } // end of for // ------------ - // -------------------------------------------------------------------- + // ------------------------- // Colors and brushes // ------------------------- - dc.SetPen(currentPen); + ctx->SetPen(currentPen); for (int i = 0; i < numBranches; i++) { @@ -567,34 +570,36 @@ void CCodeView::OnPaint(wxPaintEvent& event) if (branches[i].dst < rc.height + 400 && branches[i].dst > -400) { - LineTo(dc, x+2, branches[i].src); - LineTo(dc, x+2, branches[i].dst); - LineTo(dc, x-4, branches[i].dst); + LineTo(ctx, x+2, branches[i].src); + LineTo(ctx, x+2, branches[i].dst); + LineTo(ctx, x-4, branches[i].dst); MoveTo(x, branches[i].dst - 4); - LineTo(dc, x-4, branches[i].dst); - LineTo(dc, x+1, branches[i].dst+5); + LineTo(ctx, x-4, branches[i].dst); + LineTo(ctx, x+1, branches[i].dst+5); } //else //{ // This can be re-enabled when there is a scrollbar or // something on the codeview (the lines are too long) - //LineTo(dc, x+4, branches[i].src); + //LineTo(ctx, x+4, branches[i].src); //MoveTo(x+2, branches[i].dst-4); - //LineTo(dc, x+6, branches[i].dst); - //LineTo(dc, x+1, branches[i].dst+5); + //LineTo(ctx, x+6, branches[i].dst); + //LineTo(ctx, x+1, branches[i].dst+5); //} - //LineTo(dc, x, branches[i].dst+4); - //LineTo(dc, x-2, branches[i].dst); + //LineTo(ctx, x, branches[i].dst+4); + //LineTo(ctx, x-2, branches[i].dst); } // ------------ } -void CCodeView::LineTo(wxPaintDC &dc, int x, int y) +void CCodeView::LineTo(std::unique_ptr& ctx, int x, int y) { - dc.DrawLine(m_lx, m_ly, x, y); + std::vector points { wxPoint2DDouble(m_lx, m_ly), wxPoint2DDouble(x, y) }; + + ctx->DrawLines(points.size(), points.data()); m_lx = x; m_ly = y; } -- cgit v1.2.3 From f239ea38539bba03e3ae1ff4fbe7b02dc6d8ccb3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 24 Aug 2014 15:16:20 -0400 Subject: DolphinWX: Parenthesize some expressions in CodeView.cpp --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 961c74fc17..81a085e674 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -421,7 +421,7 @@ void CCodeView::OnPaint(wxPaintEvent& event) int numBranches = 0; // TODO: Add any drawing code here... int width = rc.width; - int numRows = (rc.height / m_rowHeight) / 2 + 2; + int numRows = ((rc.height / m_rowHeight) / 2) + 2; // ------------ // ------------------------- @@ -453,14 +453,14 @@ void CCodeView::OnPaint(wxPaintEvent& event) // ----------------------------- for (int i = -numRows; i <= numRows; i++) { - unsigned int address = m_curAddress + i * m_align; + unsigned int address = m_curAddress + (i * m_align); - int rowY1 = rc.height / 2 + m_rowHeight * i - m_rowHeight / 2; - int rowY2 = rc.height / 2 + m_rowHeight * i + m_rowHeight / 2; + int rowY1 = (rc.height / 2) + (m_rowHeight * i) - (m_rowHeight / 2); + int rowY2 = (rc.height / 2) + (m_rowHeight * i) + (m_rowHeight / 2); wxString temp = wxString::Format("%08x", address); - u32 col = m_debugger->GetColor(address); - wxBrush rowBrush(wxColour(col >> 16, col >> 8, col)); + u32 color = m_debugger->GetColor(address); + wxBrush rowBrush(wxColour(color >> 16, color >> 8, color)); ctx->SetBrush(nullBrush); ctx->SetPen(nullPen); ctx->DrawRectangle(0, rowY1, 16, rowY2 - rowY1 + 2); @@ -509,11 +509,13 @@ void CCodeView::OnPaint(wxPaintEvent& event) { u32 offs = std::stoul(hex_str, nullptr, 16); - branches[numBranches].src = rowY1 + m_rowHeight / 2; - branches[numBranches].srcAddr = address / m_align; + branches[numBranches].src = rowY1 + (m_rowHeight / 2); + branches[numBranches].srcAddr = (address / m_align); branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * m_rowHeight / m_align + m_rowHeight / 2); desc = StringFromFormat("-->%s", m_debugger->GetDescription(offs).c_str()); - ctx->SetFont(DebuggerFont, wxTheColourDatabase->Find("PURPLE")); // the -> arrow illustrations are purple + + // the -> arrow illustrations are purple + ctx->SetFont(DebuggerFont, wxTheColourDatabase->Find("PURPLE")); } else { -- 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/CodeView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 81a085e674..cf7dec412c 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -29,7 +29,7 @@ #include #include -#include "Common/Common.h" +#include "Common/CommonTypes.h" #include "Common/DebugInterface.h" #include "Common/StringUtil.h" #include "Common/SymbolDB.h" -- cgit v1.2.3 From 20c3a0f2d838668e2da17dd981c580ddd7c933c3 Mon Sep 17 00:00:00 2001 From: Fiora Date: Thu, 18 Sep 2014 03:54:57 -0700 Subject: Debugger: scroll by multiples of 4 bytes Avoids that weird effect where scrolling offsets code from 4-byte boundaries, showing nonsense 75% of the time. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index cf7dec412c..5abd5f606f 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -127,11 +127,11 @@ void CCodeView::OnScrollWheel(wxMouseEvent& event) if (scroll_down) { - m_curAddress += num_lines; + m_curAddress += num_lines * 4; } else { - m_curAddress -= num_lines; + m_curAddress -= num_lines * 4; } Refresh(); -- 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/CodeView.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 5abd5f606f..2a6f53fe5c 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -58,19 +58,6 @@ enum IDM_ADDFUNCTION, }; -BEGIN_EVENT_TABLE(CCodeView, wxControl) - EVT_ERASE_BACKGROUND(CCodeView::OnErase) - EVT_PAINT(CCodeView::OnPaint) - EVT_MOUSEWHEEL(CCodeView::OnScrollWheel) - EVT_LEFT_DOWN(CCodeView::OnMouseDown) - EVT_LEFT_UP(CCodeView::OnMouseUpL) - EVT_MOTION(CCodeView::OnMouseMove) - EVT_RIGHT_DOWN(CCodeView::OnMouseDown) - EVT_RIGHT_UP(CCodeView::OnMouseUpR) - EVT_MENU(-1, CCodeView::OnPopupMenu) - EVT_SIZE(CCodeView::OnResize) -END_EVENT_TABLE() - CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, wxWindow* parent, wxWindowID Id) : wxControl(parent, Id), @@ -86,6 +73,16 @@ CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, m_lx(-1), m_ly(-1) { + Bind(wxEVT_ERASE_BACKGROUND, &CCodeView::OnErase, this); + Bind(wxEVT_PAINT, &CCodeView::OnPaint, this); + Bind(wxEVT_MOUSEWHEEL, &CCodeView::OnScrollWheel, this); + Bind(wxEVT_LEFT_DOWN, &CCodeView::OnMouseDown, this); + Bind(wxEVT_LEFT_UP, &CCodeView::OnMouseUpL, this); + Bind(wxEVT_MOTION, &CCodeView::OnMouseMove, this); + Bind(wxEVT_RIGHT_DOWN, &CCodeView::OnMouseDown, this); + Bind(wxEVT_RIGHT_UP, &CCodeView::OnMouseUpR, this); + Bind(wxEVT_MENU, &CCodeView::OnPopupMenu, this); + Bind(wxEVT_SIZE, &CCodeView::OnResize, this); } int CCodeView::YToAddress(int y) -- cgit v1.2.3 From 892bbdade669def297b0469509dd648fef6478bd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 11 Nov 2014 09:50:11 -0500 Subject: DolphinWX: Eliminate some memory leaks Since the menus aren't actually assigned a parent, they would not be freed by wx. Plus, these should have initially been constructed on the stack in the first place. Technically any time someone right-clicked the game list they would be leaking memory. --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 2a6f53fe5c..5d70d1f52a 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -364,26 +364,26 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event) { bool isSymbol = m_symbol_db->GetSymbolFromAddr(m_selection) != nullptr; // popup menu - wxMenu* menu = new wxMenu; + wxMenu menu; //menu->Append(IDM_GOTOINMEMVIEW, "&Goto in mem view"); - menu->Append(IDM_FOLLOWBRANCH, _("&Follow branch"))->Enable(AddrToBranch(m_selection) ? true : false); - menu->AppendSeparator(); + menu.Append(IDM_FOLLOWBRANCH, _("&Follow branch"))->Enable(AddrToBranch(m_selection) ? true : false); + menu.AppendSeparator(); #if wxUSE_CLIPBOARD - menu->Append(IDM_COPYADDRESS, _("Copy &address")); - menu->Append(IDM_COPYFUNCTION, _("Copy &function"))->Enable(isSymbol); - menu->Append(IDM_COPYCODE, _("Copy &code line")); - menu->Append(IDM_COPYHEX, _("Copy &hex")); - menu->AppendSeparator(); + menu.Append(IDM_COPYADDRESS, _("Copy &address")); + menu.Append(IDM_COPYFUNCTION, _("Copy &function"))->Enable(isSymbol); + menu.Append(IDM_COPYCODE, _("Copy &code line")); + menu.Append(IDM_COPYHEX, _("Copy &hex")); + menu.AppendSeparator(); #endif - menu->Append(IDM_RENAMESYMBOL, _("Rename &symbol"))->Enable(isSymbol); - menu->AppendSeparator(); - menu->Append(IDM_RUNTOHERE, _("&Run To Here"))->Enable(Core::IsRunning()); - menu->Append(IDM_ADDFUNCTION, _("&Add function"))->Enable(Core::IsRunning()); - menu->Append(IDM_JITRESULTS, _("PPC vs X86"))->Enable(Core::IsRunning()); - menu->Append(IDM_INSERTBLR, _("Insert &blr"))->Enable(Core::IsRunning()); - menu->Append(IDM_INSERTNOP, _("Insert &nop"))->Enable(Core::IsRunning()); - menu->Append(IDM_PATCHALERT, _("Patch alert"))->Enable(Core::IsRunning()); - PopupMenu(menu); + menu.Append(IDM_RENAMESYMBOL, _("Rename &symbol"))->Enable(isSymbol); + menu.AppendSeparator(); + menu.Append(IDM_RUNTOHERE, _("&Run To Here"))->Enable(Core::IsRunning()); + menu.Append(IDM_ADDFUNCTION, _("&Add function"))->Enable(Core::IsRunning()); + menu.Append(IDM_JITRESULTS, _("PPC vs X86"))->Enable(Core::IsRunning()); + menu.Append(IDM_INSERTBLR, _("Insert &blr"))->Enable(Core::IsRunning()); + menu.Append(IDM_INSERTNOP, _("Insert &nop"))->Enable(Core::IsRunning()); + menu.Append(IDM_PATCHALERT, _("Patch alert"))->Enable(Core::IsRunning()); + PopupMenu(&menu); event.Skip(); } -- 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/CodeView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 5d70d1f52a..1c36a551fe 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -141,7 +141,7 @@ void CCodeView::ToggleBreakpoint(u32 address) Refresh(); // Propagate back to the parent window to update the breakpoint list. - wxCommandEvent evt(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS); + wxCommandEvent evt(wxEVT_HOST_COMMAND, IDM_UPDATE_BREAKPOINTS); GetEventHandler()->AddPendingEvent(evt); } @@ -311,7 +311,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) { // Propagate back to the parent window and tell it // to flip to the JIT tab for the current address. - wxCommandEvent jit_event(wxEVT_HOST_COMMAND, IDM_UPDATEJITPANE); + wxCommandEvent jit_event(wxEVT_HOST_COMMAND, IDM_UPDATE_JIT_PANE); GetEventHandler()->AddPendingEvent(jit_event); } break; -- 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/CodeView.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 1c36a551fe..648ae36e0f 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -10,24 +10,14 @@ #include #include #include -#include #include #include -#include #include #include -#include -#include -#include #include #include -#include #include -#include -#include #include -#include -#include #include "Common/CommonTypes.h" #include "Common/DebugInterface.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/CodeView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 648ae36e0f..2995c468dc 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.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/CodeView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 2995c468dc..4ec232ee89 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.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