forked from qt-creator/qt-creator
Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here essentially replaces all .is<StandardRunnable> by 'true'. .as<StandardRunnable> by no-op, and fixes the fallout. Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -126,7 +126,7 @@ void CallgrindController::run(Option option)
|
||||
connect(m_controllerProcess, &ApplicationLauncher::finished,
|
||||
this, &CallgrindController::controllerProcessClosed);
|
||||
|
||||
StandardRunnable controller = m_valgrindRunnable;
|
||||
Runnable controller = m_valgrindRunnable;
|
||||
controller.executable = CALLGRIND_CONTROL_BINARY;
|
||||
controller.runMode = ApplicationLauncher::Gui;
|
||||
controller.commandLineArguments = QString("%1 %2").arg(toOptionString(option)).arg(m_pid);
|
||||
@@ -280,8 +280,7 @@ void CallgrindController::cleanupTempFile()
|
||||
|
||||
void CallgrindController::setValgrindRunnable(const Runnable &runnable)
|
||||
{
|
||||
QTC_ASSERT(runnable.is<StandardRunnable>(), return);
|
||||
m_valgrindRunnable = runnable.as<StandardRunnable>();
|
||||
m_valgrindRunnable = runnable;
|
||||
}
|
||||
|
||||
} // namespace Callgrind
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <ssh/sftpchannel.h>
|
||||
#include <ssh/sshconnection.h>
|
||||
|
||||
#include <projectexplorer/runnables.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <QProcess>
|
||||
|
||||
@@ -83,7 +83,7 @@ private:
|
||||
void controllerProcessClosed(bool success);
|
||||
|
||||
ProjectExplorer::ApplicationLauncher *m_controllerProcess = nullptr;
|
||||
ProjectExplorer::StandardRunnable m_valgrindRunnable;
|
||||
ProjectExplorer::Runnable m_valgrindRunnable;
|
||||
qint64 m_pid = 0;
|
||||
|
||||
Option m_lastOption = Unknown;
|
||||
|
||||
@@ -727,7 +727,7 @@ MemcheckTool::MemcheckTool()
|
||||
void MemcheckTool::heobAction()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
StandardRunnable sr;
|
||||
Runnable sr;
|
||||
Abi abi;
|
||||
bool hasLocalRc = false;
|
||||
Kit *kit = nullptr;
|
||||
@@ -739,13 +739,11 @@ void MemcheckTool::heobAction()
|
||||
abi = ToolChainKitInformation::targetAbi(kit);
|
||||
|
||||
const Runnable runnable = rc->runnable();
|
||||
if (runnable.is<StandardRunnable>()) {
|
||||
sr = runnable.as<StandardRunnable>();
|
||||
const IDevice::ConstPtr device = sr.device;
|
||||
hasLocalRc = device && device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||
if (!hasLocalRc)
|
||||
hasLocalRc = DeviceTypeKitInformation::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||
}
|
||||
sr = runnable;
|
||||
const IDevice::ConstPtr device = sr.device;
|
||||
hasLocalRc = device && device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||
if (!hasLocalRc)
|
||||
hasLocalRc = DeviceTypeKitInformation::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,8 +83,7 @@ void ValgrindToolRunner::start()
|
||||
m_runner.setValgrindExecutable(m_settings->valgrindExecutable());
|
||||
m_runner.setValgrindArguments(genericToolArguments() + toolArguments());
|
||||
m_runner.setDevice(device());
|
||||
QTC_ASSERT(runnable().is<StandardRunnable>(), reportFailure());
|
||||
m_runner.setDebuggee(runnable().as<StandardRunnable>());
|
||||
m_runner.setDebuggee(runnable());
|
||||
|
||||
connect(&m_runner, &ValgrindRunner::processOutputReceived,
|
||||
this, &ValgrindToolRunner::receiveProcessOutput);
|
||||
@@ -114,8 +113,7 @@ void ValgrindToolRunner::stop()
|
||||
|
||||
QString ValgrindToolRunner::executable() const
|
||||
{
|
||||
QTC_ASSERT(runnable().is<StandardRunnable>(), return QString());
|
||||
return runnable().as<StandardRunnable>().executable;
|
||||
return runnable().executable;
|
||||
}
|
||||
|
||||
QStringList ValgrindToolRunner::genericToolArguments() const
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/runnables.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
@@ -477,7 +477,7 @@ void ValgrindMemcheckParserTest::testRealValgrind()
|
||||
QString executable = QProcessEnvironment::systemEnvironment().value("VALGRIND_TEST_BIN", fakeValgrindExecutable());
|
||||
qDebug() << "running exe:" << executable << " HINT: set VALGRIND_TEST_BIN to change this";
|
||||
|
||||
ProjectExplorer::StandardRunnable debuggee;
|
||||
ProjectExplorer::Runnable debuggee;
|
||||
debuggee.executable = executable;
|
||||
debuggee.environment = sysEnv;
|
||||
ValgrindRunner runner;
|
||||
@@ -514,7 +514,7 @@ void ValgrindMemcheckParserTest::testValgrindStartError()
|
||||
QFETCH(QString, debuggee);
|
||||
QFETCH(QString, debuggeeArgs);
|
||||
|
||||
ProjectExplorer::StandardRunnable debuggeeExecutable;
|
||||
ProjectExplorer::Runnable debuggeeExecutable;
|
||||
debuggeeExecutable.executable = debuggee;
|
||||
debuggeeExecutable.environment = Utils::Environment::systemEnvironment();
|
||||
debuggeeExecutable.commandLineArguments = debuggeeArgs;
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
void findPidOutputReceived(const QString &out);
|
||||
|
||||
ValgrindRunner *q;
|
||||
StandardRunnable m_debuggee;
|
||||
Runnable m_debuggee;
|
||||
ApplicationLauncher m_valgrindProcess;
|
||||
IDevice::ConstPtr m_device;
|
||||
|
||||
@@ -106,7 +106,7 @@ void ValgrindRunner::Private::run()
|
||||
fullArgs << "--dsymutil=yes";
|
||||
fullArgs << m_debuggee.executable;
|
||||
|
||||
StandardRunnable valgrind;
|
||||
Runnable valgrind;
|
||||
valgrind.executable = m_valgrindExecutable;
|
||||
valgrind.workingDirectory = m_debuggee.workingDirectory;
|
||||
valgrind.environment = m_debuggee.environment;
|
||||
@@ -154,7 +154,7 @@ void ValgrindRunner::Private::remoteProcessStarted()
|
||||
// plain path to exe, m_valgrindExe contains e.g. env vars etc. pp.
|
||||
const QString proc = m_valgrindExecutable.split(' ').last();
|
||||
|
||||
StandardRunnable findPid;
|
||||
Runnable findPid;
|
||||
findPid.executable = "/bin/sh";
|
||||
// sleep required since otherwise we might only match "bash -c..."
|
||||
// and not the actual valgrind run
|
||||
@@ -238,7 +238,7 @@ void ValgrindRunner::setValgrindArguments(const QStringList &toolArguments)
|
||||
d->m_valgrindArguments = toolArguments;
|
||||
}
|
||||
|
||||
void ValgrindRunner::setDebuggee(const StandardRunnable &debuggee)
|
||||
void ValgrindRunner::setDebuggee(const Runnable &debuggee)
|
||||
{
|
||||
d->m_debuggee = debuggee;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/runnables.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <utils/outputformat.h>
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
void setValgrindExecutable(const QString &executable);
|
||||
void setValgrindArguments(const QStringList &toolArguments);
|
||||
void setDebuggee(const ProjectExplorer::StandardRunnable &debuggee);
|
||||
void setDebuggee(const ProjectExplorer::Runnable &debuggee);
|
||||
void setProcessChannelMode(QProcess::ProcessChannelMode mode);
|
||||
void setLocalServerAddress(const QHostAddress &localServerAddress);
|
||||
void setDevice(const ProjectExplorer::IDevice::ConstPtr &device);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/runnables.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
@@ -77,7 +77,7 @@ QString ValgrindTestRunnerTest::runTestBinary(const QString &binary, const QStri
|
||||
const QFileInfo binPathFileInfo(appBinDir, binary);
|
||||
if (!binPathFileInfo.isExecutable())
|
||||
return QString();
|
||||
ProjectExplorer::StandardRunnable debuggee;
|
||||
ProjectExplorer::Runnable debuggee;
|
||||
const QString &binPath = binPathFileInfo.canonicalFilePath();
|
||||
debuggee.executable = binPath;
|
||||
debuggee.environment = Utils::Environment::systemEnvironment();
|
||||
|
||||
Reference in New Issue
Block a user