forked from qt-creator/qt-creator
Debugger: Rework step{In,Out,Over} handling
Main menu action pass operation to current engine, everything else
is handled there.
Combine execute{Step,Next} and execute{Step,Next}I functions.
Implementation were mostly similar, in some cases unneeded
(the instruction-wise version e.g. for Python)
Drop GDB-isms 'step', 'next' in favor of 'step in' and 'step over'.
Change-Id: I232232bc7a67d9d297a74f1c81dc43be96787d34
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -691,11 +691,11 @@ void DebuggerEnginePrivate::setupViews()
|
||||
|
||||
m_stepOverAction.setIcon(Icons::STEP_OVER_TOOLBAR.icon());
|
||||
connect(&m_stepOverAction, &QAction::triggered,
|
||||
m_engine, &DebuggerEngine::handleExecNext);
|
||||
m_engine, &DebuggerEngine::handleExecStepOver);
|
||||
|
||||
m_stepIntoAction.setIcon(Icons::STEP_INTO_TOOLBAR.icon());
|
||||
connect(&m_stepIntoAction, &QAction::triggered,
|
||||
m_engine, &DebuggerEngine::handleExecStep);
|
||||
m_engine, &DebuggerEngine::handleExecStepIn);
|
||||
|
||||
m_stepOutAction.setIcon(Icons::STEP_OUT_TOOLBAR.icon());
|
||||
connect(&m_stepOutAction, &QAction::triggered,
|
||||
@@ -1787,16 +1787,16 @@ DebuggerToolTipManager *DebuggerEngine::toolTipManager()
|
||||
return &d->m_toolTipManager;
|
||||
}
|
||||
|
||||
bool DebuggerEngine::debuggerActionsEnabled() const
|
||||
{
|
||||
return debuggerActionsEnabledHelper(d->m_state);
|
||||
}
|
||||
|
||||
bool DebuggerEngine::operatesByInstruction() const
|
||||
{
|
||||
return d->m_operateByInstructionAction.isChecked();
|
||||
}
|
||||
|
||||
bool DebuggerEngine::debuggerActionsEnabled() const
|
||||
{
|
||||
return debuggerActionsEnabledHelper(d->m_state);
|
||||
}
|
||||
|
||||
void DebuggerEngine::operateByInstructionTriggered(bool on)
|
||||
{
|
||||
// Go to source only if we have the file.
|
||||
@@ -2291,31 +2291,25 @@ void DebuggerEngine::handleReset()
|
||||
resetInferior();
|
||||
}
|
||||
|
||||
void DebuggerEngine::handleExecStep()
|
||||
void DebuggerEngine::handleExecStepIn()
|
||||
{
|
||||
if (state() == DebuggerNotReady) {
|
||||
DebuggerRunTool::setBreakOnMainNextTime();
|
||||
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
||||
} else {
|
||||
resetLocation();
|
||||
if (operatesByInstruction())
|
||||
executeStepI();
|
||||
else
|
||||
executeStep();
|
||||
executeStepIn(operatesByInstruction());
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerEngine::handleExecNext()
|
||||
void DebuggerEngine::handleExecStepOver()
|
||||
{
|
||||
if (state() == DebuggerNotReady) {
|
||||
DebuggerRunTool::setBreakOnMainNextTime();
|
||||
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
||||
} else {
|
||||
resetLocation();
|
||||
if (operatesByInstruction())
|
||||
executeNextI();
|
||||
else
|
||||
executeNext();
|
||||
executeStepOver(operatesByInstruction());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user