diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index 1a25e6cada6..8e913fff6c5 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -338,10 +338,7 @@ void ApplicationLauncherPrivate::start() m_state = Run; m_stopRequested = false; - CommandLine cmd = m_runnable.command; - // FIXME: RunConfiguration::runnable() should give us the correct, on-device path, instead of fixing it up here. - cmd.setExecutable(m_runnable.device->mapToGlobalPath(cmd.executable())); - m_process.setCommand(cmd); + m_process.setCommand(m_runnable.command); m_process.setWorkingDirectory(m_runnable.workingDirectory); m_process.setEnvironment(m_runnable.environment); m_process.setExtraData(m_runnable.extraData); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 7a842b52ccb..0e8fe86aefd 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -53,7 +53,8 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe exeAspect->setExpectedKind(PathChooser::ExistingCommand); exeAspect->setEnvironmentChange(EnvironmentChange::fromFixedEnvironment(envAspect->environment())); - addAspect(); + auto argsAspect = addAspect(); + addAspect(envAspect); addAspect(); @@ -61,6 +62,12 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe exeAspect->setEnvironmentChange(EnvironmentChange::fromFixedEnvironment(envAspect->environment())); }); + setCommandLineGetter([exeAspect, argsAspect, this] { + const FilePath executable = exeAspect->executable(); + const QString arguments = argsAspect->arguments(macroExpander()); + return CommandLine{executable, arguments, CommandLine::Raw}; + }); + setDefaultDisplayName(defaultDisplayName()); } diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 542bae58016..09bd39ebba6 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -209,13 +209,17 @@ RunConfiguration::RunConfiguration(Target *target, Utils::Id id) [this] { return commandLine().executable(); }); - m_commandLineGetter = [this] { + m_commandLineGetter = [target, this] { FilePath executable; if (const auto executableAspect = aspect()) executable = executableAspect->executable(); QString arguments; if (const auto argumentsAspect = aspect()) arguments = argumentsAspect->arguments(macroExpander()); + + if (IDevice::ConstPtr dev = DeviceKitAspect::device(target->kit())) + executable = dev->filePath(executable.path()); + return CommandLine{executable, arguments, CommandLine::Raw}; };