aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2016-01-26 15:53:26 +0100
committerhjk <hjk@theqtcompany.com>2016-01-27 11:20:12 +0000
commit7be3eb85e1ab84f47bfea61f96e185731be6244f (patch)
treee6d84af03cb82e2d66a37ff1b8379711790eaf52 /src/plugins/remotelinux/remotelinuxdebugsupport.cpp
parentbfa292cdc95c3d3a295b4f1c3704f7ca4aeca660 (diff)
RemoteLinux/Qnx: Use StandardRunnable
Change-Id: I73331985eb68065b5fb123ff4491888d824de766 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxdebugsupport.cpp')
-rw-r--r--src/plugins/remotelinux/remotelinuxdebugsupport.cpp58
1 files changed, 15 insertions, 43 deletions
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index d8fed3ab75..02c7c101ac 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -33,20 +33,23 @@
#include <debugger/debuggerkitinformation.h>
#include <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
#include <projectexplorer/project.h>
+#include <projectexplorer/runnables.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
-#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
-
-#include <utils/qtcassert.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
+#include <utils/qtcassert.h>
+#include <utils/qtcprocess.h>
+
#include <QPointer>
using namespace QSsh;
using namespace Debugger;
using namespace ProjectExplorer;
+using namespace Utils;
namespace RemoteLinux {
namespace Internal {
@@ -54,8 +57,7 @@ namespace Internal {
class LinuxDeviceDebugSupportPrivate
{
public:
- LinuxDeviceDebugSupportPrivate(const AbstractRemoteLinuxRunConfiguration *runConfig,
- DebuggerRunControl *runControl)
+ LinuxDeviceDebugSupportPrivate(const RunConfiguration *runConfig, DebuggerRunControl *runControl)
: runControl(runControl),
qmlDebugging(runConfig->extraAspect<DebuggerRunConfigurationAspect>()->useQmlDebugger()),
cppDebugging(runConfig->extraAspect<DebuggerRunConfigurationAspect>()->useCppDebugger()),
@@ -75,45 +77,15 @@ public:
using namespace Internal;
-DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig)
-{
- DebuggerStartParameters params;
- Target *target = runConfig->target();
- Kit *k = target->kit();
- const IDevice::ConstPtr device = DeviceKitInformation::device(k);
- QTC_ASSERT(device, return params);
-
- params.startMode = AttachToRemoteServer;
- params.closeMode = KillAndExitMonitorAtClose;
- params.remoteSetupNeeded = true;
-
- auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
- if (aspect->useQmlDebugger()) {
- params.qmlServerAddress = device->sshParameters().host;
- params.qmlServerPort = 0; // port is selected later on
- }
- if (aspect->useCppDebugger()) {
- aspect->setUseMultiProcess(true);
- params.processArgs = runConfig->arguments();
- if (aspect->useQmlDebugger()) {
- params.processArgs.prepend(QLatin1Char(' '));
- params.processArgs.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
- }
- params.executable = runConfig->localExecutableFilePath();
- params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
- params.remoteExecutable = runConfig->remoteExecutableFilePath();
- }
-
- return params;
-}
-
-LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
+LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunConfiguration *runConfig,
DebuggerRunControl *runControl)
: AbstractRemoteLinuxRunSupport(runConfig, runControl),
- d(new LinuxDeviceDebugSupportPrivate(static_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig), runControl))
+ d(new LinuxDeviceDebugSupportPrivate(runConfig, runControl))
{
connect(runControl, &DebuggerRunControl::requestRemoteSetup,
this, &LinuxDeviceDebugSupport::handleRemoteSetupRequested);
+ connect(runControl, &RunControl::finished,
+ this, &LinuxDeviceDebugSupport::handleDebuggingFinished);
}
LinuxDeviceDebugSupport::~LinuxDeviceDebugSupport()
@@ -156,14 +128,14 @@ void LinuxDeviceDebugSupport::startExecution()
connect(runner, &DeviceApplicationRunner::remoteProcessStarted,
this, &LinuxDeviceDebugSupport::handleRemoteProcessStarted);
- QStringList args = arguments();
+ QStringList args = QtcProcess::splitArgs(runnable().commandLineArguments, OsTypeLinux);
QString command;
if (d->qmlDebugging)
args.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, d->qmlPort));
if (d->qmlDebugging && !d->cppDebugging) {
- command = remoteFilePath();
+ command = runnable().executable;
} else {
command = device()->debugServerPath();
if (command.isEmpty())
@@ -179,8 +151,8 @@ void LinuxDeviceDebugSupport::startExecution()
this, &LinuxDeviceDebugSupport::handleProgressReport);
connect(runner, &DeviceApplicationRunner::reportError,
this, &LinuxDeviceDebugSupport::handleAppRunnerError);
- runner->setEnvironment(environment());
- runner->setWorkingDirectory(workingDirectory());
+ runner->setEnvironment(runnable().environment);
+ runner->setWorkingDirectory(runnable().workingDirectory);
runner->start(device(), command, args);
}