Skip to content
Snippets Groups Projects
Commit 69de1da7 authored by hjk's avatar hjk
Browse files

RemoteLinux: Use base RunConfiguration if possible


Change-Id: I500faf9846f610f224808a4664d43d50cc5ad870
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent c92adf5a
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ public:
using namespace Internal;
AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig,
AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const RunConfiguration *runConfig,
RunMode runMode)
{
AnalyzerStartParameters params;
......@@ -98,6 +98,8 @@ RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfi
SLOT(handleRemoteSetupRequested()));
connect(&d->outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
this, &RemoteLinuxAnalyzeSupport::remoteIsRunning);
connect(engine, &RunControl::finished,
this, &RemoteLinuxAnalyzeSupport::handleProfilingFinished);
}
RemoteLinuxAnalyzeSupport::~RemoteLinuxAnalyzeSupport()
......
......@@ -34,6 +34,8 @@
#include "abstractremotelinuxrunsupport.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runconfiguration.h>
#include <utils/outputformat.h>
namespace Analyzer {
......@@ -50,7 +52,7 @@ class REMOTELINUX_EXPORT RemoteLinuxAnalyzeSupport : public AbstractRemoteLinuxR
{
Q_OBJECT
public:
static Analyzer::AnalyzerStartParameters startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig,
static Analyzer::AnalyzerStartParameters startParameters(const ProjectExplorer::RunConfiguration *runConfig,
ProjectExplorer::RunMode runMode);
RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
......
......@@ -81,18 +81,18 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
{
QTC_ASSERT(canRun(runConfig, mode), return 0);
auto * const rc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig);
QTC_ASSERT(rc, return 0);
switch (mode) {
case NormalRunMode:
return new RemoteLinuxRunControl(rc);
return new RemoteLinuxRunControl(runConfig);
case DebugRunMode:
case DebugRunModeWithBreakOnMain: {
IDevice::ConstPtr dev = DeviceKitInformation::device(rc->target()->kit());
IDevice::ConstPtr dev = DeviceKitInformation::device(runConfig->target()->kit());
if (!dev) {
*errorMessage = tr("Cannot debug: Kit has no device.");
return 0;
}
auto * const rc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig);
QTC_ASSERT(rc, return 0);
if (rc->portsUsedByDebuggers() > dev->freePorts().count()) {
*errorMessage = tr("Cannot debug: Not enough free ports available.");
return 0;
......@@ -106,7 +106,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
if (mode == DebugRunModeWithBreakOnMain)
params.breakOnMain = true;
params.runConfiguration = rc;
params.runConfiguration = runConfig;
DebuggerRunControl * const runControl
= DebuggerRunControlFactory::doCreate(params, errorMessage);
if (!runControl)
......@@ -117,11 +117,11 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
return runControl;
}
case QmlProfilerRunMode: {
AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(rc, mode);
AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(runConfig, mode);
auto * const rc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig);
QTC_ASSERT(rc, return 0);
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig);
RemoteLinuxAnalyzeSupport * const analyzeSupport =
new RemoteLinuxAnalyzeSupport(rc, runControl, mode);
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
(void) new RemoteLinuxAnalyzeSupport(rc, runControl, mode);
return runControl;
}
case PerfProfilerRunMode:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment