diff --git a/src/plugins/analyzerbase/analyzerruncontrol.cpp b/src/plugins/analyzerbase/analyzerruncontrol.cpp index 52cae96034d..93819b7d7d7 100644 --- a/src/plugins/analyzerbase/analyzerruncontrol.cpp +++ b/src/plugins/analyzerbase/analyzerruncontrol.cpp @@ -66,9 +66,9 @@ AnalyzerRunControl::AnalyzerRunControl(RunConfiguration *runConfiguration, Core: this, &AnalyzerRunControl::stopIt); } -const AnalyzerRunnable &AnalyzerRunControl::runnable() const +const StandardRunnable &AnalyzerRunControl::runnable() const { - return RunControl::runnable().as(); + return RunControl::runnable().as(); } const AnalyzerConnection &AnalyzerRunControl::connection() const diff --git a/src/plugins/analyzerbase/analyzerruncontrol.h b/src/plugins/analyzerbase/analyzerruncontrol.h index ebd069662d4..30983dec5c9 100644 --- a/src/plugins/analyzerbase/analyzerruncontrol.h +++ b/src/plugins/analyzerbase/analyzerruncontrol.h @@ -30,6 +30,7 @@ #include "analyzerstartparameters.h" #include +#include #include @@ -58,7 +59,7 @@ public: virtual void pause() {} virtual void unpause() {} - const AnalyzerRunnable &runnable() const; + const ProjectExplorer::StandardRunnable &runnable() const; const AnalyzerConnection &connection() const; virtual void notifyRemoteSetupDone(quint16) {} diff --git a/src/plugins/analyzerbase/analyzerstartparameters.h b/src/plugins/analyzerbase/analyzerstartparameters.h index beddaff3637..3f01f20b1bb 100644 --- a/src/plugins/analyzerbase/analyzerstartparameters.h +++ b/src/plugins/analyzerbase/analyzerstartparameters.h @@ -27,24 +27,14 @@ #define ANALYZERSTARTPARAMETERS_H #include "analyzerbase_global.h" -#include "analyzerconstants.h" -#include -#include +#include #include -#include #include namespace Analyzer { -class ANALYZER_EXPORT AnalyzerRunnable -{ -public: - QString debuggee; - QString debuggeeArgs; -}; - class ANALYZER_EXPORT AnalyzerConnection { public: diff --git a/src/plugins/analyzerbase/startremotedialog.cpp b/src/plugins/analyzerbase/startremotedialog.cpp index 92e62c6ce39..79c37c390ff 100644 --- a/src/plugins/analyzerbase/startremotedialog.cpp +++ b/src/plugins/analyzerbase/startremotedialog.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -136,17 +137,13 @@ QSsh::SshConnectionParameters StartRemoteDialog::sshParams() const return device->sshParameters(); } -AnalyzerRunnable StartRemoteDialog::runnable() const +StandardRunnable StartRemoteDialog::runnable() const { - AnalyzerRunnable r; - r.debuggee = d->executable->text(); - r.debuggeeArgs = d->arguments->text(); + StandardRunnable r; + r.executable = d->executable->text(); + r.commandLineArguments = d->arguments->text(); + r.workingDirectory = d->workingDirectory->text(); return r; } -QString StartRemoteDialog::workingDirectory() const -{ - return d->workingDirectory->text(); -} - } // namespace Analyzer diff --git a/src/plugins/analyzerbase/startremotedialog.h b/src/plugins/analyzerbase/startremotedialog.h index 64826fafabf..f6694d08efc 100644 --- a/src/plugins/analyzerbase/startremotedialog.h +++ b/src/plugins/analyzerbase/startremotedialog.h @@ -32,12 +32,12 @@ namespace QSsh { class SshConnectionParameters; } +namespace ProjectExplorer { class StandardRunnable; } + namespace Analyzer { namespace Internal { class StartRemoteDialogPrivate; } -class AnalyzerRunnable; - class ANALYZER_EXPORT StartRemoteDialog : public QDialog { Q_OBJECT @@ -47,8 +47,7 @@ public: ~StartRemoteDialog(); QSsh::SshConnectionParameters sshParams() const; - AnalyzerRunnable runnable() const; - QString workingDirectory() const; + ProjectExplorer::StandardRunnable runnable() const; private slots: void validate(); diff --git a/src/plugins/ios/iosrunfactories.cpp b/src/plugins/ios/iosrunfactories.cpp index 2178e57a3e0..5d16aa3fe5e 100644 --- a/src/plugins/ios/iosrunfactories.cpp +++ b/src/plugins/ios/iosrunfactories.cpp @@ -194,9 +194,9 @@ RunControl *IosRunControlFactory::create(RunConfiguration *runConfig, if (device.isNull()) return 0; auto iosRunConfig = qobject_cast(runConfig); - AnalyzerRunnable runnable; - runnable.debuggee = iosRunConfig->localExecutable().toUserOutput(); - runnable.debuggeeArgs = iosRunConfig->commandLineArguments(); + StandardRunnable runnable; + runnable.executable = iosRunConfig->localExecutable().toUserOutput(); + runnable.commandLineArguments = iosRunConfig->commandLineArguments(); AnalyzerConnection connection; connection.analyzerHost = QLatin1String("localhost"); runControl->setRunnable(runnable); diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp index 0929664d932..cf9754099f7 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp @@ -73,10 +73,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat { QTC_ASSERT(canRun(runConfiguration, mode), return 0); QTC_ASSERT(runConfiguration->runnable().is(), return 0); - auto &rcRunnable = runConfiguration->runnable().as(); - AnalyzerRunnable runnable; - runnable.debuggee = rcRunnable.executable; - runnable.debuggeeArgs = rcRunnable.commandLineArguments; + auto runnable = runConfiguration->runnable().as(); Kit *kit = runConfiguration->target()->kit(); AnalyzerConnection connection; @@ -104,8 +101,8 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat runControl->setConnection(connection); LocalQmlProfilerRunner::Configuration conf; - conf.executable = runnable.debuggee; - conf.executableArguments = runnable.debuggeeArgs; + conf.executable = runnable.executable; + conf.executableArguments = runnable.commandLineArguments; conf.workingDirectory = runControl->workingDirectory(); conf.socket = connection.analyzerSocket; if (EnvironmentAspect *environment = runConfiguration->extraAspect()) diff --git a/src/plugins/qnx/qnxanalyzesupport.cpp b/src/plugins/qnx/qnxanalyzesupport.cpp index 799d8af89bc..7a881bd3646 100644 --- a/src/plugins/qnx/qnxanalyzesupport.cpp +++ b/src/plugins/qnx/qnxanalyzesupport.cpp @@ -103,7 +103,7 @@ void QnxAnalyzeSupport::startExecution() setState(StartingRemoteProcess); const QStringList args = QStringList() - << QtcProcess::splitArgs(m_runControl->runnable().debuggeeArgs) + << QtcProcess::splitArgs(m_runControl->runnable().commandLineArguments) << QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, m_qmlPort); appRunner()->setEnvironment(m_runnable.environment); diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp index 0f25dde50f4..238043118bc 100644 --- a/src/plugins/qnx/qnxruncontrolfactory.cpp +++ b/src/plugins/qnx/qnxruncontrolfactory.cpp @@ -145,10 +145,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id m return 0; AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(runConfig, mode); QTC_ASSERT(runControl, return 0); - AnalyzerRunnable runnable; - runnable.debuggee = rc->remoteExecutableFilePath(); - runnable.debuggeeArgs = rc->arguments(); - runControl->setRunnable(runnable); + runControl->setRunnable(runConfig->runnable()); AnalyzerConnection connection; connection.connParams = device->sshParameters(); connection.analyzerHost = connection.connParams.host; diff --git a/src/plugins/valgrind/memcheckengine.cpp b/src/plugins/valgrind/memcheckengine.cpp index a8f382cc329..ae73f64ec27 100644 --- a/src/plugins/valgrind/memcheckengine.cpp +++ b/src/plugins/valgrind/memcheckengine.cpp @@ -151,7 +151,7 @@ void MemcheckWithGdbRunControl::startDebugger() const qint64 valgrindPid = runner()->valgrindProcess()->pid(); Debugger::DebuggerStartParameters sp; - sp.executable = runnable().debuggee; + sp.executable = runnable().executable; sp.startMode = Debugger::AttachToRemoteServer; sp.displayName = QString::fromLatin1("VGdb %1").arg(valgrindPid); sp.remoteChannel = QString::fromLatin1("| vgdb --pid=%1").arg(valgrindPid); diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index aa018d05668..5d23824a9f6 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -83,10 +83,9 @@ bool ValgrindRunControl::startEngine() emit outputReceived(tr("Command line arguments: %1").arg(runnable().debuggeeArgs), DebugFormat); #endif - StandardRunnable debuggee; + StandardRunnable debuggee = runnable(); + // FIXME: Consolidate: debuggee.workingDirectory = workingDirectory(); - debuggee.executable = runnable().debuggee; - debuggee.commandLineArguments = runnable().debuggeeArgs; debuggee.environment = m_environment; debuggee.runMode = m_localRunMode; @@ -119,7 +118,7 @@ void ValgrindRunControl::stopEngine() QString ValgrindRunControl::executable() const { - return runnable().debuggee; + return runnable().executable; } void ValgrindRunControl::setEnvironment(const Utils::Environment &environment) diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp index 209dd74df7a..bdf5a2b557f 100644 --- a/src/plugins/valgrind/valgrindplugin.cpp +++ b/src/plugins/valgrind/valgrindplugin.cpp @@ -193,12 +193,13 @@ void ValgrindPlugin::extensionsInitialized() return; ValgrindRunControl *rc = mcTool->createRunControl(runConfig, MEMCHECK_RUN_MODE); QTC_ASSERT(rc, return); - rc->setRunnable(dlg.runnable()); + const auto runnable = dlg.runnable(); + rc->setRunnable(runnable); AnalyzerConnection connection; connection.connParams = dlg.sshParams(); rc->setConnection(connection); - rc->setDisplayName(dlg.runnable().debuggee); - rc->setWorkingDirectory(dlg.workingDirectory()); + rc->setDisplayName(runnable.executable); + rc->setWorkingDirectory(runnable.workingDirectory); rc->setCustomStart(); ProjectExplorerPlugin::startRunControl(rc, MEMCHECK_RUN_MODE); }); @@ -217,12 +218,13 @@ void ValgrindPlugin::extensionsInitialized() return; ValgrindRunControl *rc = cgTool->createRunControl(runConfig); QTC_ASSERT(rc, return); - rc->setRunnable(dlg.runnable()); + const auto runnable = dlg.runnable(); + rc->setRunnable(runnable); AnalyzerConnection connection; connection.connParams = dlg.sshParams(); rc->setConnection(connection); - rc->setDisplayName(dlg.runnable().debuggee); - rc->setWorkingDirectory(dlg.workingDirectory()); + rc->setDisplayName(runnable.executable); + rc->setWorkingDirectory(runnable.workingDirectory); rc->setCustomStart(); ProjectExplorerPlugin::startRunControl(rc, CALLGRIND_RUN_MODE); }); diff --git a/src/plugins/valgrind/valgrindruncontrolfactory.cpp b/src/plugins/valgrind/valgrindruncontrolfactory.cpp index 6ef062081fa..c2cfc57ae38 100644 --- a/src/plugins/valgrind/valgrindruncontrolfactory.cpp +++ b/src/plugins/valgrind/valgrindruncontrolfactory.cpp @@ -76,7 +76,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration ApplicationLauncher::Mode localRunMode = ApplicationLauncher::Gui; IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit()); Utils::Environment environment; - AnalyzerRunnable runnable; + StandardRunnable runnable; AnalyzerConnection connection; QString workingDirectory; Runnable rcRunnable = runConfiguration->runnable(); @@ -85,8 +85,8 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { environment = stdRunnable.environment; workingDirectory = stdRunnable.workingDirectory; - runnable.debuggee = stdRunnable.executable; - runnable.debuggeeArgs = stdRunnable.commandLineArguments; + runnable.executable = stdRunnable.executable; + runnable.commandLineArguments = stdRunnable.commandLineArguments; QTcpServer server; if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) { qWarning() << "Cannot open port on host for profiling."; @@ -96,8 +96,8 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration connection.connParams.port = server.serverPort(); localRunMode = stdRunnable.runMode; } else { - runnable.debuggee = stdRunnable.executable; - runnable.debuggeeArgs = stdRunnable.commandLineArguments; + runnable.executable = stdRunnable.executable; + runnable.commandLineArguments = stdRunnable.commandLineArguments; connection.connParams = device->sshParameters(); }