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
This commit is contained in:
Friedemann Kleint
2010-11-22 12:21:56 +01:00
parent fedd048fd0
commit 9be36be951
2 changed files with 9 additions and 6 deletions

View File

@@ -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()));