forked from qt-creator/qt-creator
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:
committed by
Tobias Nätterlund
parent
56fc59ab5f
commit
49eb734973
@@ -182,7 +182,7 @@ void GdbRemoteServerEngine::setupInferior()
|
|||||||
|
|
||||||
//const QByteArray sysroot = sp.sysroot.toLocal8Bit();
|
//const QByteArray sysroot = sp.sysroot.toLocal8Bit();
|
||||||
//const QByteArray remoteArch = sp.remoteArchitecture.toLatin1();
|
//const QByteArray remoteArch = sp.remoteArchitecture.toLatin1();
|
||||||
const QString args = sp.processArgs;
|
const QString args = isMasterEngine() ? startParameters().processArgs : masterEngine()->startParameters().processArgs;
|
||||||
|
|
||||||
// if (!remoteArch.isEmpty())
|
// if (!remoteArch.isEmpty())
|
||||||
// postCommand("set architecture " + remoteArch);
|
// postCommand("set architecture " + remoteArch);
|
||||||
|
|||||||
@@ -31,10 +31,13 @@
|
|||||||
|
|
||||||
#include "qnxdebugsupport.h"
|
#include "qnxdebugsupport.h"
|
||||||
#include "qnxconstants.h"
|
#include "qnxconstants.h"
|
||||||
|
#include "qnxdeviceconfiguration.h"
|
||||||
#include "qnxrunconfiguration.h"
|
#include "qnxrunconfiguration.h"
|
||||||
|
#include "slog2inforunner.h"
|
||||||
|
|
||||||
#include <debugger/debuggerengine.h>
|
#include <debugger/debuggerengine.h>
|
||||||
#include <debugger/debuggerrunconfigurationaspect.h>
|
#include <debugger/debuggerrunconfigurationaspect.h>
|
||||||
|
#include <debugger/debuggerrunner.h>
|
||||||
#include <debugger/debuggerstartparameters.h>
|
#include <debugger/debuggerstartparameters.h>
|
||||||
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
|
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
|
||||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||||
@@ -43,6 +46,8 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
|
#include <QFileInfo>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace RemoteLinux;
|
using namespace RemoteLinux;
|
||||||
|
|
||||||
@@ -66,6 +71,16 @@ QnxDebugSupport::QnxDebugSupport(QnxRunConfiguration *runConfig, Debugger::Debug
|
|||||||
connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteOutput(QByteArray)));
|
connect(runner, SIGNAL(remoteStderr(QByteArray)), SLOT(handleRemoteOutput(QByteArray)));
|
||||||
|
|
||||||
connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleAdapterSetupRequested()));
|
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()
|
void QnxDebugSupport::handleAdapterSetupRequested()
|
||||||
@@ -130,6 +145,7 @@ void QnxDebugSupport::handleDebuggingFinished()
|
|||||||
// the inferior process, as invoking "kill" in gdb doesn't work
|
// the inferior process, as invoking "kill" in gdb doesn't work
|
||||||
// on QNX gdb
|
// on QNX gdb
|
||||||
setFinished();
|
setFinished();
|
||||||
|
m_slog2Info->stop();
|
||||||
killInferiorProcess();
|
killInferiorProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,3 +186,16 @@ void QnxDebugSupport::handleError(const QString &error)
|
|||||||
m_engine->notifyEngineRemoteSetupFailed(tr("Initial setup failed: %1").arg(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);
|
||||||
|
}
|
||||||
|
|||||||
@@ -34,12 +34,15 @@
|
|||||||
|
|
||||||
#include "qnxabstractrunsupport.h"
|
#include "qnxabstractrunsupport.h"
|
||||||
|
|
||||||
|
#include <utils/outputformat.h>
|
||||||
|
|
||||||
namespace Debugger { class DebuggerEngine; }
|
namespace Debugger { class DebuggerEngine; }
|
||||||
|
|
||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QnxRunConfiguration;
|
class QnxRunConfiguration;
|
||||||
|
class Slog2InfoRunner;
|
||||||
|
|
||||||
class QnxDebugSupport : public QnxAbstractRunSupport
|
class QnxDebugSupport : public QnxAbstractRunSupport
|
||||||
{
|
{
|
||||||
@@ -60,6 +63,9 @@ private slots:
|
|||||||
void handleRemoteOutput(const QByteArray &output);
|
void handleRemoteOutput(const QByteArray &output);
|
||||||
void handleError(const QString &error);
|
void handleError(const QString &error);
|
||||||
|
|
||||||
|
void printMissingWarning();
|
||||||
|
void handleApplicationOutput(const QString &msg, Utils::OutputFormat outputFormat);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void startExecution();
|
void startExecution();
|
||||||
|
|
||||||
@@ -67,6 +73,8 @@ private:
|
|||||||
|
|
||||||
void killInferiorProcess();
|
void killInferiorProcess();
|
||||||
|
|
||||||
|
Slog2InfoRunner *m_slog2Info;
|
||||||
|
|
||||||
Debugger::DebuggerEngine *m_engine;
|
Debugger::DebuggerEngine *m_engine;
|
||||||
int m_pdebugPort;
|
int m_pdebugPort;
|
||||||
int m_qmlPort;
|
int m_qmlPort;
|
||||||
|
|||||||
Reference in New Issue
Block a user