diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2017-06-05 18:26:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-05 18:26:33 -0700 |
| commit | cd78a7249f069576a973086592660e4f4bbfa3a2 (patch) | |
| tree | 38fd2afb0bc1b4b5a6d73487979b603e09176aee /Source/Core/DolphinWX/Debugger/CodeView.cpp | |
| parent | 065c3d78b7b17e7c8771c0a0b2d24d3b5d749e4e (diff) | |
| parent | 9b2cc62393c3bdfb3d5fd57f8608110b7df3f12a (diff) | |
Merge pull request #5408 from sepalani/assemble
CodeView: Assemble menu item added
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/CodeView.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Debugger/CodeView.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Debugger/CodeView.cpp index eb85cfa8b5..337e0e2972 100644 --- a/Source/Core/DolphinWX/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeView.cpp @@ -9,6 +9,7 @@ #include <memory> #include <string> #include <vector> + #include <wx/brush.h> #include <wx/clipbrd.h> #include <wx/colour.h> @@ -26,6 +27,8 @@ #include "Core/Core.h" #include "Core/Host.h" #include "Core/PowerPC/PPCAnalyst.h" +#include "Core/PowerPC/PowerPC.h" +#include "DolphinWX/Debugger/AssemblerEntryDialog.h" #include "DolphinWX/Debugger/CodeView.h" #include "DolphinWX/Debugger/DebuggerUIUtil.h" #include "DolphinWX/Globals.h" @@ -41,6 +44,7 @@ enum IDM_COPYCODE, IDM_INSERTBLR, IDM_INSERTNOP, + IDM_ASSEMBLE, IDM_RUNTOHERE, IDM_JITRESULTS, IDM_FOLLOWBRANCH, @@ -301,6 +305,28 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) Refresh(); break; + case IDM_ASSEMBLE: + { + if (!PowerPC::HostIsInstructionRAMAddress(m_selection)) + break; + const PowerPC::TryReadInstResult read_result = PowerPC::TryReadInstruction(m_selection); + if (!read_result.valid) + break; + AssemblerEntryDialog dialog(m_selection, this, _("Enter instruction code:"), + wxGetTextFromUserPromptStr, + wxString::Format(wxT("%#08x"), read_result.hex)); + if (dialog.ShowModal() == wxID_OK) + { + unsigned long code; + if (dialog.GetValue().ToULong(&code, 0) && code <= std::numeric_limits<u32>::max()) + { + m_debugger->InsertBLR(m_selection, code); + Refresh(); + } + } + break; + } + case IDM_JITRESULTS: { // Propagate back to the parent window and tell it @@ -424,6 +450,7 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event) 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_ASSEMBLE, _("Re&place Instruction"))->Enable(Core::IsRunning()); // menu.Append(IDM_PATCHALERT, _("Patch alert"))->Enable(Core::IsRunning()); PopupMenu(&menu); event.Skip(); |
