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 "qnxconstants.h"
|
||||
#include "qnxtr.h"
|
||||
#include "slog2inforunner.h"
|
||||
|
||||
@@ -18,11 +19,14 @@ using namespace Utils;
|
||||
|
||||
namespace Qnx::Internal {
|
||||
|
||||
QnxQmlProfilerSupport::QnxQmlProfilerSupport(RunControl *runControl)
|
||||
: SimpleTargetRunner(runControl)
|
||||
class QnxQmlProfilerSupport final : public SimpleTargetRunner
|
||||
{
|
||||
public:
|
||||
explicit QnxQmlProfilerSupport(RunControl *runControl)
|
||||
: SimpleTargetRunner(runControl)
|
||||
{
|
||||
setId("QnxQmlProfilerSupport");
|
||||
appendMessage(Tr::tr("Preparing remote side..."), Utils::LogMessageFormat);
|
||||
appendMessage(Tr::tr("Preparing remote side..."), LogMessageFormat);
|
||||
|
||||
auto portsGatherer = new PortsGatherer(runControl);
|
||||
addStartDependency(portsGatherer);
|
||||
@@ -42,6 +46,14 @@ QnxQmlProfilerSupport::QnxQmlProfilerSupport(RunControl *runControl)
|
||||
cmd.addArg(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, serverUrl));
|
||||
setCommandLine(cmd);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
QnxQmlProfilerWorkerFactory::QnxQmlProfilerWorkerFactory()
|
||||
{
|
||||
setProduct<QnxQmlProfilerSupport>();
|
||||
// FIXME: Shouldn't this use the run mode id somehow?
|
||||
addSupportedRunConfig(Constants::QNX_RUNCONFIG_ID);
|
||||
}
|
||||
|
||||
} // Qnx::Internal
|
||||
|
@@ -7,10 +7,10 @@
|
||||
|
||||
namespace Qnx::Internal {
|
||||
|
||||
class QnxQmlProfilerSupport : public ProjectExplorer::SimpleTargetRunner
|
||||
class QnxQmlProfilerWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
||||
{
|
||||
public:
|
||||
explicit QnxQmlProfilerSupport(ProjectExplorer::RunControl *runControl);
|
||||
QnxQmlProfilerWorkerFactory();
|
||||
};
|
||||
|
||||
} // Qnx::Internal
|
||||
|
@@ -5,18 +5,13 @@
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace Qnx {
|
||||
namespace Constants {
|
||||
namespace Qnx::Constants {
|
||||
|
||||
const char QNX_QNX_QT[] = "Qt4ProjectManager.QtVersion.QNX.QNX";
|
||||
|
||||
const char QNX_QNX_FEATURE[] = "QtSupport.Wizards.FeatureQNX";
|
||||
|
||||
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_TOOLCHAIN_ID[] = "Qnx.QccToolChain";
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace Qnx
|
||||
} // Qnx::Constants
|
||||
|
@@ -102,9 +102,12 @@ public:
|
||||
|
||||
// QnxDebugSupport
|
||||
|
||||
QnxDebugSupport::QnxDebugSupport(RunControl *runControl)
|
||||
: DebuggerRunTool(runControl)
|
||||
class QnxDebugSupport : public Debugger::DebuggerRunTool
|
||||
{
|
||||
public:
|
||||
explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl)
|
||||
: DebuggerRunTool(runControl)
|
||||
{
|
||||
setId("QnxDebugSupport");
|
||||
appendMessage(Tr::tr("Preparing remote side..."), LogMessageFormat);
|
||||
|
||||
@@ -128,7 +131,8 @@ QnxDebugSupport::QnxDebugSupport(RunControl *runControl)
|
||||
setSysRoot(qtVersion->qnxTarget());
|
||||
modifyDebuggerEnvironment(qtVersion->environment());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// QnxAttachDebugDialog
|
||||
@@ -183,9 +187,12 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
QnxAttachDebugSupport::QnxAttachDebugSupport(RunControl *runControl)
|
||||
: DebuggerRunTool(runControl)
|
||||
class QnxAttachDebugSupport : public Debugger::DebuggerRunTool
|
||||
{
|
||||
public:
|
||||
explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl)
|
||||
: DebuggerRunTool(runControl)
|
||||
{
|
||||
setId("QnxAttachDebugSupport");
|
||||
|
||||
setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
|
||||
@@ -194,9 +201,10 @@ QnxAttachDebugSupport::QnxAttachDebugSupport(RunControl *runControl)
|
||||
auto pdebugRunner = new PDebugRunner(runControl, portsGatherer());
|
||||
addStartDependency(pdebugRunner);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void QnxAttachDebugSupport::showProcessesDialog()
|
||||
void showAttachToProcessDialog()
|
||||
{
|
||||
auto kitChooser = new KitChooser;
|
||||
kitChooser->setKitPredicate([](const Kit *k) {
|
||||
@@ -242,4 +250,13 @@ void QnxAttachDebugSupport::showProcessesDialog()
|
||||
ProjectExplorerPlugin::startRunControl(runControl);
|
||||
}
|
||||
|
||||
// QnxDebugWorkerFactory
|
||||
|
||||
QnxDebugWorkerFactory::QnxDebugWorkerFactory()
|
||||
{
|
||||
setProduct<QnxDebugSupport>();
|
||||
addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
||||
addSupportedRunConfig(Constants::QNX_RUNCONFIG_ID);
|
||||
}
|
||||
|
||||
} // Qnx::Internal
|
||||
|
@@ -7,18 +7,12 @@
|
||||
|
||||
namespace Qnx::Internal {
|
||||
|
||||
class QnxDebugSupport : public Debugger::DebuggerRunTool
|
||||
void showAttachToProcessDialog();
|
||||
|
||||
class QnxDebugWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
||||
{
|
||||
public:
|
||||
explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl);
|
||||
};
|
||||
|
||||
class QnxAttachDebugSupport : public Debugger::DebuggerRunTool
|
||||
{
|
||||
public:
|
||||
explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl);
|
||||
|
||||
static void showProcessesDialog();
|
||||
QnxDebugWorkerFactory();
|
||||
};
|
||||
|
||||
} // Qnx::Internal
|
||||
|
@@ -103,17 +103,8 @@ public:
|
||||
QnxSettingsPage settingsPage;
|
||||
QnxToolChainFactory toolChainFactory;
|
||||
SimpleTargetRunnerFactory runWorkerFactory{{runConfigFactory.runConfigurationId()}};
|
||||
|
||||
RunWorkerFactory debugWorkerFactory{
|
||||
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()}
|
||||
};
|
||||
QnxDebugWorkerFactory debugWorkerFactory;
|
||||
QnxQmlProfilerWorkerFactory qmlProfilerWorkerFactory;
|
||||
};
|
||||
|
||||
static QnxPluginPrivate *dd = nullptr;
|
||||
@@ -136,8 +127,7 @@ bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||
void QnxPlugin::extensionsInitialized()
|
||||
{
|
||||
// Attach support
|
||||
connect(&dd->m_attachToQnxApplication, &QAction::triggered,
|
||||
this, [] { QnxAttachDebugSupport::showProcessesDialog(); });
|
||||
connect(&dd->m_attachToQnxApplication, &QAction::triggered, this, &showAttachToProcessDialog);
|
||||
|
||||
const char QNX_DEBUGGING_GROUP[] = "Debugger.Group.Qnx";
|
||||
|
||||
|
@@ -80,7 +80,7 @@ QnxRunConfiguration::QnxRunConfiguration(Target *target, Id id)
|
||||
|
||||
QnxRunConfigurationFactory::QnxRunConfigurationFactory()
|
||||
{
|
||||
registerRunConfiguration<QnxRunConfiguration>("Qt4ProjectManager.QNX.QNXRunConfiguration.");
|
||||
registerRunConfiguration<QnxRunConfiguration>(Constants::QNX_RUNCONFIG_ID);
|
||||
addSupportedTargetDeviceType(Constants::QNX_QNX_OS_TYPE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user