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");
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<QnxRunConfiguration *>(runControl()->runConfiguration());
auto runConfig = qobject_cast<QnxRunConfiguration *>(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<QnxQtVersion *>(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;

View File

@@ -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