summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nätterlund <tobias.naetterlund.qnx@kdab.com>2013-11-05 14:29:05 +0100
committerTobias Nätterlund <tobias.naetterlund@kdab.com>2013-11-15 12:51:17 +0100
commit49eb7349732d7873e931e604e8f17c63b68b639d (patch)
tree57bab0c0ae0dd12118926632ceaeb4937771398f
parent56fc59ab5f089125232a3bef67aeaf2b93aa38e1 (diff)
downloadqt-creator-49eb7349732d7873e931e604e8f17c63b68b639d.tar.gz
QNX: Fix QML debugging on remote QNX devices
Change-Id: I7e5be01328ab32db9218fbdefaede7044131d2b9 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
-rw-r--r--src/plugins/debugger/gdb/remotegdbserveradapter.cpp2
-rw-r--r--src/plugins/qnx/qnxdebugsupport.cpp29
-rw-r--r--src/plugins/qnx/qnxdebugsupport.h8
3 files changed, 38 insertions, 1 deletions
diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp
index a32387a577..5cec6a3572 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 ecea328c80..33d9c53889 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 <debugger/debuggerengine.h>
#include <debugger/debuggerrunconfigurationaspect.h>
+#include <debugger/debuggerrunner.h>
#include <debugger/debuggerstartparameters.h>
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
@@ -43,6 +46,8 @@
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
+#include <QFileInfo>
+
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<const QnxDeviceConfiguration>();
+
+ 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 fa5a9dde26..9e5ad96427 100644
--- a/src/plugins/qnx/qnxdebugsupport.h
+++ b/src/plugins/qnx/qnxdebugsupport.h
@@ -34,12 +34,15 @@
#include "qnxabstractrunsupport.h"
+#include <utils/outputformat.h>
+
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;