diff --git a/src/plugins/baremetal/baremetaldebugsupport.cpp b/src/plugins/baremetal/baremetaldebugsupport.cpp index 0e71da2f3f2..c7d1b193bc3 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.cpp +++ b/src/plugins/baremetal/baremetaldebugsupport.cpp @@ -39,7 +39,7 @@ public: explicit BareMetalDebugSupport(RunControl *runControl) : Debugger::DebuggerRunTool(runControl) { - const auto dev = std::static_pointer_cast(device()); + const auto dev = std::static_pointer_cast(runControl->device()); if (!dev) { reportFailure(Tr::tr("Cannot debug: Kit has no device.")); return; @@ -59,7 +59,7 @@ public: private: void start() final { - const auto dev = std::static_pointer_cast(device()); + const auto dev = std::static_pointer_cast(runControl()->device()); QTC_ASSERT(dev, reportFailure(); return); IDebugServerProvider *p = DebugServerProviderManager::findProvider( dev->debugServerProviderId()); diff --git a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp index f5357283778..7224bf725d5 100644 --- a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp +++ b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp @@ -33,7 +33,7 @@ static RunWorker *createQdbDeviceInferiorWorker(RunControl *runControl, worker->setId("QdbDeviceInferiorWorker"); worker->setStartModifier([worker, runControl, qmlServices] { - CommandLine cmd{worker->device()->filePath(Constants::AppcontrollerFilepath)}; + CommandLine cmd{runControl->device()->filePath(Constants::AppcontrollerFilepath)}; int lowerPort = 0; int upperPort = 0; diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index eb37855515c..833f5e36f47 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1296,7 +1296,7 @@ void DebuggerEngine::setRunId(const QString &id) void DebuggerEngine::setRunTool(DebuggerRunTool *runTool) { d->m_runTool = runTool; - d->m_device = runTool->device(); + d->m_device = runTool->runControl()->device(); validateRunParameters(d->m_runParameters); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 1ed313de429..0f1e9b1ef30 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -578,11 +578,11 @@ void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup() cmd.addArg(qmlDebugTcpArguments(QmlDebuggerServices, runControl()->qmlChannel())); cmd.addArgs(commandLine.arguments(), CommandLine::Raw); } else { - cmd.setExecutable(device()->debugServerPath()); + cmd.setExecutable(runControl()->device()->debugServerPath()); if (cmd.isEmpty()) { - if (device()->osType() == Utils::OsTypeMac) { - const FilePath debugServerLocation = device()->filePath( + if (runControl()->device()->osType() == Utils::OsTypeMac) { + const FilePath debugServerLocation = runControl()->device()->filePath( "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/" "Resources/debugserver"); @@ -592,15 +592,15 @@ void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup() // TODO: In the future it is expected that the debugserver will be // replaced by lldb-server. Remove the check for debug server at that point. const FilePath lldbserver - = device()->filePath("lldb-server").searchInPath(); + = runControl()->device()->filePath("lldb-server").searchInPath(); if (lldbserver.isExecutableFile()) cmd.setExecutable(lldbserver); } } else { const FilePath gdbServerPath - = device()->filePath("gdbserver").searchInPath(); + = runControl()->device()->filePath("gdbserver").searchInPath(); FilePath lldbServerPath - = device()->filePath("lldb-server").searchInPath(); + = runControl()->device()->filePath("lldb-server").searchInPath(); // TODO: Which one should we prefer? if (gdbServerPath.isExecutableFile()) @@ -643,7 +643,7 @@ void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup() const auto port = runControl()->debugChannel().port(); cmd.addArg(QString(":%1").arg(port)); - if (device()->extraData(ProjectExplorer::Constants::SSH_FORWARD_DEBUGSERVER_PORT).toBool()) { + if (runControl()->device()->extraData(ProjectExplorer::Constants::SSH_FORWARD_DEBUGSERVER_PORT).toBool()) { QVariantHash extraData; extraData[RemoteLinux::Constants::SshForwardPort] = port; extraData[RemoteLinux::Constants::DisableSharing] = true; diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 2c16d6a150d..27732c2c14a 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -323,7 +323,7 @@ void DeviceCtlRunnerBase::start() } appendMessage(Tr::tr("Running \"%1\" on %2...") - .arg(m_bundlePath.toUserOutput(), device()->displayName()), + .arg(m_bundlePath.toUserOutput(), runControl()->device()->displayName()), NormalMessageFormat); // If the app is already running, we should first kill it, then launch again. @@ -906,7 +906,7 @@ IosDebugSupport::IosDebugSupport(RunControl *runControl) { setId("IosDebugSupport"); - IosDevice::ConstPtr dev = std::dynamic_pointer_cast(device()); + IosDevice::ConstPtr dev = std::dynamic_pointer_cast(runControl->device()); DebuggerRunParameters &rp = runParameters(); if (dev->type() == Ios::Constants::IOS_SIMULATOR_TYPE @@ -922,7 +922,7 @@ IosDebugSupport::IosDebugSupport(RunControl *runControl) addStartDependency(m_deviceCtlRunner); } - if (device()->type() == Ios::Constants::IOS_DEVICE_TYPE) { + if (runControl->device()->type() == Ios::Constants::IOS_DEVICE_TYPE) { if (dev->handler() == IosDevice::Handler::DeviceCtl) { QTC_CHECK(IosDeviceManager::isDeviceCtlDebugSupported()); rp.setStartMode(AttachToIosDevice); @@ -951,7 +951,7 @@ void IosDebugSupport::start() rp.setDisplayName(data->applicationName); rp.setContinueAfterAttach(true); - IosDevice::ConstPtr dev = std::dynamic_pointer_cast(device()); + IosDevice::ConstPtr dev = std::dynamic_pointer_cast(runControl()->device()); if (dev->type() == Ios::Constants::IOS_DEVICE_TYPE && dev->handler() == IosDevice::Handler::DeviceCtl) { const auto msgOnlyCppDebuggingSupported = [] { diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index f00d193ef88..52284c60170 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1882,11 +1882,6 @@ void RunWorker::appendMessage(const QString &msg, OutputFormat format, bool appe d->runControl->postMessage(msg, format, appendNewLine); } -IDevice::ConstPtr RunWorker::device() const -{ - return d->runControl->device(); -} - void RunWorker::addStartDependency(RunWorker *dependency) { d->startDependencies.append(dependency); diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 1c7d33434a6..6169113ab3e 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -58,7 +58,6 @@ public: // Part of read-only interface of RunControl for convenience. void appendMessage(const QString &msg, Utils::OutputFormat format, bool appendNewLine = true); - IDeviceConstPtr device() const; // States void initiateStart(); diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index 5834c1a22b0..c739fabae1d 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -185,7 +185,7 @@ public: QStringList arguments; if (runControl->usesDebugChannel()) { const int pdebugPort = runControl->debugChannel().port(); - cmd.setExecutable(debuggeeRunner->device()->filePath(QNX_DEBUG_EXECUTABLE)); + cmd.setExecutable(runControl->device()->filePath(QNX_DEBUG_EXECUTABLE)); arguments.append(QString::number(pdebugPort)); } if (runControl->usesQmlChannel()) { diff --git a/src/plugins/qnx/slog2inforunner.cpp b/src/plugins/qnx/slog2inforunner.cpp index 2346bc8caa4..1fea4d4026e 100644 --- a/src/plugins/qnx/slog2inforunner.cpp +++ b/src/plugins/qnx/slog2inforunner.cpp @@ -35,7 +35,7 @@ void Slog2InfoRunner::start() QTC_CHECK(!m_taskTreeRunner.isRunning()); const auto onTestSetup = [this](Process &process) { - process.setCommand(CommandLine{device()->filePath("slog2info")}); + process.setCommand(CommandLine{runControl()->device()->filePath("slog2info")}); }; const auto onTestDone = [this] { appendMessage(Tr::tr("Warning: \"slog2info\" is not found on the device, " @@ -43,7 +43,7 @@ void Slog2InfoRunner::start() }; const auto onLaunchTimeSetup = [this](Process &process) { - process.setCommand({device()->filePath("date"), "+\"%d %H:%M:%S\"", CommandLine::Raw}); + process.setCommand({runControl()->device()->filePath("date"), "+\"%d %H:%M:%S\"", CommandLine::Raw}); }; const auto onLaunchTimeDone = [this](const Process &process) { QTC_CHECK(!m_applicationId.isEmpty()); @@ -51,7 +51,7 @@ void Slog2InfoRunner::start() }; const auto onLogSetup = [this](Process &process) { - process.setCommand({device()->filePath("slog2info"), {"-w"}}); + process.setCommand({runControl()->device()->filePath("slog2info"), {"-w"}}); connect(&process, &Process::readyReadStandardOutput, this, [this, processPtr = &process] { processLogInput(QString::fromLatin1(processPtr->readAllRawStandardOutput())); }); diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 17de19d3445..bbd7e0d0542 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -123,9 +123,9 @@ QString MemcheckToolRunner::progressTitle() const void MemcheckToolRunner::start() { - if (device()->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { + if (runControl()->device()->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { m_process.reset(new Process); - m_process->setCommand({device()->filePath("echo"), "-n $SSH_CLIENT", CommandLine::Raw}); + m_process->setCommand({runControl()->device()->filePath("echo"), "-n $SSH_CLIENT", CommandLine::Raw}); connect(m_process.get(), &Process::done, this, [this] { const ProcessResult result = m_process->result(); const QByteArrayList data = m_process->rawStdOut().split(' ');