public slots:
void updateDebugActions();
- void handleExecDetach() { currentEngine()->detachDebugger(); }
- void handleExecContinue() { currentEngine()->continueInferior(); }
- void handleExecInterrupt() { currentEngine()->requestInterruptInferior(); }
- void handleExecReset() { currentEngine()->notifyEngineIll(); } // FIXME: Check.
+
+ void handleExecDetach()
+ {
+ resetLocation();
+ currentEngine()->detachDebugger();
+ }
+
+ void handleExecContinue()
+ {
+ resetLocation();
+ currentEngine()->continueInferior();
+ }
+
+ void handleExecInterrupt()
+ {
+ resetLocation();
+ currentEngine()->requestInterruptInferior();
+ }
+
+ void handleExecReset()
+ {
+ resetLocation();
+ currentEngine()->notifyEngineIll(); // FIXME: Check.
+ }
void handleExecStep()
{
resetLocation();
- if (debuggerCore()->boolSetting(OperateByInstruction))
+ if (boolSetting(OperateByInstruction))
currentEngine()->executeStepI();
else
currentEngine()->executeStep();
void handleExecNext()
{
resetLocation();
- if (debuggerCore()->boolSetting(OperateByInstruction))
+ if (boolSetting(OperateByInstruction))
currentEngine()->executeNextI();
else
currentEngine()->executeNext();
}
void resetLocation();
+ void resetLocationTimeout();
void removeLocationMark();
+ void doRemoveLocationMark();
QVariant sessionValue(const QString &name);
void setSessionValue(const QString &name, const QVariant &value);
QIcon locationMarkIcon() const { return m_locationMarkIcon; }
bool m_busy;
QTimer m_statusTimer;
+ QTimer m_locationTimer;
QString m_lastPermanentStatusMessage;
mutable CPlusPlus::Snapshot m_codeModelSnapshot;
bool m_gdbBinariesChanged;
};
-DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) : m_startRemoteCdbAction(0)
+DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
{
QTC_ASSERT(!theDebuggerCore, /**/);
theDebuggerCore = this;
m_plugin = plugin;
+ m_startRemoteCdbAction = 0;
m_shuttingDown = false;
m_statusLabel = 0;
m_threadBox = 0;
act = m_actions.frameUpAction = new QAction(tr("Move to Calling Frame"), this);
connect(act, SIGNAL(triggered()), SLOT(handleFrameUp()));
- connect(debuggerCore()->action(OperateByInstruction), SIGNAL(triggered(bool)),
+ connect(action(OperateByInstruction), SIGNAL(triggered(bool)),
SLOT(handleOperateByInstructionTriggered(bool)));
connect(&m_statusTimer, SIGNAL(timeout()), SLOT(clearStatusMessage()));
- connect(debuggerCore()->action(ExecuteCommand), SIGNAL(triggered()),
+ connect(action(ExecuteCommand), SIGNAL(triggered()),
SLOT(executeDebuggerCommand()));
// Cpp/Qml ui setup
Constants::FRAME_UP, cppDebuggercontext);
- cmd = am->registerAction(debuggerCore()->action(OperateByInstruction),
+ cmd = am->registerAction(action(OperateByInstruction),
Constants::OPERATE_BY_INSTRUCTION, cppDebuggercontext);
cmd->setAttribute(Command::CA_Hide);
m_uiSwitcher->addMenuAction(cmd, CppLanguage);
SLOT(editorOpened(Core::IEditor*)));
// Application interaction
- connect(debuggerCore()->action(SettingsDialog), SIGNAL(triggered()),
+ connect(action(SettingsDialog), SIGNAL(triggered()),
SLOT(showSettingsDialog()));
// Toolbar
SIGNAL(dockResetRequested(Debugger::DebuggerLanguages)),
SLOT(setSimpleDockWidgetArrangement(Debugger::DebuggerLanguages)));
- connect(debuggerCore()->action(EnableReverseDebugging),
+ connect(action(EnableReverseDebugging),
SIGNAL(valueChanged(QVariant)),
SLOT(enableReverseDebuggingTriggered(QVariant)));
SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
SLOT(onCurrentProjectChanged(ProjectExplorer::Project*)));
+ connect(&m_locationTimer,
+ SIGNAL(timeout()),
+ SLOT(doRemoveLocationMark()));
+
return true;
}
m_actions.watchAction2->setEnabled(true);
m_actions.breakAction->setEnabled(true);
//m_actions.snapshotAction->setEnabled(false);
- debuggerCore()->action(OperateByInstruction)->setEnabled(false);
+ action(OperateByInstruction)->setEnabled(false);
m_actions.exitAction->setEnabled(false);
m_actions.resetAction->setEnabled(false);
m_actions.jumpToLineAction->setEnabled(false);
m_actions.nextAction->setEnabled(false);
- debuggerCore()->action(AutoDerefPointers)->setEnabled(true);
- debuggerCore()->action(ExpandStack)->setEnabled(false);
- debuggerCore()->action(ExecuteCommand)->setEnabled(m_state == InferiorStopOk);
+ action(AutoDerefPointers)->setEnabled(true);
+ action(ExpandStack)->setEnabled(false);
+ action(ExecuteCommand)->setEnabled(m_state == InferiorStopOk);
m_scriptConsoleWindow->setEnabled(false);
const uint caps = engine->debuggerCapabilities();
const bool canReverse = (caps & ReverseSteppingCapability)
- && debuggerCore()->boolSetting(EnableReverseDebugging);
+ && boolSetting(EnableReverseDebugging);
m_actions.reverseDirectionAction->setEnabled(canReverse);
m_actions.watchAction1->setEnabled(true);
m_actions.breakAction->setEnabled(true);
//m_actions.snapshotAction->setEnabled(stopped && (caps & SnapshotCapability));
- debuggerCore()->action(OperateByInstruction)->setEnabled(stopped);
+ action(OperateByInstruction)->setEnabled(stopped);
m_actions.resetAction->setEnabled(m_state != DebuggerNotReady
&& m_state != DebuggerFinished);
m_actions.nextAction->setEnabled(stopped);
const bool canDeref = actionsEnabled && (caps & AutoDerefPointersCapability);
- debuggerCore()->action(AutoDerefPointers)->setEnabled(canDeref);
- debuggerCore()->action(AutoDerefPointers)->setEnabled(true);
- debuggerCore()->action(ExpandStack)->setEnabled(actionsEnabled);
- debuggerCore()->action(ExecuteCommand)->setEnabled(m_state == InferiorStopOk);
+ action(AutoDerefPointers)->setEnabled(canDeref);
+ action(AutoDerefPointers)->setEnabled(true);
+ action(ExpandStack)->setEnabled(actionsEnabled);
+ action(ExecuteCommand)->setEnabled(m_state == InferiorStopOk);
const bool notbusy = m_state == InferiorStopOk
|| m_state == DebuggerNotReady
if (m_shuttingDown)
return;
+ doRemoveLocationMark();
+
bool newEditor = false;
ITextEditor *editor =
BaseTextEditor::openEditorAt(file, line, 0, QString(),
const CPlusPlus::Snapshot &DebuggerPluginPrivate::cppCodeModelSnapshot() const
{
- if (m_codeModelSnapshot.isEmpty()
- && debuggerCore()->action(UseCodeModel)->isChecked())
- m_codeModelSnapshot = CppTools::CppModelManagerInterface::instance()->snapshot();
+ using namespace CppTools;
+ if (m_codeModelSnapshot.isEmpty() && action(UseCodeModel)->isChecked())
+ m_codeModelSnapshot = CppModelManagerInterface::instance()->snapshot();
return m_codeModelSnapshot;
}
void DebuggerPluginPrivate::removeLocationMark()
{
+ m_locationTimer.setSingleShot(true);
+ m_locationTimer.start(80);
+}
+
+void DebuggerPluginPrivate::doRemoveLocationMark()
+{
+ m_locationTimer.stop();
m_locationMark.reset();
}
_(Qt4ProjectManager::Constants::QT_SETTINGS_CATEGORY),
_(Qt4ProjectManager::Constants::QTVERSION_SETTINGS_PAGE_ID));
} else if (dialog.clickedButton() == helperOff) {
- debuggerCore()->action(UseDebuggingHelpers)
- ->setValue(qVariantFromValue(false), false);
+ action(UseDebuggingHelpers)->setValue(qVariantFromValue(false), false);
}
}
{
m_snapshotHandler->removeSnapshot(runControl);
disconnectEngine();
- if (debuggerCore()->boolSetting(SwitchModeOnExit))
- if (m_snapshotHandler->size() == 0)
- activatePreviousMode();
+ if (boolSetting(SwitchModeOnExit) && m_snapshotHandler->size() == 0)
+ activatePreviousMode();
}
void DebuggerPluginPrivate::remoteCommand(const QStringList &options,