From 960344d64d2f10404c980517d7b704acebec98d9 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Wed, 3 May 2017 20:52:03 +0100 Subject: [PATCH] CodeView: Set Symbol End Address added --- Source/Core/DolphinWX/Debugger/CodeView.cpp | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index 28ec7af083..22c4bbcf08 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -46,6 +46,7 @@ enum IDM_FOLLOWBRANCH, IDM_RENAMESYMBOL, IDM_SETSYMBOLSIZE, + IDM_SETSYMBOLEND, IDM_PATCHALERT, IDM_COPYFUNCTION, IDM_ADDFUNCTION, @@ -365,6 +366,30 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) } break; + case IDM_SETSYMBOLEND: + { + Symbol* symbol = m_symbol_db->GetSymbolFromAddr(m_selection); + if (!symbol) + break; + + wxTextEntryDialog dialog( + this, wxString::Format(_("Enter symbol (%s) end address:"), symbol->name.c_str()), + wxGetTextFromUserPromptStr, wxString::Format(wxT("%#08x"), symbol->address + symbol->size)); + + if (dialog.ShowModal() == wxID_OK) + { + unsigned long address; + if (dialog.GetValue().ToULong(&address, 0) && address <= std::numeric_limits::max() && + address >= symbol->address) + { + PPCAnalyst::ReanalyzeFunction(symbol->address, *symbol, address - symbol->address); + Refresh(); + Host_NotifyMapLoaded(); + } + } + } + break; + case IDM_PATCHALERT: break; @@ -392,6 +417,7 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event) #endif menu.Append(IDM_RENAMESYMBOL, _("Rename &symbol"))->Enable(isSymbol); menu.Append(IDM_SETSYMBOLSIZE, _("&Set symbol size"))->Enable(isSymbol); + menu.Append(IDM_SETSYMBOLEND, _("&Set symbol end address"))->Enable(isSymbol); menu.AppendSeparator(); menu.Append(IDM_RUNTOHERE, _("&Run To Here"))->Enable(Core::IsRunning()); menu.Append(IDM_ADDFUNCTION, _("&Add function"))->Enable(Core::IsRunning());