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>
This commit is contained in:
Tobias Nätterlund
2013-11-05 14:29:05 +01:00
committed by Tobias Nätterlund
parent 56fc59ab5f
commit 49eb734973
3 changed files with 38 additions and 1 deletions

View File

@@ -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);
}