aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-08-24 15:46:23 +0200
committerhjk <hjk@qt.io>2017-08-24 15:21:27 +0000
commitce62181cb8df3c7b9940b6148f16370ec3562985 (patch)
tree864f1bb0bcabc5a3cd9ebe14cc4f274a49e680dc /src/plugins/remotelinux/remotelinuxdebugsupport.cpp
parentb725018e9e32ead4c2491b4fb13a472b6e79360c (diff)
Debugger: Add a few convience setters for some run parameters
The idea is to use them later to make the DebugRunTool setup leaner. As proof of concept, use the new interface in LinuxDeviceDebugSupport. Change-Id: I045ba4d05cfc56a9e875fd4461e9f562153872dd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxdebugsupport.cpp')
-rw-r--r--src/plugins/remotelinux/remotelinuxdebugsupport.cpp61
1 files changed, 9 insertions, 52 deletions
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index 474ad90702..5db52e7d11 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -28,22 +28,8 @@
#include "remotelinuxcustomrunconfiguration.h"
#include "remotelinuxrunconfiguration.h"
-#include <debugger/debuggerruncontrol.h>
-
-#include <projectexplorer/buildconfiguration.h>
-#include <projectexplorer/project.h>
-#include <projectexplorer/runnables.h>
-#include <projectexplorer/target.h>
-#include <projectexplorer/toolchain.h>
-
-#include <qmldebug/qmldebugcommandlinearguments.h>
-
-#include <utils/qtcassert.h>
-#include <utils/qtcprocess.h>
-
using namespace Debugger;
using namespace ProjectExplorer;
-using namespace Utils;
namespace RemoteLinux {
@@ -61,51 +47,22 @@ LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunControl *runControl)
addStartDependency(gdbServer);
+ setStartMode(AttachToRemoteServer);
+ setCloseMode(KillAndExitMonitorAtClose);
+ setUseExtendedRemote(true);
+
RunConfiguration *runConfig = runControl->runConfiguration();
if (auto rlrc = qobject_cast<RemoteLinuxRunConfiguration *>(runConfig))
- m_symbolFile = rlrc->localExecutableFilePath();
+ setSymbolFile(rlrc->localExecutableFilePath());
else if (auto rlrc = qobject_cast<Internal::RemoteLinuxCustomRunConfiguration *>(runConfig))
- m_symbolFile = rlrc->localExecutableFilePath();
+ setSymbolFile(rlrc->localExecutableFilePath());
}
void LinuxDeviceDebugSupport::start()
{
- if (m_symbolFile.isEmpty()) {
- reportFailure(tr("Cannot debug: Local executable is not set."));
- return;
- }
-
- const QString host = device()->sshParameters().host;
- const Port gdbServerPort = m_portsGatherer->gdbServerPort();
- const int qmlServerPort = m_portsGatherer->qmlServerPort().number();
-
- DebuggerStartParameters params;
- params.startMode = AttachToRemoteServer;
- params.closeMode = KillAndExitMonitorAtClose;
-
- if (isQmlDebugging()) {
- params.qmlServer.setHost(host);
- params.qmlServer.setPort(qmlServerPort);
- params.inferior.commandLineArguments.replace("%qml_port%", QString::number(qmlServerPort));
- }
- if (isCppDebugging()) {
- Runnable r = runnable();
- QTC_ASSERT(r.is<StandardRunnable>(), return);
- auto stdRunnable = r.as<StandardRunnable>();
- params.useExtendedRemote = true;
- params.inferior.executable = stdRunnable.executable;
- params.inferior.commandLineArguments = stdRunnable.commandLineArguments;
- if (isQmlDebugging()) {
- params.inferior.commandLineArguments.prepend(' ');
- params.inferior.commandLineArguments.prepend(
- QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
- }
-
- params.remoteChannel = QString("%1:%2").arg(host).arg(gdbServerPort.number());
- params.symbolFile = m_symbolFile;
- }
-
- setStartParameters(params);
+ setGdbServerChannel(m_portsGatherer->gdbServerChannel());
+ setQmlServer(m_portsGatherer->qmlServer());
+ addQmlServerInferiorCommandLineArgumentIfNeeded();
DebuggerRunTool::start();
}