forked from qt-creator/qt-creator
Qnx: Adapt QnxRunControlFactory to Analyzer changes
Change-Id: I89be35facbcbc38a45a947d8af9c0841eda025d4 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -30,7 +30,6 @@
|
|||||||
#include "slog2inforunner.h"
|
#include "slog2inforunner.h"
|
||||||
|
|
||||||
#include <analyzerbase/analyzerruncontrol.h>
|
#include <analyzerbase/analyzerruncontrol.h>
|
||||||
#include <analyzerbase/analyzerstartparameters.h>
|
|
||||||
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
|
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|||||||
@@ -87,25 +87,6 @@ static DebuggerStartParameters createDebuggerStartParameters(QnxRunConfiguration
|
|||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig)
|
|
||||||
{
|
|
||||||
AnalyzerStartParameters params;
|
|
||||||
Target *target = runConfig->target();
|
|
||||||
Kit *k = target->kit();
|
|
||||||
|
|
||||||
const IDevice::ConstPtr device = DeviceKitInformation::device(k);
|
|
||||||
if (device.isNull())
|
|
||||||
return params;
|
|
||||||
|
|
||||||
params.debuggee = runConfig->remoteExecutableFilePath();
|
|
||||||
params.debuggeeArgs = runConfig->arguments();
|
|
||||||
params.connParams = DeviceKitInformation::device(runConfig->target()->kit())->sshParameters();
|
|
||||||
params.analyzerHost = params.connParams.host;
|
|
||||||
params.analyzerPort = params.connParams.port;
|
|
||||||
|
|
||||||
return params;
|
|
||||||
}
|
|
||||||
|
|
||||||
QnxRunControlFactory::QnxRunControlFactory(QObject *parent)
|
QnxRunControlFactory::QnxRunControlFactory(QObject *parent)
|
||||||
: IRunControlFactory(parent)
|
: IRunControlFactory(parent)
|
||||||
{
|
{
|
||||||
@@ -138,29 +119,40 @@ bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id m
|
|||||||
|
|
||||||
RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id mode, QString *errorMessage)
|
RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_ASSERT(canRun(runConfig, mode));
|
QTC_ASSERT(canRun(runConfig, mode), return 0);
|
||||||
|
auto rc = qobject_cast<QnxRunConfiguration *>(runConfig);
|
||||||
|
QTC_ASSERT(rc, return 0);
|
||||||
|
|
||||||
QnxRunConfiguration *rc = qobject_cast<QnxRunConfiguration *>(runConfig);
|
|
||||||
Q_ASSERT(rc);
|
|
||||||
if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE)
|
if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE)
|
||||||
return new QnxRunControl(rc);
|
return new QnxRunControl(rc);
|
||||||
|
|
||||||
if (mode == ProjectExplorer::Constants::DEBUG_RUN_MODE) {
|
if (mode == ProjectExplorer::Constants::DEBUG_RUN_MODE) {
|
||||||
const DebuggerStartParameters params = createDebuggerStartParameters(rc);
|
const DebuggerStartParameters params = createDebuggerStartParameters(rc);
|
||||||
DebuggerRunControl *runControl = createDebuggerRunControl(params, runConfig, errorMessage);
|
DebuggerRunControl *runControl = createDebuggerRunControl(params, runConfig, errorMessage);
|
||||||
if (!runControl)
|
QTC_ASSERT(runControl, return 0);
|
||||||
return 0;
|
auto debugSupport = new QnxDebugSupport(rc, runControl);
|
||||||
|
connect(runControl, &RunControl::finished, debugSupport, &QnxDebugSupport::handleDebuggingFinished);
|
||||||
QnxDebugSupport *debugSupport = new QnxDebugSupport(rc, runControl);
|
|
||||||
connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished()));
|
|
||||||
|
|
||||||
return runControl;
|
return runControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
||||||
const AnalyzerStartParameters params = createAnalyzerStartParameters(rc);
|
Kit *kit = runConfig->target()->kit();
|
||||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode);
|
const IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||||
QnxAnalyzeSupport * const analyzeSupport = new QnxAnalyzeSupport(rc, runControl);
|
if (device.isNull())
|
||||||
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
|
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);
|
||||||
|
AnalyzerConnection connection;
|
||||||
|
connection.connParams = device->sshParameters();
|
||||||
|
connection.analyzerHost = connection.connParams.host;
|
||||||
|
connection.analyzerPort = connection.connParams.port;
|
||||||
|
runControl->setConnection(connection);
|
||||||
|
auto analyzeSupport = new QnxAnalyzeSupport(rc, runControl);
|
||||||
|
connect(runControl, &RunControl::finished, analyzeSupport, &QnxAnalyzeSupport::handleProfilingFinished);
|
||||||
return runControl;
|
return runControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user