Commit 9be36be9 authored by Friedemann Kleint's avatar Friedemann Kleint

Debugger: Fix switching between assembler and source.

Do not drop stack index in resetLocation (which is called
when switching). Do not switch to source unless we have
the file.

Reviewed-by: hjk
parent fedd048f
......@@ -511,7 +511,6 @@ void DebuggerEngine::breakByFunction(const QString &functionName)
void DebuggerEngine::resetLocation()
{
d->m_disassemblerViewAgent.resetLocation();
d->m_stackHandler.setCurrentIndex(-1);
debuggerCore()->removeLocationMark();
}
......
......@@ -1201,10 +1201,14 @@ public slots:
currentEngine()->frameUp();
}
void handleOperateByInstructionTriggered()
void handleOperateByInstructionTriggered(bool operateByInstructionTriggered)
{
currentEngine()->gotoLocation(
currentEngine()->stackHandler()->currentFrame(), true);
// Go to source only if we have the file.
if (currentEngine()->stackHandler()->currentIndex() >= 0) {
const StackFrame frame = currentEngine()->stackHandler()->currentFrame();
if (operateByInstructionTriggered || frame.isUsable())
currentEngine()->gotoLocation(frame, true);
}
}
bool isActiveDebugLanguage(int lang) const
......@@ -1547,8 +1551,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
act = m_actions.frameUpAction = new QAction(tr("Move to Calling Frame"), this);
connect(act, SIGNAL(triggered()), SLOT(handleFrameUp()));
connect(debuggerCore()->action(OperateByInstruction), SIGNAL(triggered()),
SLOT(handleOperateByInstructionTriggered()));
connect(debuggerCore()->action(OperateByInstruction), SIGNAL(triggered(bool)),
SLOT(handleOperateByInstructionTriggered(bool)));
connect(&m_statusTimer, SIGNAL(timeout()), SLOT(clearStatusMessage()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment