forked from qt-creator/qt-creator
Qnx: use dedicated classes to create run worker
Change-Id: I43178d543509dcb561fffb25741b0e3dd8d95cb1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "qnxanalyzesupport.h"
|
#include "qnxanalyzesupport.h"
|
||||||
|
|
||||||
|
#include "qnxconstants.h"
|
||||||
#include "qnxtr.h"
|
#include "qnxtr.h"
|
||||||
#include "slog2inforunner.h"
|
#include "slog2inforunner.h"
|
||||||
|
|
||||||
@@ -18,30 +19,41 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
QnxQmlProfilerSupport::QnxQmlProfilerSupport(RunControl *runControl)
|
class QnxQmlProfilerSupport final : public SimpleTargetRunner
|
||||||
: SimpleTargetRunner(runControl)
|
|
||||||
{
|
{
|
||||||
setId("QnxQmlProfilerSupport");
|
public:
|
||||||
appendMessage(Tr::tr("Preparing remote side..."), Utils::LogMessageFormat);
|
explicit QnxQmlProfilerSupport(RunControl *runControl)
|
||||||
|
: SimpleTargetRunner(runControl)
|
||||||
|
{
|
||||||
|
setId("QnxQmlProfilerSupport");
|
||||||
|
appendMessage(Tr::tr("Preparing remote side..."), LogMessageFormat);
|
||||||
|
|
||||||
auto portsGatherer = new PortsGatherer(runControl);
|
auto portsGatherer = new PortsGatherer(runControl);
|
||||||
addStartDependency(portsGatherer);
|
addStartDependency(portsGatherer);
|
||||||
|
|
||||||
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
|
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
|
||||||
addStartDependency(slog2InfoRunner);
|
addStartDependency(slog2InfoRunner);
|
||||||
|
|
||||||
auto profiler = runControl->createWorker(ProjectExplorer::Constants::QML_PROFILER_RUNNER);
|
auto profiler = runControl->createWorker(ProjectExplorer::Constants::QML_PROFILER_RUNNER);
|
||||||
profiler->addStartDependency(this);
|
profiler->addStartDependency(this);
|
||||||
addStopDependency(profiler);
|
addStopDependency(profiler);
|
||||||
|
|
||||||
setStartModifier([this, portsGatherer, profiler] {
|
setStartModifier([this, portsGatherer, profiler] {
|
||||||
const QUrl serverUrl = portsGatherer->findEndPoint();
|
const QUrl serverUrl = portsGatherer->findEndPoint();
|
||||||
profiler->recordData("QmlServerUrl", serverUrl);
|
profiler->recordData("QmlServerUrl", serverUrl);
|
||||||
|
|
||||||
CommandLine cmd = commandLine();
|
CommandLine cmd = commandLine();
|
||||||
cmd.addArg(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, serverUrl));
|
cmd.addArg(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, serverUrl));
|
||||||
setCommandLine(cmd);
|
setCommandLine(cmd);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
QnxQmlProfilerWorkerFactory::QnxQmlProfilerWorkerFactory()
|
||||||
|
{
|
||||||
|
setProduct<QnxQmlProfilerSupport>();
|
||||||
|
// FIXME: Shouldn't this use the run mode id somehow?
|
||||||
|
addSupportedRunConfig(Constants::QNX_RUNCONFIG_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
@@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
class QnxQmlProfilerSupport : public ProjectExplorer::SimpleTargetRunner
|
class QnxQmlProfilerWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QnxQmlProfilerSupport(ProjectExplorer::RunControl *runControl);
|
QnxQmlProfilerWorkerFactory();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
@@ -5,18 +5,13 @@
|
|||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
namespace Qnx {
|
namespace Qnx::Constants {
|
||||||
namespace Constants {
|
|
||||||
|
|
||||||
const char QNX_QNX_QT[] = "Qt4ProjectManager.QtVersion.QNX.QNX";
|
const char QNX_QNX_QT[] = "Qt4ProjectManager.QtVersion.QNX.QNX";
|
||||||
|
|
||||||
const char QNX_QNX_FEATURE[] = "QtSupport.Wizards.FeatureQNX";
|
const char QNX_QNX_FEATURE[] = "QtSupport.Wizards.FeatureQNX";
|
||||||
|
|
||||||
const char QNX_QNX_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.QNX.QNXDeployConfiguration";
|
const char QNX_QNX_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.QNX.QNXDeployConfiguration";
|
||||||
|
const char QNX_RUNCONFIG_ID[] = "Qt4ProjectManager.QNX.QNXRunConfiguration.";
|
||||||
const char QNX_QNX_OS_TYPE[] = "QnxOsType"; // Also used for device type.
|
const char QNX_QNX_OS_TYPE[] = "QnxOsType"; // Also used for device type.
|
||||||
|
|
||||||
const char QNX_TOOLCHAIN_ID[] = "Qnx.QccToolChain";
|
const char QNX_TOOLCHAIN_ID[] = "Qnx.QccToolChain";
|
||||||
|
|
||||||
} // namespace Constants
|
} // Qnx::Constants
|
||||||
} // namespace Qnx
|
|
||||||
|
@@ -102,33 +102,37 @@ public:
|
|||||||
|
|
||||||
// QnxDebugSupport
|
// QnxDebugSupport
|
||||||
|
|
||||||
QnxDebugSupport::QnxDebugSupport(RunControl *runControl)
|
class QnxDebugSupport : public Debugger::DebuggerRunTool
|
||||||
: DebuggerRunTool(runControl)
|
|
||||||
{
|
{
|
||||||
setId("QnxDebugSupport");
|
public:
|
||||||
appendMessage(Tr::tr("Preparing remote side..."), LogMessageFormat);
|
explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl)
|
||||||
|
: DebuggerRunTool(runControl)
|
||||||
|
{
|
||||||
|
setId("QnxDebugSupport");
|
||||||
|
appendMessage(Tr::tr("Preparing remote side..."), LogMessageFormat);
|
||||||
|
|
||||||
setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
|
setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
|
||||||
|
|
||||||
auto debuggeeRunner = new QnxDebuggeeRunner(runControl, portsGatherer());
|
auto debuggeeRunner = new QnxDebuggeeRunner(runControl, portsGatherer());
|
||||||
debuggeeRunner->addStartDependency(portsGatherer());
|
debuggeeRunner->addStartDependency(portsGatherer());
|
||||||
|
|
||||||
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
|
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
|
||||||
debuggeeRunner->addStartDependency(slog2InfoRunner);
|
debuggeeRunner->addStartDependency(slog2InfoRunner);
|
||||||
|
|
||||||
addStartDependency(debuggeeRunner);
|
addStartDependency(debuggeeRunner);
|
||||||
|
|
||||||
Kit *k = runControl->kit();
|
Kit *k = runControl->kit();
|
||||||
|
|
||||||
setStartMode(AttachToRemoteServer);
|
setStartMode(AttachToRemoteServer);
|
||||||
setCloseMode(KillAtClose);
|
setCloseMode(KillAtClose);
|
||||||
setUseCtrlCStub(true);
|
setUseCtrlCStub(true);
|
||||||
setSolibSearchPath(FileUtils::toFilePathList(searchPaths(k)));
|
setSolibSearchPath(FileUtils::toFilePathList(searchPaths(k)));
|
||||||
if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitAspect::qtVersion(k))) {
|
if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitAspect::qtVersion(k))) {
|
||||||
setSysRoot(qtVersion->qnxTarget());
|
setSysRoot(qtVersion->qnxTarget());
|
||||||
modifyDebuggerEnvironment(qtVersion->environment());
|
modifyDebuggerEnvironment(qtVersion->environment());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// QnxAttachDebugDialog
|
// QnxAttachDebugDialog
|
||||||
@@ -183,20 +187,24 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
QnxAttachDebugSupport::QnxAttachDebugSupport(RunControl *runControl)
|
class QnxAttachDebugSupport : public Debugger::DebuggerRunTool
|
||||||
: DebuggerRunTool(runControl)
|
|
||||||
{
|
{
|
||||||
setId("QnxAttachDebugSupport");
|
public:
|
||||||
|
explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl)
|
||||||
|
: DebuggerRunTool(runControl)
|
||||||
|
{
|
||||||
|
setId("QnxAttachDebugSupport");
|
||||||
|
|
||||||
setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
|
setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
|
||||||
|
|
||||||
if (isCppDebugging()) {
|
if (isCppDebugging()) {
|
||||||
auto pdebugRunner = new PDebugRunner(runControl, portsGatherer());
|
auto pdebugRunner = new PDebugRunner(runControl, portsGatherer());
|
||||||
addStartDependency(pdebugRunner);
|
addStartDependency(pdebugRunner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
void QnxAttachDebugSupport::showProcessesDialog()
|
void showAttachToProcessDialog()
|
||||||
{
|
{
|
||||||
auto kitChooser = new KitChooser;
|
auto kitChooser = new KitChooser;
|
||||||
kitChooser->setKitPredicate([](const Kit *k) {
|
kitChooser->setKitPredicate([](const Kit *k) {
|
||||||
@@ -242,4 +250,13 @@ void QnxAttachDebugSupport::showProcessesDialog()
|
|||||||
ProjectExplorerPlugin::startRunControl(runControl);
|
ProjectExplorerPlugin::startRunControl(runControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QnxDebugWorkerFactory
|
||||||
|
|
||||||
|
QnxDebugWorkerFactory::QnxDebugWorkerFactory()
|
||||||
|
{
|
||||||
|
setProduct<QnxDebugSupport>();
|
||||||
|
addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
||||||
|
addSupportedRunConfig(Constants::QNX_RUNCONFIG_ID);
|
||||||
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
@@ -7,18 +7,12 @@
|
|||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
class QnxDebugSupport : public Debugger::DebuggerRunTool
|
void showAttachToProcessDialog();
|
||||||
|
|
||||||
|
class QnxDebugWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl);
|
QnxDebugWorkerFactory();
|
||||||
};
|
|
||||||
|
|
||||||
class QnxAttachDebugSupport : public Debugger::DebuggerRunTool
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl);
|
|
||||||
|
|
||||||
static void showProcessesDialog();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
@@ -103,17 +103,8 @@ public:
|
|||||||
QnxSettingsPage settingsPage;
|
QnxSettingsPage settingsPage;
|
||||||
QnxToolChainFactory toolChainFactory;
|
QnxToolChainFactory toolChainFactory;
|
||||||
SimpleTargetRunnerFactory runWorkerFactory{{runConfigFactory.runConfigurationId()}};
|
SimpleTargetRunnerFactory runWorkerFactory{{runConfigFactory.runConfigurationId()}};
|
||||||
|
QnxDebugWorkerFactory debugWorkerFactory;
|
||||||
RunWorkerFactory debugWorkerFactory{
|
QnxQmlProfilerWorkerFactory qmlProfilerWorkerFactory;
|
||||||
RunWorkerFactory::make<QnxDebugSupport>(),
|
|
||||||
{ProjectExplorer::Constants::DEBUG_RUN_MODE},
|
|
||||||
{runConfigFactory.runConfigurationId()}
|
|
||||||
};
|
|
||||||
RunWorkerFactory qmlProfilerWorkerFactory{
|
|
||||||
RunWorkerFactory::make<QnxQmlProfilerSupport>(),
|
|
||||||
{}, // FIXME: Shouldn't this use the run mode id somehow?
|
|
||||||
{runConfigFactory.runConfigurationId()}
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static QnxPluginPrivate *dd = nullptr;
|
static QnxPluginPrivate *dd = nullptr;
|
||||||
@@ -136,8 +127,7 @@ bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString)
|
|||||||
void QnxPlugin::extensionsInitialized()
|
void QnxPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
// Attach support
|
// Attach support
|
||||||
connect(&dd->m_attachToQnxApplication, &QAction::triggered,
|
connect(&dd->m_attachToQnxApplication, &QAction::triggered, this, &showAttachToProcessDialog);
|
||||||
this, [] { QnxAttachDebugSupport::showProcessesDialog(); });
|
|
||||||
|
|
||||||
const char QNX_DEBUGGING_GROUP[] = "Debugger.Group.Qnx";
|
const char QNX_DEBUGGING_GROUP[] = "Debugger.Group.Qnx";
|
||||||
|
|
||||||
|
@@ -80,7 +80,7 @@ QnxRunConfiguration::QnxRunConfiguration(Target *target, Id id)
|
|||||||
|
|
||||||
QnxRunConfigurationFactory::QnxRunConfigurationFactory()
|
QnxRunConfigurationFactory::QnxRunConfigurationFactory()
|
||||||
{
|
{
|
||||||
registerRunConfiguration<QnxRunConfiguration>("Qt4ProjectManager.QNX.QNXRunConfiguration.");
|
registerRunConfiguration<QnxRunConfiguration>(Constants::QNX_RUNCONFIG_ID);
|
||||||
addSupportedTargetDeviceType(Constants::QNX_QNX_OS_TYPE);
|
addSupportedTargetDeviceType(Constants::QNX_QNX_OS_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user