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

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) ...@@ -511,7 +511,6 @@ void DebuggerEngine::breakByFunction(const QString &functionName)
void DebuggerEngine::resetLocation() void DebuggerEngine::resetLocation()
{ {
d->m_disassemblerViewAgent.resetLocation(); d->m_disassemblerViewAgent.resetLocation();
d->m_stackHandler.setCurrentIndex(-1);
debuggerCore()->removeLocationMark(); debuggerCore()->removeLocationMark();
} }
......
...@@ -1201,10 +1201,14 @@ public slots: ...@@ -1201,10 +1201,14 @@ public slots:
currentEngine()->frameUp(); currentEngine()->frameUp();
} }
void handleOperateByInstructionTriggered() void handleOperateByInstructionTriggered(bool operateByInstructionTriggered)
{ {
currentEngine()->gotoLocation( // Go to source only if we have the file.
currentEngine()->stackHandler()->currentFrame(), true); if (currentEngine()->stackHandler()->currentIndex() >= 0) {
const StackFrame frame = currentEngine()->stackHandler()->currentFrame();
if (operateByInstructionTriggered || frame.isUsable())
currentEngine()->gotoLocation(frame, true);
}
} }
bool isActiveDebugLanguage(int lang) const bool isActiveDebugLanguage(int lang) const
...@@ -1547,8 +1551,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, ...@@ -1547,8 +1551,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
act = m_actions.frameUpAction = new QAction(tr("Move to Calling Frame"), this); act = m_actions.frameUpAction = new QAction(tr("Move to Calling Frame"), this);
connect(act, SIGNAL(triggered()), SLOT(handleFrameUp())); connect(act, SIGNAL(triggered()), SLOT(handleFrameUp()));
connect(debuggerCore()->action(OperateByInstruction), SIGNAL(triggered()), connect(debuggerCore()->action(OperateByInstruction), SIGNAL(triggered(bool)),
SLOT(handleOperateByInstructionTriggered())); SLOT(handleOperateByInstructionTriggered(bool)));
connect(&m_statusTimer, SIGNAL(timeout()), SLOT(clearStatusMessage())); 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