Commit 97edcb79 authored by hjk's avatar hjk

debugger: start 'runcontrol-ification' of the debugger plugin.

This replaces most uses of DebuggerStartParameters by DebuggerRunControl
which is a simple RunControl with a DebuggerStartParameters member.

Plan is to move all global state to the run controls, and possibly
introduce specialized ones for core debugging etc.
parent a89643a8
......@@ -386,8 +386,9 @@ void CdbDebugEngine::startupChecks()
syncDebuggerPaths();
}
void CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
void CdbDebugEngine::startDebugger(const DebuggerRunControl *runControl)
{
DebuggerStartParameters *sp = &runControl->sp();
if (debugCDBExecution)
qDebug() << "startDebugger" << *sp;
CdbCore::BreakPoint::clearNormalizeFileNameCache();
......
......@@ -63,7 +63,7 @@ public:
virtual void shutdown();
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
virtual void startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters);
virtual void startDebugger(const DebuggerRunControl *runControl);
virtual void exitDebugger();
virtual void detachDebugger();
virtual void updateWatchData(const WatchData &data);
......
......@@ -269,7 +269,7 @@ struct DebuggerManagerPrivate
const QIcon m_locationMarkIcon;
// FIXME: Remove engine-specific state
DebuggerStartParametersPtr m_startParameters;
const DebuggerRunControl *m_runControl;
qint64 m_inferiorPid;
/// Views
......@@ -328,7 +328,6 @@ DebuggerManagerPrivate::DebuggerManagerPrivate(DebuggerManager *manager) :
m_stopIcon(QLatin1String(":/debugger/images/debugger_stop_small.png")),
m_interruptIcon(QLatin1String(":/debugger/images/debugger_interrupt_small.png")),
m_locationMarkIcon(QLatin1String(":/debugger/images/location_16.png")),
m_startParameters(new DebuggerStartParameters),
m_inferiorPid(0),
m_disassemblerViewAgent(manager),
m_engine(0)
......@@ -1061,11 +1060,12 @@ static IDebuggerEngine *debuggerEngineForMode(DebuggerStartMode startMode, QStri
#endif
}
void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
void DebuggerManager::startNewDebugger(const DebuggerRunControl *runControl)
{
if (d->m_state != DebuggerNotReady)
return;
d->m_startParameters = sp;
d->m_runControl = runControl;
const DebuggerStartParameters *sp = &runControl->sp();
d->m_inferiorPid = sp->attachPID > 0 ? sp->attachPID : 0;
const QString toolChainName = ProjectExplorer::ToolChain::toolChainName(
ProjectExplorer::ToolChain::ToolChainType(sp->toolChainType));
......@@ -1113,7 +1113,7 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
setBusyCursor(false);
setState(EngineStarting);
connect(d->m_engine, SIGNAL(startFailed()), this, SLOT(startFailed()));
d->m_engine->startDebugger(sp);
d->m_engine->startDebugger(runControl);
const unsigned engineCapabilities = d->m_engine->debuggerCapabilities();
theDebuggerAction(OperateByInstruction)
......@@ -1174,11 +1174,6 @@ void DebuggerManager::abortDebugger()
d->m_codeModelSnapshot = CPlusPlus::Snapshot();
}
DebuggerStartParametersPtr DebuggerManager::startParameters() const
{
return d->m_startParameters;
}
qint64 DebuggerManager::inferiorPid() const
{
return d->m_inferiorPid;
......@@ -1316,7 +1311,7 @@ void DebuggerManager::aboutToUnloadSession()
// Note that at startup, session switches may occur, which interfer
// with command-line debugging startup.
if (d->m_engine && state() != DebuggerNotReady
&& d->m_startParameters->startMode == StartInternal)
&& runControl()->sp().startMode == StartInternal)
d->m_engine->shutdown();
}
......@@ -1651,7 +1646,7 @@ QString DebuggerManager::qtDumperLibraryName() const
{
if (theDebuggerAction(UseCustomDebuggingHelperLocation)->value().toBool())
return theDebuggerAction(CustomDebuggingHelperLocation)->value().toString();
return d->m_startParameters->dumperLibrary;
return runControl()->sp().dumperLibrary;
}
QStringList DebuggerManager::qtDumperLibraryLocations() const
......@@ -1663,7 +1658,7 @@ QStringList DebuggerManager::qtDumperLibraryLocations() const
tr("%1 (explicitly set in the Debugger Options)").arg(customLocation);
return QStringList(location);
}
return d->m_startParameters->dumperLibraryLocations;
return runControl()->sp().dumperLibraryLocations;
}
void DebuggerManager::showQtDumperLibraryWarning(const QString &details)
......@@ -2033,6 +2028,11 @@ void DebuggerManager::openTextEditor(const QString &titlePattern,
d->m_plugin->openTextEditor(titlePattern, contents);
}
DebuggerRunControl *DebuggerManager::runControl() const
{
return const_cast<DebuggerRunControl *>(d->m_runControl);
}
//////////////////////////////////////////////////////////////////////
//
// AbstractDebuggerEngine
......@@ -2060,6 +2060,7 @@ void IDebuggerEngine::setState(DebuggerState state, bool forced)
//
//////////////////////////////////////////////////////////////////////
/*
void DebuggerManager::runTest(const QString &fileName)
{
d->m_startParameters->executable = fileName;
......@@ -2067,6 +2068,7 @@ void DebuggerManager::runTest(const QString &fileName)
d->m_startParameters->workingDirectory.clear();
//startNewDebugger(StartInternal);
}
*/
} // namespace Debugger
......@@ -156,7 +156,7 @@ public:
QLabel *statusLabel() const;
Internal::IDebuggerEngine *currentEngine() const;
DebuggerStartParametersPtr startParameters() const;
DebuggerRunControl *runControl() const;
qint64 inferiorPid() const;
QMessageBox *showMessageBox(int icon, const QString &title, const QString &text,
......@@ -177,7 +177,7 @@ public:
static DebuggerManager *instance();
public slots:
void startNewDebugger(const DebuggerStartParametersPtr &sp);
void startNewDebugger(const DebuggerRunControl *runControl);
void exitDebugger();
void abortDebugger();
......
......@@ -1369,7 +1369,7 @@ void DebuggerPlugin::handleStateChanged(int state)
//const bool running = state == InferiorRunning;
const bool detachable = state == InferiorStopped
&& m_manager->startParameters()->startMode != AttachCore;
&& m_manager->runControl()->sp().startMode != AttachCore;
m_startExternalAction->setEnabled(!started && !starting);
m_attachExternalAction->setEnabled(!started && !starting);
......@@ -1445,7 +1445,7 @@ void DebuggerPlugin::showSettingsDialog()
void DebuggerPlugin::startExternalApplication()
{
const DebuggerStartParametersPtr sp(new DebuggerStartParameters);
DebuggerStartParameters sp;
StartExternalDialog dlg(m_uiSwitcher->mainWindow());
dlg.setExecutableFile(
configValue(_("LastExternalExecutableFile")).toString());
......@@ -1462,11 +1462,11 @@ void DebuggerPlugin::startExternalApplication()
dlg.executableArguments());
setConfigValue(_("LastExternalWorkingDirectory"),
dlg.workingDirectory());
sp->executable = dlg.executableFile();
sp->startMode = StartExternal;
sp->workingDirectory = dlg.workingDirectory();
sp.executable = dlg.executableFile();
sp.startMode = StartExternal;
sp.workingDirectory = dlg.workingDirectory();
if (!dlg.executableArguments().isEmpty())
sp->processArgs = dlg.executableArguments().split(QLatin1Char(' '));
sp.processArgs = dlg.executableArguments().split(QLatin1Char(' '));
if (dlg.breakAtMain())
m_manager->breakByFunctionMain();
......@@ -1491,11 +1491,11 @@ void DebuggerPlugin::attachExternalApplication(qint64 pid,
tr("Cannot attach to PID 0"));
return;
}
const DebuggerStartParametersPtr sp(new DebuggerStartParameters);
sp->attachPID = pid;
sp->executable = binary;
sp->crashParameter = crashParameter;
sp->startMode = crashParameter.isEmpty() ? AttachExternal : AttachCrashedExternal;
DebuggerStartParameters sp;
sp.attachPID = pid;
sp.executable = binary;
sp.crashParameter = crashParameter;
sp.startMode = crashParameter.isEmpty() ? AttachExternal : AttachCrashedExternal;
if (RunControl *runControl = m_debuggerRunControlFactory->create(sp))
ProjectExplorerPlugin::instance()->startRunControl(runControl, PE::DEBUGMODE);
}
......@@ -1518,11 +1518,11 @@ void DebuggerPlugin::attachCore()
void DebuggerPlugin::attachCore(const QString &core, const QString &exe)
{
const DebuggerStartParametersPtr sp(new DebuggerStartParameters);
sp->executable = exe;
sp->coreFile = core;
sp->displayName = tr("Core file: \"%1\"").arg(core);
sp->startMode = AttachCore;
DebuggerStartParameters sp;
sp.executable = exe;
sp.coreFile = core;
sp.displayName = tr("Core file: \"%1\"").arg(core);
sp.startMode = AttachCore;
if (RunControl *runControl = m_debuggerRunControlFactory->create(sp))
ProjectExplorerPlugin::instance()->
startRunControl(runControl, PE::DEBUGMODE);
......@@ -1530,7 +1530,7 @@ void DebuggerPlugin::attachCore(const QString &core, const QString &exe)
void DebuggerPlugin::startRemoteApplication()
{
const DebuggerStartParametersPtr sp(new DebuggerStartParameters);
DebuggerStartParameters sp;
StartRemoteDialog dlg(m_uiSwitcher->mainWindow());
QStringList arches;
arches.append(_("i386:x86-64:intel"));
......@@ -1559,17 +1559,17 @@ void DebuggerPlugin::startRemoteApplication()
setConfigValue(_("LastServerStartScript"), dlg.serverStartScript());
setConfigValue(_("LastUseServerStartScript"), dlg.useServerStartScript());
setConfigValue(_("LastSysroot"), dlg.sysRoot());
sp->remoteChannel = dlg.remoteChannel();
sp->remoteArchitecture = dlg.remoteArchitecture();
sp->executable = dlg.localExecutable();
sp->displayName = dlg.localExecutable();
sp->debuggerCommand = dlg.debugger(); // Override toolchain-detection.
if (!sp->debuggerCommand.isEmpty())
sp->toolChainType = ProjectExplorer::ToolChain::INVALID;
sp->startMode = AttachToRemote;
sp.remoteChannel = dlg.remoteChannel();
sp.remoteArchitecture = dlg.remoteArchitecture();
sp.executable = dlg.localExecutable();
sp.displayName = dlg.localExecutable();
sp.debuggerCommand = dlg.debugger(); // Override toolchain-detection.
if (!sp.debuggerCommand.isEmpty())
sp.toolChainType = ProjectExplorer::ToolChain::INVALID;
sp.startMode = AttachToRemote;
if (dlg.useServerStartScript())
sp->serverStartScript = dlg.serverStartScript();
sp->sysRoot = dlg.sysRoot();
sp.serverStartScript = dlg.serverStartScript();
sp.sysRoot = dlg.sysRoot();
if (RunControl *runControl = m_debuggerRunControlFactory->create(sp))
ProjectExplorerPlugin::instance()
......@@ -1586,7 +1586,7 @@ void DebuggerPlugin::enableReverseDebuggingTriggered(const QVariant &value)
void DebuggerPlugin::attachRemoteTcf()
{
const DebuggerStartParametersPtr sp(new DebuggerStartParameters);
DebuggerStartParameters sp;
AttachTcfDialog dlg(m_uiSwitcher->mainWindow());
QStringList arches;
arches.append(_("i386:x86-64:intel"));
......@@ -1605,12 +1605,12 @@ void DebuggerPlugin::attachRemoteTcf()
setConfigValue(_("LastTcfRemoteArchitecture"), dlg.remoteArchitecture());
setConfigValue(_("LastTcfServerStartScript"), dlg.serverStartScript());
setConfigValue(_("LastTcfUseServerStartScript"), dlg.useServerStartScript());
sp->remoteChannel = dlg.remoteChannel();
sp->remoteArchitecture = dlg.remoteArchitecture();
sp->serverStartScript = dlg.serverStartScript();
sp->startMode = AttachTcf;
sp.remoteChannel = dlg.remoteChannel();
sp.remoteArchitecture = dlg.remoteArchitecture();
sp.serverStartScript = dlg.serverStartScript();
sp.startMode = AttachTcf;
if (dlg.useServerStartScript())
sp->serverStartScript = dlg.serverStartScript();
sp.serverStartScript = dlg.serverStartScript();
if (RunControl *runControl = m_debuggerRunControlFactory->create(sp))
ProjectExplorerPlugin::instance()
......
......@@ -57,11 +57,11 @@ namespace Debugger {
class DebuggerManager;
class DebuggerUISwitcher;
class DebuggerRunControlFactory;
namespace Internal {
class BreakpointData;
class DebuggerRunControlFactory;
class DebugMode;
class DebuggerPlugin : public ExtensionSystem::IPlugin
......
......@@ -50,7 +50,6 @@
using namespace ProjectExplorer;
namespace Debugger {
namespace Internal {
////////////////////////////////////////////////////////////////////////
//
......@@ -75,24 +74,24 @@ QString DebuggerRunControlFactory::displayName() const
return tr("Debug");
}
static DebuggerStartParametersPtr localStartParameters(RunConfiguration *runConfiguration)
static DebuggerStartParameters localStartParameters(RunConfiguration *runConfiguration)
{
DebuggerStartParametersPtr sp(new DebuggerStartParameters());
DebuggerStartParameters sp;
QTC_ASSERT(runConfiguration, return sp);
LocalApplicationRunConfiguration *rc =
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
QTC_ASSERT(rc, return sp);
sp->startMode = StartInternal;
sp->executable = rc->executable();
sp->environment = rc->environment().toStringList();
sp->workingDirectory = rc->workingDirectory();
sp->processArgs = rc->commandLineArguments();
sp->toolChainType = rc->toolChainType();
sp->useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console;
sp->dumperLibrary = rc->dumperLibrary();
sp->dumperLibraryLocations = rc->dumperLibraryLocations();
sp->displayName = rc->displayName();
sp.startMode = StartInternal;
sp.executable = rc->executable();
sp.environment = rc->environment().toStringList();
sp.workingDirectory = rc->workingDirectory();
sp.processArgs = rc->commandLineArguments();
sp.toolChainType = rc->toolChainType();
sp.useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console;
sp.dumperLibrary = rc->dumperLibrary();
sp.dumperLibraryLocations = rc->dumperLibraryLocations();
sp.displayName = rc->displayName();
// Find qtInstallPath.
QString qmakePath = DebuggingHelperLibrary::findSystemQt(rc->environment());
......@@ -105,7 +104,7 @@ static DebuggerStartParametersPtr localStartParameters(RunConfiguration *runConf
proc.waitForFinished();
QByteArray ba = proc.readAllStandardOutput().trimmed();
QFileInfo fi(QString::fromLocal8Bit(ba) + "/..");
sp->qtInstallPath = fi.absoluteFilePath();
sp.qtInstallPath = fi.absoluteFilePath();
}
return sp;
}
......@@ -114,11 +113,11 @@ RunControl *DebuggerRunControlFactory::create(RunConfiguration *runConfiguration
const QString &mode)
{
QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0);
DebuggerStartParametersPtr sp = localStartParameters(runConfiguration);
DebuggerStartParameters sp = localStartParameters(runConfiguration);
return new DebuggerRunControl(m_manager, sp);
}
RunControl *DebuggerRunControlFactory::create(const DebuggerStartParametersPtr &sp)
RunControl *DebuggerRunControlFactory::create(const DebuggerStartParameters &sp)
{
return new DebuggerRunControl(m_manager, sp);
}
......@@ -139,7 +138,7 @@ QWidget *DebuggerRunControlFactory::createConfigurationWidget(RunConfiguration *
////////////////////////////////////////////////////////////////////////
DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
const DebuggerStartParametersPtr &startParameters)
const DebuggerStartParameters &startParameters)
: RunControl(0, ProjectExplorer::Constants::DEBUGMODE),
m_startParameters(startParameters),
m_manager(manager),
......@@ -159,19 +158,19 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
connect(this, SIGNAL(stopRequested()),
m_manager, SLOT(exitDebugger()));
if (m_startParameters->environment.empty())
m_startParameters->environment = ProjectExplorer::Environment().toStringList();
m_startParameters->useTerminal = false;
if (m_startParameters.environment.empty())
m_startParameters.environment = ProjectExplorer::Environment().toStringList();
m_startParameters.useTerminal = false;
}
QString DebuggerRunControl::displayName() const
{
return m_startParameters->displayName;
return m_startParameters.displayName;
}
void DebuggerRunControl::setCustomEnvironment(ProjectExplorer::Environment env)
{
m_startParameters->environment = env.toStringList();
m_startParameters.environment = env.toStringList();
}
void DebuggerRunControl::init()
......@@ -184,9 +183,9 @@ void DebuggerRunControl::start()
QString errorMessage;
QString settingsCategory;
QString settingsPage;
if (m_manager->checkDebugConfiguration(m_startParameters->toolChainType, &errorMessage,
if (m_manager->checkDebugConfiguration(m_startParameters.toolChainType, &errorMessage,
&settingsCategory, &settingsPage)) {
m_manager->startNewDebugger(m_startParameters);
m_manager->startNewDebugger(this);
emit started();
} else {
appendMessage(this, errorMessage, true);
......@@ -225,5 +224,4 @@ bool DebuggerRunControl::isRunning() const
return m_running;
}
} // namespace Internal
} // namespace Debugger
......@@ -78,12 +78,8 @@ public:
DebuggerStartMode startMode;
};
typedef QSharedPointer<DebuggerStartParameters> DebuggerStartParametersPtr;
//DEBUGGER_EXPORT QDebug operator<<(QDebug str, const DebuggerStartParameters &);
namespace Internal {
class DEBUGGER_EXPORT DebuggerRunControlFactory
: public ProjectExplorer::IRunControlFactory
{
......@@ -102,7 +98,7 @@ public:
// This is used by the "Non-Standard" scenarios, e.g. Attach to Core.
ProjectExplorer::RunControl *create(const DebuggerStartParametersPtr &sp);
ProjectExplorer::RunControl *create(const DebuggerStartParameters &sp);
private:
DebuggerManager *m_manager;
......@@ -116,7 +112,7 @@ class DEBUGGER_EXPORT DebuggerRunControl
public:
DebuggerRunControl(DebuggerManager *manager,
const DebuggerStartParametersPtr &startParameters);
const DebuggerStartParameters &startParameters);
void setCustomEnvironment(ProjectExplorer::Environment env);
......@@ -128,6 +124,8 @@ public:
Q_SLOT void debuggingFinished();
const DebuggerStartParameters &sp() const { return m_startParameters; }
signals:
void stopRequested();
......@@ -137,12 +135,11 @@ private slots:
private:
void init();
DebuggerStartParametersPtr m_startParameters;
DebuggerManager *m_manager;
DebuggerStartParameters m_startParameters;
bool m_running;
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGERRUNNER_H
......@@ -107,6 +107,8 @@ protected:
{ m_engine->setState(state); }
const DebuggerStartParameters &startParameters() const
{ return m_engine->startParameters(); }
const DebuggerRunControl *runControl() const
{ return m_engine->runControl(); }
void debugMessage(const QString &msg) const
{ m_engine->debugMessage(msg); }
void showStatusMessage(const QString &msg) const
......
......@@ -514,9 +514,9 @@ void GdbEngine::tryLoadDebuggingHelpersClassic()
m_debuggingHelperState = DebuggingHelperLoadTried;
QByteArray dlopenLib;
if (startParameters().startMode == AttachToRemote
|| startParameters().startMode == StartRemoteGdb)
dlopenLib = startParameters().remoteDumperLib;
if (runControl()->sp().startMode == AttachToRemote
|| runControl()->sp().startMode == StartRemoteGdb)
dlopenLib = runControl()->sp().remoteDumperLib;
else
dlopenLib = manager()->qtDumperLibraryName().toLocal8Bit();
......
......@@ -211,8 +211,8 @@ void GdbEngine::disconnectDebuggingHelperActions()
DebuggerStartMode GdbEngine::startMode() const
{
QTC_ASSERT(!m_startParameters.isNull(), return NoStartMode);
return m_startParameters->startMode;
QTC_ASSERT(m_runControl, return NoStartMode);
return startParameters().startMode;
}
QMainWindow *GdbEngine::mainWindow() const
......@@ -1355,7 +1355,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
&& reason == "signal-received") {
QByteArray name = data.findChild("signal-name").data();
if (name != STOP_SIGNAL
&& (startParameters().startMode != AttachToRemote
&& (runControl()->sp().startMode != AttachToRemote
|| name != CROSS_STOP_SIGNAL))
initHelpers = false;
}
......@@ -1434,7 +1434,7 @@ void GdbEngine::handleStop1(const GdbMi &data)
// Ignore these as they are showing up regularly when
// stopping debugging.
if (name != STOP_SIGNAL
&& (startParameters().startMode != AttachToRemote
&& (runControl()->sp().startMode != AttachToRemote
|| name != CROSS_STOP_SIGNAL)) {
QString msg = tr("<p>The inferior stopped because it received a "
"signal from the Operating System.<p>"
......@@ -1536,8 +1536,8 @@ void GdbEngine::handleHasPython(const GdbResponse &response)
QByteArray cmd = "set environment ";
cmd += Debugger::Constants::Internal::LD_PRELOAD_ENV_VAR;
cmd += ' ';
cmd += startParameters().startMode == StartRemoteGdb
? startParameters().remoteDumperLib
cmd += runControl()->sp().startMode == StartRemoteGdb
? runControl()->sp().remoteDumperLib
: cmd += manager()->qtDumperLibraryName().toLocal8Bit();
postCommand(cmd);
m_debuggingHelperState = DebuggingHelperLoadTried;
......@@ -1737,8 +1737,9 @@ bool GdbEngine::checkConfiguration(int toolChain, QString *errorMessage, QString
return true;
}
AbstractGdbAdapter *GdbEngine::createAdapter(const DebuggerStartParametersPtr &sp)
AbstractGdbAdapter *GdbEngine::createAdapter(const DebuggerRunControl *runControl)
{
const DebuggerStartParameters *sp = &runControl->sp();
switch (sp->toolChainType) {
case ProjectExplorer::ToolChain::WINSCW: // S60
case ProjectExplorer::ToolChain::GCCE:
......@@ -1769,7 +1770,7 @@ AbstractGdbAdapter *GdbEngine::createAdapter(const DebuggerStartParametersPtr &s
}
}
void GdbEngine::startDebugger(const DebuggerStartParametersPtr &sp)
void GdbEngine::startDebugger(const DebuggerRunControl *runControl)
{
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
// This should be set by the constructor or in exitDebugger()
......@@ -1787,10 +1788,10 @@ void GdbEngine::startDebugger(const DebuggerStartParametersPtr &sp)
fp->setKeepOnFinish(false);
m_progress->reportStarted();
m_startParameters = sp;
m_runControl = runControl;
delete m_gdbAdapter;
m_gdbAdapter = createAdapter(sp);
m_gdbAdapter = createAdapter(m_runControl);
connectAdapter();
if (m_gdbAdapter->dumperHandling() != AbstractGdbAdapter::DumperNotAvailable)
......@@ -3036,8 +3037,10 @@ void GdbEngine::handleMakeSnapshot(const GdbResponse &response)
void GdbEngine::activateSnapshot(int index)
{
SnapshotData snapshot = m_manager->snapshotHandler()->setCurrentIndex(index);
m_startParameters->startMode = AttachCore;
m_startParameters->coreFile = snapshot.location();
DebuggerStartParameters &sp = const_cast<DebuggerStartParameters &>(m_runControl->sp());
sp.startMode = AttachCore;
sp.coreFile = snapshot.location();
if (state() == InferiorUnrunnable) {
// All is well. We are looking at another core file.
......@@ -3055,7 +3058,7 @@ void GdbEngine::activateSnapshot(int index)
return;
debugMessage(_("KILLING DEBUGGER AS REQUESTED BY USER"));
delete m_gdbAdapter;
m_gdbAdapter = createAdapter(m_startParameters);
m_gdbAdapter = createAdapter(m_runControl);
postCommand("kill", NeedsStop, CB(handleActivateSnapshot));
} else {
activateSnapshot2();
......@@ -4002,11 +4005,11 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
m_gdb = QString::fromLatin1(qgetenv("QTC_DEBUGGER_PATH"));
if (m_gdb.isEmpty())
m_gdb = m_gdbBinaryToolChainMap->key(m_startParameters->toolChainType);
m_gdb = m_gdbBinaryToolChainMap->key(m_runControl->sp().toolChainType);
if (m_gdb.isEmpty())
m_gdb = gdb;
if (m_gdb.isEmpty()) {
handleAdapterStartFailed(msgNoBinaryForToolChain(m_startParameters->toolChainType),
handleAdapterStartFailed(msgNoBinaryForToolChain(m_runControl->sp().toolChainType),
GdbOptionsPage::settingsId());
return false;
}
......@@ -4241,7 +4244,7 @@ void GdbEngine::handleAdapterStarted()
void GdbEngine::handleInferiorPrepared()
{
const QByteArray qtInstallPath = m_startParameters->qtInstallPath.toLocal8Bit();
const QByteArray qtInstallPath = m_runControl->sp().qtInstallPath.toLocal8Bit();
if (!qtInstallPath.isEmpty()) {
QByteArray qtBuildPath;