From d91a004b241e2a4eef120f63a199a1fcf110736c Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 19 Oct 2017 08:16:01 +0200 Subject: [PATCH] Debugger/QNX: Use the new DebuggerTool portsgatherer Change-Id: Id40f79d79079ee0745dc07ca7e46fdaef44f02a7 Reviewed-by: Christian Kandeler --- src/plugins/qnx/qnxdebugsupport.cpp | 38 ++++++----------------------- src/plugins/qnx/qnxdebugsupport.h | 11 --------- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index d4a55c24191..d68c091113f 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -136,22 +136,17 @@ QnxDebugSupport::QnxDebugSupport(RunControl *runControl) setDisplayName("QnxDebugSupport"); appendMessage(tr("Preparing remote side..."), LogMessageFormat); - m_portsGatherer = new GdbServerPortsGatherer(runControl); - m_portsGatherer->setUseGdbServer(isCppDebugging()); - m_portsGatherer->setUseQmlServer(isQmlDebugging()); + setUsePortsGatherer(isCppDebugging(), isQmlDebugging()); - auto debuggeeRunner = new QnxDebuggeeRunner(runControl, m_portsGatherer); - debuggeeRunner->addStartDependency(m_portsGatherer); + auto debuggeeRunner = new QnxDebuggeeRunner(runControl, portsGatherer()); + debuggeeRunner->addStartDependency(portsGatherer()); auto slog2InfoRunner = new Slog2InfoRunner(runControl); debuggeeRunner->addStartDependency(slog2InfoRunner); addStartDependency(debuggeeRunner); -} -void QnxDebugSupport::start() -{ - auto runConfig = qobject_cast(runControl()->runConfiguration()); + auto runConfig = qobject_cast(runControl->runConfiguration()); QTC_ASSERT(runConfig, return); Target *target = runConfig->target(); Kit *k = target->kit(); @@ -159,14 +154,10 @@ void QnxDebugSupport::start() setStartMode(AttachToRemoteServer); setCloseMode(KillAtClose); setUseCtrlCStub(true); - setRemoteChannel(m_portsGatherer->gdbServerChannel()); - setQmlServer(m_portsGatherer->qmlServer()); setSolibSearchPath(searchPaths(k)); if (auto qtVersion = dynamic_cast(QtSupport::QtKitInformation::qtVersion(k))) setSysRoot(qtVersion->qnxTarget()); setSymbolFile(runConfig->localExecutableFilePath()); - - DebuggerRunTool::start(); } @@ -213,6 +204,7 @@ public: : SimpleTargetRunner(runControl), m_portsGatherer(portsGatherer) { setDisplayName("PDebugRunner"); + addStartDependency(m_portsGatherer); } private: @@ -236,28 +228,14 @@ QnxAttachDebugSupport::QnxAttachDebugSupport(RunControl *runControl) { setDisplayName("QnxAttachDebugSupport"); - m_portsGatherer = new GdbServerPortsGatherer(runControl); - m_portsGatherer->setUseGdbServer(isCppDebugging()); - m_portsGatherer->setUseQmlServer(isQmlDebugging()); + setUsePortsGatherer(isCppDebugging(), isQmlDebugging()); if (isCppDebugging()) { - m_pdebugRunner = new PDebugRunner(runControl, m_portsGatherer); - m_pdebugRunner->addStartDependency(m_portsGatherer); - addStartDependency(m_pdebugRunner); - } else { - // No pdebug needed for Qml-only debugging. - addStartDependency(m_portsGatherer); + auto pdebugRunner = new PDebugRunner(runControl, portsGatherer()); + addStartDependency(pdebugRunner); } } -void QnxAttachDebugSupport::start() -{ - setRemoteChannel(m_portsGatherer->gdbServerChannel()); - setQmlServer(m_portsGatherer->qmlServer()); - - DebuggerRunTool::start(); -} - void QnxAttachDebugSupport::showProcessesDialog() { auto kitChooser = new KitChooser; diff --git a/src/plugins/qnx/qnxdebugsupport.h b/src/plugins/qnx/qnxdebugsupport.h index bfce06231f3..ed38da8874b 100644 --- a/src/plugins/qnx/qnxdebugsupport.h +++ b/src/plugins/qnx/qnxdebugsupport.h @@ -36,11 +36,6 @@ class QnxDebugSupport : public Debugger::DebuggerRunTool public: explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl); - -private: - void start() override; - - Debugger::GdbServerPortsGatherer *m_portsGatherer; }; class QnxAttachDebugSupport : public Debugger::DebuggerRunTool @@ -51,12 +46,6 @@ public: explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl); static void showProcessesDialog(); - -private: - void start() final; - - Debugger::GdbServerPortsGatherer *m_portsGatherer; - ProjectExplorer::SimpleTargetRunner *m_pdebugRunner; }; } // namespace Internal