Debugger: Modify hotkeys, add delete breakpoint context menu button

Add assemble opcode hotkey as well


Update debugger docs
This commit is contained in:
Ty Lamontagne 2021-06-09 18:52:19 -04:00 committed by refractionpcsx2
parent f9909f4226
commit 58a9460f7c
4 changed files with 45 additions and 43 deletions

View File

@ -8,10 +8,11 @@ urlcolor: "cyan"
# Debugger Key Bindings # Debugger Key Bindings
## Disassembly View ## Disassembly View
- `Ctrl+G` - goto - `G` - goto
- `Ctrl+E` - edit breakpoint - `E` - edit breakpoint
- `Ctrl+D` - enable/disable breakpoint - `D` - enable/disable breakpoint
- `Ctrl+B` - add breakpoint - `B` - add breakpoint
- `M` - assemble opcode
- `Right Arrow` - follow branch/position memory view to accessed address - `Right Arrow` - follow branch/position memory view to accessed address
- `Left Arrow` - go back one branch level/goto pc - `Left Arrow` - go back one branch level/goto pc
- `Up Arrow` - move cursor up one line - `Up Arrow` - move cursor up one line
@ -26,7 +27,7 @@ urlcolor: "cyan"
## Memory View ## Memory View
- `Ctrl+G` - goto - `G` - goto
- `Ctrl+B` - add breakpoint - `Ctrl+B` - add breakpoint
- `Left Arrow` - move cursor back one byte/nibble - `Left Arrow` - move cursor back one byte/nibble
- `Right Arrow` - move cursor ahead one byte/nibble - `Right Arrow` - move cursor ahead one byte/nibble

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2014 PCSX2 Dev Team * Copyright (C) 2002-2021 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -799,10 +799,17 @@ void CtrlDisassemblyView::keydownEvent(wxKeyEvent& evt)
{ {
u32 windowEnd = manager.getNthNextAddress(windowStart,visibleRows); u32 windowEnd = manager.getNthNextAddress(windowStart,visibleRows);
if (evt.ControlDown()) switch (evt.GetKeyCode())
{
switch (evt.GetKeyCode())
{ {
case 'g':
case 'G':
{
u64 addr;
if (!executeExpressionWindow(this, cpu, addr))
return;
gotoAddress(addr);
}
break;
case 'd': case 'd':
case 'D': case 'D':
toggleBreakpoint(true); toggleBreakpoint(true);
@ -813,40 +820,21 @@ void CtrlDisassemblyView::keydownEvent(wxKeyEvent& evt)
break; break;
case 'b': case 'b':
case 'B': case 'B':
{
BreakpointWindow bpw(this,cpu);
if (bpw.ShowModal() == wxID_OK)
{
bpw.addBreakpoint();
postEvent(debEVT_UPDATE,0);
}
}
break;
case 'g':
case 'G':
{
u64 addr;
if (!executeExpressionWindow(this,cpu,addr))
return;
gotoAddress(addr);
}
break;
default:
evt.Skip();
break;
}
} else {
if (evt.GetEventType() == wxEVT_CHAR && evt.GetKeyCode() >= 0x20 && evt.GetKeyCode() < 0x80)
{ {
std::string str; BreakpointWindow bpw(this, cpu);
str += (char) evt.GetKeyCode(); if (bpw.ShowModal() == wxID_OK)
{
assembleOpcode(curAddress,str); bpw.addBreakpoint();
return; postEvent(debEVT_UPDATE, 0);
}
} }
break;
switch (evt.GetKeyCode()) case 'm':
case 'M':
{ {
assembleOpcode(curAddress, "");
}
break;
case WXK_LEFT: case WXK_LEFT:
if (jumpStack.empty()) if (jumpStack.empty())
{ {
@ -909,7 +897,6 @@ void CtrlDisassemblyView::keydownEvent(wxKeyEvent& evt)
evt.Skip(); evt.Skip();
break; break;
} }
}
redraw(); redraw();
} }

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2014 PCSX2 Dev Team * Copyright (C) 2002-2021 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -504,6 +504,15 @@ void CtrlMemView::keydownEvent(wxKeyEvent& evt)
switch (evt.GetKeyCode()) switch (evt.GetKeyCode())
{ {
case 'g':
case 'G':
{
u64 addr;
if (!executeExpressionWindow(this, cpu, addr))
return;
gotoAddress(addr, true);
}
break;
case WXK_LEFT: case WXK_LEFT:
scrollCursor(-1); scrollCursor(-1);
break; break;

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs /* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2014 PCSX2 Dev Team * Copyright (C) 2002-2021 PCSX2 Dev Team
* *
* PCSX2 is free software: you can redistribute it and/or modify it under the terms * PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found- * of the GNU Lesser General Public License as published by the Free Software Found-
@ -169,6 +169,7 @@ enum BreakpointListMenuIdentifiers
{ {
ID_BREAKPOINTLIST_ENABLE = 1, ID_BREAKPOINTLIST_ENABLE = 1,
ID_BREAKPOINTLIST_EDIT, ID_BREAKPOINTLIST_EDIT,
ID_BREAKPOINTLIST_DELETE,
ID_BREAKPOINTLIST_ADDNEW, ID_BREAKPOINTLIST_ADDNEW,
}; };
@ -458,6 +459,9 @@ void BreakpointList::onPopupClick(wxCommandEvent& evt)
case ID_BREAKPOINTLIST_EDIT: case ID_BREAKPOINTLIST_EDIT:
editBreakpoint(index); editBreakpoint(index);
break; break;
case ID_BREAKPOINTLIST_DELETE:
removeBreakpoint(index);
break;
case ID_BREAKPOINTLIST_ADDNEW: case ID_BREAKPOINTLIST_ADDNEW:
postEvent(debEVT_BREAKPOINTWINDOW,0); postEvent(debEVT_BREAKPOINTWINDOW,0);
break; break;
@ -477,6 +481,7 @@ void BreakpointList::showMenu(const wxPoint& pos)
{ {
menu.AppendCheckItem(ID_BREAKPOINTLIST_ENABLE, L"Enable"); menu.AppendCheckItem(ID_BREAKPOINTLIST_ENABLE, L"Enable");
menu.Append(ID_BREAKPOINTLIST_EDIT, L"Edit"); menu.Append(ID_BREAKPOINTLIST_EDIT, L"Edit");
menu.Append(ID_BREAKPOINTLIST_DELETE, L"Delete");
menu.AppendSeparator(); menu.AppendSeparator();
// check if the breakpoint is enabled // check if the breakpoint is enabled