diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index b58a226b095..851bebac8c0 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1188,7 +1188,8 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, if (!kit) kit = guessKitFromAbis(Abi::abisOfBinary(FileName::fromString(executable))); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(kit); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, kit); debugger->setInferiorExecutable(executable); if (pid) { @@ -1960,7 +1961,8 @@ void DebuggerPluginPrivate::attachCore() setConfigValue("LastExternalStartScript", dlg.overrideStartScript()); setConfigValue("LastForceLocalCoreFile", dlg.forcesLocalCoreFile()); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(dlg.kit()); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, dlg.kit()); debugger->setInferiorExecutable(dlg.localExecutableFile()); debugger->setCoreFileName(dlg.localCoreFile()); @@ -1987,7 +1989,8 @@ void DebuggerPluginPrivate::startRemoteCdbSession() return; setConfigValue(connectionKey, dlg.connection()); - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + IDevice::ConstPtr device = DeviceKitInformation::device(kit); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new DebuggerRunTool(runControl, kit); debugger->setStartMode(AttachToRemoteServer); debugger->setCloseMode(KillAtClose); @@ -2045,7 +2048,7 @@ void DebuggerPluginPrivate::attachToRunningApplication() if (device->type() == PE::DESKTOP_DEVICE_TYPE) { attachToRunningProcess(kit, process, false); } else { - auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); + auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new RemoteAttachRunner(runControl, kit, process.pid); debugger->startRunControl(); } diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index b13f267fd02..3caf3916ba2 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -884,6 +884,12 @@ RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) : #endif } +RunControl::RunControl(const IDevice::ConstPtr &device, Core::Id mode) + : RunControl(nullptr, mode) +{ + d->device = device; +} + RunControl::~RunControl() { #ifdef WITH_JOURNALD diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index e7e0c4aa73b..aba94da1aa1 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -431,6 +431,7 @@ class PROJECTEXPLORER_EXPORT RunControl : public QObject public: RunControl(RunConfiguration *runConfiguration, Core::Id mode); + RunControl(const IDevice::ConstPtr &device, Core::Id mode); ~RunControl() override; void initiateStart();