Debugger/QNX: Use the new DebuggerTool portsgatherer

Change-Id: Id40f79d79079ee0745dc07ca7e46fdaef44f02a7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2017-10-19 08:16:01 +02:00
parent 9d3607c669
commit d91a004b24
2 changed files with 8 additions and 41 deletions

View File

@@ -136,22 +136,17 @@ QnxDebugSupport::QnxDebugSupport(RunControl *runControl)
setDisplayName("QnxDebugSupport"); setDisplayName("QnxDebugSupport");
appendMessage(tr("Preparing remote side..."), LogMessageFormat); appendMessage(tr("Preparing remote side..."), LogMessageFormat);
m_portsGatherer = new GdbServerPortsGatherer(runControl); setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
m_portsGatherer->setUseGdbServer(isCppDebugging());
m_portsGatherer->setUseQmlServer(isQmlDebugging());
auto debuggeeRunner = new QnxDebuggeeRunner(runControl, m_portsGatherer); auto debuggeeRunner = new QnxDebuggeeRunner(runControl, portsGatherer());
debuggeeRunner->addStartDependency(m_portsGatherer); debuggeeRunner->addStartDependency(portsGatherer());
auto slog2InfoRunner = new Slog2InfoRunner(runControl); auto slog2InfoRunner = new Slog2InfoRunner(runControl);
debuggeeRunner->addStartDependency(slog2InfoRunner); debuggeeRunner->addStartDependency(slog2InfoRunner);
addStartDependency(debuggeeRunner); addStartDependency(debuggeeRunner);
}
void QnxDebugSupport::start() auto runConfig = qobject_cast<QnxRunConfiguration *>(runControl->runConfiguration());
{
auto runConfig = qobject_cast<QnxRunConfiguration *>(runControl()->runConfiguration());
QTC_ASSERT(runConfig, return); QTC_ASSERT(runConfig, return);
Target *target = runConfig->target(); Target *target = runConfig->target();
Kit *k = target->kit(); Kit *k = target->kit();
@@ -159,14 +154,10 @@ void QnxDebugSupport::start()
setStartMode(AttachToRemoteServer); setStartMode(AttachToRemoteServer);
setCloseMode(KillAtClose); setCloseMode(KillAtClose);
setUseCtrlCStub(true); setUseCtrlCStub(true);
setRemoteChannel(m_portsGatherer->gdbServerChannel());
setQmlServer(m_portsGatherer->qmlServer());
setSolibSearchPath(searchPaths(k)); setSolibSearchPath(searchPaths(k));
if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(k))) if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(k)))
setSysRoot(qtVersion->qnxTarget()); setSysRoot(qtVersion->qnxTarget());
setSymbolFile(runConfig->localExecutableFilePath()); setSymbolFile(runConfig->localExecutableFilePath());
DebuggerRunTool::start();
} }
@@ -213,6 +204,7 @@ public:
: SimpleTargetRunner(runControl), m_portsGatherer(portsGatherer) : SimpleTargetRunner(runControl), m_portsGatherer(portsGatherer)
{ {
setDisplayName("PDebugRunner"); setDisplayName("PDebugRunner");
addStartDependency(m_portsGatherer);
} }
private: private:
@@ -236,28 +228,14 @@ QnxAttachDebugSupport::QnxAttachDebugSupport(RunControl *runControl)
{ {
setDisplayName("QnxAttachDebugSupport"); setDisplayName("QnxAttachDebugSupport");
m_portsGatherer = new GdbServerPortsGatherer(runControl); setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
m_portsGatherer->setUseGdbServer(isCppDebugging());
m_portsGatherer->setUseQmlServer(isQmlDebugging());
if (isCppDebugging()) { if (isCppDebugging()) {
m_pdebugRunner = new PDebugRunner(runControl, m_portsGatherer); auto pdebugRunner = new PDebugRunner(runControl, portsGatherer());
m_pdebugRunner->addStartDependency(m_portsGatherer); addStartDependency(pdebugRunner);
addStartDependency(m_pdebugRunner);
} else {
// No pdebug needed for Qml-only debugging.
addStartDependency(m_portsGatherer);
} }
} }
void QnxAttachDebugSupport::start()
{
setRemoteChannel(m_portsGatherer->gdbServerChannel());
setQmlServer(m_portsGatherer->qmlServer());
DebuggerRunTool::start();
}
void QnxAttachDebugSupport::showProcessesDialog() void QnxAttachDebugSupport::showProcessesDialog()
{ {
auto kitChooser = new KitChooser; auto kitChooser = new KitChooser;

View File

@@ -36,11 +36,6 @@ class QnxDebugSupport : public Debugger::DebuggerRunTool
public: public:
explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl); explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl);
private:
void start() override;
Debugger::GdbServerPortsGatherer *m_portsGatherer;
}; };
class QnxAttachDebugSupport : public Debugger::DebuggerRunTool class QnxAttachDebugSupport : public Debugger::DebuggerRunTool
@@ -51,12 +46,6 @@ public:
explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl); explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl);
static void showProcessesDialog(); static void showProcessesDialog();
private:
void start() final;
Debugger::GdbServerPortsGatherer *m_portsGatherer;
ProjectExplorer::SimpleTargetRunner *m_pdebugRunner;
}; };
} // namespace Internal } // namespace Internal