forked from qt-creator/qt-creator
Make local custom executables run independent of device selection
Task-number: QTCREATORBUG-16199 Change-Id: I1e9e2103e626c6480fa1c5ac9b2b3f8ac93e3038 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -598,6 +598,14 @@ public:
|
||||
{
|
||||
if (!(mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain))
|
||||
return false;
|
||||
|
||||
Runnable runnable = runConfig->runnable();
|
||||
if (runnable.is<StandardRunnable>()) {
|
||||
IDevice::ConstPtr device = runnable.as<StandardRunnable>().device;
|
||||
if (device && device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE)
|
||||
return true;
|
||||
}
|
||||
|
||||
return DeviceTypeKitInformation::deviceTypeId(runConfig->target()->kit())
|
||||
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE
|
||||
|| isDebuggableScript(runConfig);
|
||||
|
@@ -138,9 +138,15 @@ static bool isLocal(RunConfiguration *runConfiguration)
|
||||
|
||||
bool LocalApplicationRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id mode) const
|
||||
{
|
||||
return mode == Constants::NORMAL_RUN_MODE
|
||||
&& isLocal(runConfiguration)
|
||||
&& runConfiguration->runnable().is<StandardRunnable>();
|
||||
if (mode != Constants::NORMAL_RUN_MODE)
|
||||
return false;
|
||||
const Runnable runnable = runConfiguration->runnable();
|
||||
if (!runnable.is<StandardRunnable>())
|
||||
return false;
|
||||
const IDevice::ConstPtr device = runnable.as<StandardRunnable>().device;
|
||||
if (device && device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE)
|
||||
return true;
|
||||
return isLocal(runConfiguration);
|
||||
}
|
||||
|
||||
RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage)
|
||||
|
@@ -42,6 +42,7 @@ public:
|
||||
QString workingDirectory;
|
||||
Utils::Environment environment;
|
||||
ApplicationLauncher::Mode runMode = ApplicationLauncher::Gui;
|
||||
IDevice::ConstPtr device; // Override the kit's device. Keep unset by default.
|
||||
};
|
||||
|
||||
PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2);
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
@@ -253,6 +254,7 @@ Runnable CustomExecutableRunConfiguration::runnable() const
|
||||
r.workingDirectory = workingDirectory();
|
||||
r.environment = extraAspect<LocalEnvironmentAspect>()->environment();
|
||||
r.runMode = extraAspect<TerminalAspect>()->runMode();
|
||||
r.device = DeviceManager::instance()->defaultDevice(Constants::DESKTOP_DEVICE_TYPE);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@@ -85,8 +85,9 @@ void ValgrindRunControl::start()
|
||||
ValgrindRunner *run = runner();
|
||||
run->setValgrindExecutable(m_settings->valgrindExecutable());
|
||||
run->setValgrindArguments(genericToolArguments() + toolArguments());
|
||||
run->setDevice(device());
|
||||
run->setDebuggee(runnable().as<StandardRunnable>());
|
||||
const StandardRunnable r = runnable().as<StandardRunnable>();
|
||||
run->setDevice(r.device ? r.device : device());
|
||||
run->setDebuggee(r);
|
||||
|
||||
connect(run, &ValgrindRunner::processOutputReceived,
|
||||
this, &ValgrindRunControl::receiveProcessOutput);
|
||||
|
Reference in New Issue
Block a user