Added a "Step Out" (aka "Step return") function to the debugger.

Conflicts:
	Source/Core/DolphinWX/Debugger/CodeWindow.h
This commit is contained in:
skidau 2014-10-15 20:04:23 +11:00
parent f895648eb9
commit 219a5078e8
3 changed files with 28 additions and 0 deletions

View File

@ -180,6 +180,10 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event)
StepOver(); StepOver();
break; break;
case IDM_STEPOUT:
StepOut();
break;
case IDM_TOGGLE_BREAKPOINT: case IDM_TOGGLE_BREAKPOINT:
ToggleBreakpoint(); ToggleBreakpoint();
break; break;
@ -320,6 +324,21 @@ void CCodeWindow::StepOver()
} }
} }
void CCodeWindow::StepOut()
{
if (CCPU::IsStepping())
{
PowerPC::breakpoints.Add(LR, true);
CCPU::EnableStepping(false);
JumpToAddress(PC);
Update();
UpdateButtonStates();
// Update all toolbars in the aui manager
Parent->UpdateGUI();
}
}
void CCodeWindow::ToggleBreakpoint() void CCodeWindow::ToggleBreakpoint()
{ {
if (CCPU::IsStepping()) if (CCPU::IsStepping())
@ -443,6 +462,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& core_startup_parameter
pDebugMenu->Append(IDM_STEP, _("Step &Into\tF11")); pDebugMenu->Append(IDM_STEP, _("Step &Into\tF11"));
pDebugMenu->Append(IDM_STEPOVER, _("Step &Over\tF10")); pDebugMenu->Append(IDM_STEPOVER, _("Step &Over\tF10"));
pDebugMenu->Append(IDM_STEPOUT, _("Step O&ut\tSHIFT+F11"));
pDebugMenu->Append(IDM_TOGGLE_BREAKPOINT, _("Toggle &Breakpoint\tF9")); pDebugMenu->Append(IDM_TOGGLE_BREAKPOINT, _("Toggle &Breakpoint\tF9"));
pDebugMenu->AppendSeparator(); pDebugMenu->AppendSeparator();
@ -607,6 +627,7 @@ void CCodeWindow::InitBitmaps()
// load original size 48x48 // load original size 48x48
m_Bitmaps[Toolbar_Step] = wxGetBitmapFromMemory(toolbar_add_breakpoint_png); m_Bitmaps[Toolbar_Step] = wxGetBitmapFromMemory(toolbar_add_breakpoint_png);
m_Bitmaps[Toolbar_StepOver] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); m_Bitmaps[Toolbar_StepOver] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_StepOut] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_Skip] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); m_Bitmaps[Toolbar_Skip] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_GotoPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); m_Bitmaps[Toolbar_GotoPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
m_Bitmaps[Toolbar_SetPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png); m_Bitmaps[Toolbar_SetPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
@ -624,6 +645,7 @@ void CCodeWindow::PopulateToolbar(wxToolBar* toolBar)
toolBar->SetToolBitmapSize(wxSize(w, h)); toolBar->SetToolBitmapSize(wxSize(w, h));
WxUtils::AddToolbarButton(toolBar, IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step], _("Step into the next instruction")); WxUtils::AddToolbarButton(toolBar, IDM_STEP, _("Step"), m_Bitmaps[Toolbar_Step], _("Step into the next instruction"));
WxUtils::AddToolbarButton(toolBar, IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver], _("Step over the next instruction")); WxUtils::AddToolbarButton(toolBar, IDM_STEPOVER, _("Step Over"), m_Bitmaps[Toolbar_StepOver], _("Step over the next instruction"));
WxUtils::AddToolbarButton(toolBar, IDM_STEPOUT, _("Step Out"), m_Bitmaps[Toolbar_StepOut], _("Step out of the current function"));
WxUtils::AddToolbarButton(toolBar, IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip], _("Skips the next instruction completely")); WxUtils::AddToolbarButton(toolBar, IDM_SKIP, _("Skip"), m_Bitmaps[Toolbar_Skip], _("Skips the next instruction completely"));
toolBar->AddSeparator(); toolBar->AddSeparator();
WxUtils::AddToolbarButton(toolBar, IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC], _("Go to the current instruction")); WxUtils::AddToolbarButton(toolBar, IDM_GOTOPC, _("Show PC"), m_Bitmaps[Toolbar_GotoPC], _("Go to the current instruction"));
@ -660,6 +682,7 @@ void CCodeWindow::UpdateButtonStates()
if (!Initialized) if (!Initialized)
{ {
ToolBar->EnableTool(IDM_STEPOVER, false); ToolBar->EnableTool(IDM_STEPOVER, false);
ToolBar->EnableTool(IDM_STEPOUT, false);
ToolBar->EnableTool(IDM_SKIP, false); ToolBar->EnableTool(IDM_SKIP, false);
} }
else else
@ -667,11 +690,13 @@ void CCodeWindow::UpdateButtonStates()
if (!Stepping) if (!Stepping)
{ {
ToolBar->EnableTool(IDM_STEPOVER, false); ToolBar->EnableTool(IDM_STEPOVER, false);
ToolBar->EnableTool(IDM_STEPOUT, false);
ToolBar->EnableTool(IDM_SKIP, false); ToolBar->EnableTool(IDM_SKIP, false);
} }
else else
{ {
ToolBar->EnableTool(IDM_STEPOVER, true); ToolBar->EnableTool(IDM_STEPOVER, true);
ToolBar->EnableTool(IDM_STEPOUT, true);
ToolBar->EnableTool(IDM_SKIP, true); ToolBar->EnableTool(IDM_SKIP, true);
} }
} }

View File

@ -126,6 +126,7 @@ private:
// Debugger functions // Debugger functions
void SingleStep(); void SingleStep();
void StepOver(); void StepOver();
void StepOut();
void ToggleBreakpoint(); void ToggleBreakpoint();
void UpdateLists(); void UpdateLists();

View File

@ -14,6 +14,7 @@ enum
{ {
Toolbar_Step, Toolbar_Step,
Toolbar_StepOver, Toolbar_StepOver,
Toolbar_StepOut,
Toolbar_Skip, Toolbar_Skip,
Toolbar_GotoPC, Toolbar_GotoPC,
Toolbar_SetPC, Toolbar_SetPC,
@ -230,6 +231,7 @@ enum
ID_TOOLBAR_DEBUG, ID_TOOLBAR_DEBUG,
IDM_STEP, IDM_STEP,
IDM_STEPOVER, IDM_STEPOVER,
IDM_STEPOUT,
IDM_TOGGLE_BREAKPOINT, IDM_TOGGLE_BREAKPOINT,
IDM_SKIP, IDM_SKIP,
IDM_SETPC, IDM_SETPC,