diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index a32387a5774..5cec6a35720 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -182,7 +182,7 @@ void GdbRemoteServerEngine::setupInferior() //const QByteArray sysroot = sp.sysroot.toLocal8Bit(); //const QByteArray remoteArch = sp.remoteArchitecture.toLatin1(); - const QString args = sp.processArgs; + const QString args = isMasterEngine() ? startParameters().processArgs : masterEngine()->startParameters().processArgs; // if (!remoteArch.isEmpty()) // postCommand("set architecture " + remoteArch); diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index ecea328c802..33d9c538890 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -31,10 +31,13 @@ #include "qnxdebugsupport.h" #include "qnxconstants.h" +#include "qnxdeviceconfiguration.h" #include "qnxrunconfiguration.h" +#include "slog2inforunner.h" #include #include +#include #include #include #include @@ -43,6 +46,8 @@ #include #include +#include + using namespace ProjectExplorer; using namespace RemoteLinux; @@ -66,6 +71,16 @@ QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::Debug connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleAdapterSetupRequested())); + + const QString applicationId = QFileInfo(runConfig->remoteExecutableFilePath()).fileName(); + ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit()); + QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast(); + + m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this); + connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(handleApplicationOutput(QString,Utils::OutputFormat))); + connect(runner, SIGNAL(remoteProcessStarted()), m_slog2Info, SLOT(start())); + if (qnxDevice->qnxVersion() > 0x060500) + connect(m_slog2Info, SIGNAL(commandMissing()), this, SLOT(printMissingWarning())); } void QnxDebugSupport::handleAdapterSetupRequested() @@ -130,6 +145,7 @@ void QnxDebugSupport::handleDebuggingFinished() // the inferior process, as invoking "kill" in gdb doesn't work // on QNX gdb setFinished(); + m_slog2Info->stop(); killInferiorProcess(); } @@ -170,3 +186,16 @@ void QnxDebugSupport::handleError(const QString &error) m_engine->notifyEngineRemoteSetupFailed(tr("Initial setup failed: %1").arg(error)); } } + +void QnxDebugSupport::printMissingWarning() +{ + if (m_engine) + m_engine->showMessage(tr("Warning: \"slog2info\" is not found on the device, debug output not available!"), Debugger::AppError); +} + +void QnxDebugSupport::handleApplicationOutput(const QString &msg, Utils::OutputFormat outputFormat) +{ + Q_UNUSED(outputFormat); + if (m_engine) + m_engine->showMessage(msg, Debugger::AppOutput); +} diff --git a/src/plugins/qnx/qnxdebugsupport.h b/src/plugins/qnx/qnxdebugsupport.h index fa5a9dde265..9e5ad96427c 100644 --- a/src/plugins/qnx/qnxdebugsupport.h +++ b/src/plugins/qnx/qnxdebugsupport.h @@ -34,12 +34,15 @@ #include "qnxabstractrunsupport.h" +#include + namespace Debugger { class DebuggerEngine; } namespace Qnx { namespace Internal { class QnxRunConfiguration; +class Slog2InfoRunner; class QnxDebugSupport : public QnxAbstractRunSupport { @@ -60,6 +63,9 @@ private slots: void handleRemoteOutput(const QByteArray &output); void handleError(const QString &error); + void printMissingWarning(); + void handleApplicationOutput(const QString &msg, Utils::OutputFormat outputFormat); + private: void startExecution(); @@ -67,6 +73,8 @@ private: void killInferiorProcess(); + Slog2InfoRunner *m_slog2Info; + Debugger::DebuggerEngine *m_engine; int m_pdebugPort; int m_qmlPort;