diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 32432617851..0cf35d9d7c1 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1019,7 +1019,8 @@ void GdbServerPortsGatherer::handlePortListReady() return; } } - reportDone(); +// reportDone(); + reportStarted(); } // GdbServerRunner diff --git a/src/plugins/qnx/qnxconstants.h b/src/plugins/qnx/qnxconstants.h index 13656eccf7b..979aa1e94e8 100644 --- a/src/plugins/qnx/qnxconstants.h +++ b/src/plugins/qnx/qnxconstants.h @@ -28,7 +28,6 @@ #include namespace Qnx { - namespace Constants { const char QNX_TARGET_KEY[] = "QNX_TARGET"; diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index 95147e51ef4..cb506420b75 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -102,7 +102,7 @@ public: } private: - void start() override + void start() final { StandardRunnable r = runnable().as(); QStringList arguments; @@ -155,17 +155,13 @@ void QnxDebugSupport::start() Target *target = runConfig->target(); Kit *k = target->kit(); - auto inferior = runConfig->runnable().as(); - inferior.executable = runConfig->remoteExecutableFilePath(); - inferior.commandLineArguments = runConfig->arguments(); - setStartMode(AttachToRemoteServer); setCloseMode(KillAtClose); setUseCtrlCStub(true); setRemoteChannel(m_portsGatherer->gdbServerChannel()); setQmlServer(m_portsGatherer->qmlServer()); - setInferior(inferior); setSolibSearchPath(searchPaths(k)); + setSymbolFile(runConfig->localExecutableFilePath()); DebuggerRunTool::start(); } @@ -219,20 +215,11 @@ public: private: void start() final { - StandardRunnable r = runnable().as(); - QStringList arguments; - if (m_portsGatherer->useGdbServer()) { - Port pdebugPort = m_portsGatherer->gdbServerPort(); - r.executable = Constants::QNX_DEBUG_EXECUTABLE; - arguments.append(pdebugPort.toString()); - } - if (m_portsGatherer->useQmlServer()) { - arguments.append(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, - m_portsGatherer->qmlServerPort())); - } - arguments.append(QtcProcess::splitArgs(r.commandLineArguments)); - r.commandLineArguments = QtcProcess::joinArgs(arguments); + Port pdebugPort = m_portsGatherer->gdbServerPort(); + StandardRunnable r; + r.executable = Constants::QNX_DEBUG_EXECUTABLE; + r.commandLineArguments = pdebugPort.toString(); setRunnable(r); SimpleTargetRunner::start(); @@ -250,21 +237,22 @@ QnxAttachDebugSupport::QnxAttachDebugSupport(RunControl *runControl) m_portsGatherer->setUseGdbServer(isCppDebugging()); m_portsGatherer->setUseQmlServer(isQmlDebugging()); - m_pdebugRunner = new PDebugRunner(runControl, m_portsGatherer); - m_pdebugRunner->addStartDependency(m_portsGatherer); + 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); + } +} - addStartDependency(m_pdebugRunner); +void QnxAttachDebugSupport::start() +{ + setRemoteChannel(m_portsGatherer->gdbServerChannel()); + setQmlServer(m_portsGatherer->qmlServer()); -// connect(m_launcher, &ApplicationLauncher::remoteProcessStarted, -// this, &QnxAttachDebugSupport::attachToProcess); -// connect(m_launcher, &ApplicationLauncher::reportError, -// this, &QnxAttachDebugSupport::handleError); -// connect(m_launcher, &ApplicationLauncher::reportProgress, -// this, &QnxAttachDebugSupport::handleProgressReport); -// connect(m_launcher, &ApplicationLauncher::remoteStdout, -// this, &QnxAttachDebugSupport::handleRemoteOutput); -// connect(m_launcher, &ApplicationLauncher::remoteStderr, -// this, &QnxAttachDebugSupport::handleRemoteOutput); + DebuggerRunTool::start(); } void QnxAttachDebugSupport::showProcessesDialog() @@ -285,73 +273,33 @@ void QnxAttachDebugSupport::showProcessesDialog() return; // FIXME: That should be somehow related to the selected kit. - auto runConfig = RunConfiguration::startupRunConfiguration(); + auto startRunConfig = RunConfiguration::startupRunConfiguration(); + auto runConfig = qobject_cast(startRunConfig); if (!runConfig) return; DeviceProcessItem process = dlg.currentProcess(); const int pid = process.pid; +// QString projectSourceDirectory = dlg.projectSource(); + QString localExecutable = dlg.localExecutable(); + if (localExecutable.isEmpty()) + localExecutable = runConfig->localExecutableFilePath(); auto runControl = new RunControl(runConfig, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto debugger = new QnxAttachDebugSupport(runControl); - debugger->setAttachPid(pid); - debugger->setSymbolFile(dlg.localExecutable()); -// QString projectSourceDirectory = dlg.projectSource(); - -// auto runConfig = qobject_cast(runControl()->runConfiguration()); -// QTC_ASSERT(runConfig, return); -// Target *target = runConfig->target(); - -// StandardRunnable inferior; -// inferior.executable = runConfig->remoteExecutableFilePath(); -// inferior.executable = m_localExecutablePath; -// inferior.commandLineArguments = runConfig->arguments(); - debugger->setStartMode(AttachToRemoteServer); debugger->setCloseMode(DetachAtClose); + debugger->setNeedFixup(false); + debugger->setSymbolFile(localExecutable); debugger->setUseCtrlCStub(true); -// setInferior(inferior); + debugger->setAttachPid(pid); // setRunControlName(tr("Remote: \"%1\" - Process %2").arg(remoteChannel).arg(m_process.pid)); debugger->setRunControlName(tr("Remote QNX process %1").arg(pid)); debugger->setSolibSearchPath(searchPaths(kit)); + debugger->setUseContinueInsteadOfRun(true); - (void) new QnxAttachDebugSupport(runControl); ProjectExplorerPlugin::startRunControl(runControl); } -void QnxAttachDebugSupport::handleDebuggerStateChanged(Debugger::DebuggerState state) -{ - if (state == Debugger::DebuggerFinished) - stopPDebug(); -} - -void QnxAttachDebugSupport::handleError(const QString &message) -{ - showMessage(message, Debugger::AppError); -} - -void QnxAttachDebugSupport::handleProgressReport(const QString &message) -{ - showMessage(message, Debugger::AppStuff); -} - -void QnxAttachDebugSupport::handleRemoteOutput(const QString &output) -{ - showMessage(output, Debugger::AppOutput); -} - -void QnxAttachDebugSupport::stopPDebug() -{ -// m_launcher->stop(); -} - -void QnxAttachDebugSupport::start() -{ - setRemoteChannel(m_portsGatherer->gdbServerChannel()); - setQmlServer(m_portsGatherer->qmlServer()); - - DebuggerRunTool::start(); -} - } // namespace Internal } // namespace Qnx diff --git a/src/plugins/qnx/qnxdebugsupport.h b/src/plugins/qnx/qnxdebugsupport.h index 2d31baa7e6d..bfce06231f3 100644 --- a/src/plugins/qnx/qnxdebugsupport.h +++ b/src/plugins/qnx/qnxdebugsupport.h @@ -27,8 +27,6 @@ #include -#include - namespace Qnx { namespace Internal { @@ -57,22 +55,8 @@ public: private: void start() final; - void launchPDebug(); - void attachToProcess(); - - void handleDebuggerStateChanged(Debugger::DebuggerState state); - void handleError(const QString &message); - void handleProgressReport(const QString &message); - void handleRemoteOutput(const QString &output); - - void stopPDebug(); - Debugger::GdbServerPortsGatherer *m_portsGatherer; ProjectExplorer::SimpleTargetRunner *m_pdebugRunner; - - Utils::Port m_pdebugPort; - QString m_projectSourceDirectory; - QString m_localExecutablePath; }; } // namespace Internal diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp index 5d1c640a01b..07306e81e30 100644 --- a/src/plugins/qnx/qnxplugin.cpp +++ b/src/plugins/qnx/qnxplugin.cpp @@ -139,8 +139,8 @@ void QnxPlugin::updateDebuggerActions() } } - m_attachToQnxApplication->setVisible(false && hasValidQnxKit); // FIXME - m_debugSeparator->setVisible(false && hasValidQnxKit); // FIXME QTCREATORBUG-16608 + m_attachToQnxApplication->setVisible(hasValidQnxKit); + m_debugSeparator->setVisible(hasValidQnxKit); } } // Internal