diff options
author | Tobias Nätterlund <tobias.naetterlund.qnx@kdab.com> | 2013-10-18 16:08:56 +0200 |
---|---|---|
committer | Tobias Nätterlund <tobias.naetterlund@kdab.com> | 2013-10-21 12:51:12 +0200 |
commit | 5fb7e6f1f7d5e09bf6fb2ee168a1de6d0bb8f4b3 (patch) | |
tree | f9ff907f77820f71172c1a2724fc7aa1b5f33418 | |
parent | 51a257637e60e4789165a357c8544e8fc4973e68 (diff) |
QNX: Use slog2info on pure QNX devices for debug output
If available, slog2info should be used even for pure QNX devices
to get hold of the debug output.
Task-number: QTCREATORBUG-10442
Change-Id: If85855e94803a4b8648e84c0295bfdd2271e8d76
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
-rw-r--r-- | src/plugins/qnx/qnxruncontrol.cpp | 26 | ||||
-rw-r--r-- | src/plugins/qnx/qnxruncontrol.h | 7 | ||||
-rw-r--r-- | src/plugins/qnx/slog2inforunner.h | 4 |
3 files changed, 34 insertions, 3 deletions
diff --git a/src/plugins/qnx/qnxruncontrol.cpp b/src/plugins/qnx/qnxruncontrol.cpp index 1aef6ca959..0f717d83be 100644 --- a/src/plugins/qnx/qnxruncontrol.cpp +++ b/src/plugins/qnx/qnxruncontrol.cpp @@ -30,16 +30,38 @@ ****************************************************************************/ #include "qnxruncontrol.h" +#include "qnxdeviceconfiguration.h" #include "qnxrunconfiguration.h" +#include "slog2inforunner.h" +#include <projectexplorer/kitinformation.h> #include <projectexplorer/runconfiguration.h> -#include <remotelinux/remotelinuxrunconfiguration.h> +#include <projectexplorer/target.h> + +#include <QFileInfo> using namespace Qnx; using namespace Qnx::Internal; using namespace RemoteLinux; QnxRunControl::QnxRunControl(ProjectExplorer::RunConfiguration *runConfig) - : RemoteLinuxRunControl(runConfig) + : RemoteLinuxRunControl(runConfig) + , m_slog2Info(0) +{ + ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit()); + QnxDeviceConfiguration::ConstPtr qnxDevice = dev.dynamicCast<const QnxDeviceConfiguration>(); + + QnxRunConfiguration *qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runConfig); + QTC_CHECK(qnxRunConfig); + + const QString applicationId = QFileInfo(qnxRunConfig->remoteExecutableFilePath()).fileName(); + m_slog2Info = new Slog2InfoRunner(applicationId, qnxDevice, this); + connect(m_slog2Info, SIGNAL(output(QString,Utils::OutputFormat)), this, SLOT(appendMessage(QString,Utils::OutputFormat))); + connect(this, SIGNAL(started()), m_slog2Info, SLOT(start())); +} + +ProjectExplorer::RunControl::StopResult QnxRunControl::stop() { + m_slog2Info->stop(); + return RemoteLinuxRunControl::stop(); } diff --git a/src/plugins/qnx/qnxruncontrol.h b/src/plugins/qnx/qnxruncontrol.h index c064d15328..20368e6089 100644 --- a/src/plugins/qnx/qnxruncontrol.h +++ b/src/plugins/qnx/qnxruncontrol.h @@ -37,11 +37,18 @@ namespace Qnx { namespace Internal { +class Slog2InfoRunner; + class QnxRunControl : public RemoteLinux::RemoteLinuxRunControl { Q_OBJECT public: explicit QnxRunControl(ProjectExplorer::RunConfiguration *runConfig); + + RemoteLinux::RemoteLinuxRunControl::StopResult stop(); + +private: + Slog2InfoRunner *m_slog2Info; }; } // namespace Internal diff --git a/src/plugins/qnx/slog2inforunner.h b/src/plugins/qnx/slog2inforunner.h index 52455e2466..9728f3aa7b 100644 --- a/src/plugins/qnx/slog2inforunner.h +++ b/src/plugins/qnx/slog2inforunner.h @@ -52,11 +52,13 @@ class Slog2InfoRunner : public QObject public: explicit Slog2InfoRunner(const QString &applicationId, const RemoteLinux::LinuxDevice::ConstPtr &device, QObject *parent = 0); - void start(); void stop(); bool commandFound() const; +public slots: + void start(); + signals: void commandMissing(); void started(); |