forked from qt-creator/qt-creator
ios: qml debug support
Change-Id: I0fdd7a35de7b446cd991407d7c30b92cd3cc7787 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -119,7 +119,9 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi
|
|||||||
|
|
||||||
Debugger::DebuggerRunConfigurationAspect *aspect
|
Debugger::DebuggerRunConfigurationAspect *aspect
|
||||||
= runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
|
= runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
|
||||||
if (aspect->useCppDebugger()) {
|
bool cppDebug = aspect->useCppDebugger();
|
||||||
|
bool qmlDebug = aspect->useQmlDebugger();
|
||||||
|
if (cppDebug) {
|
||||||
params.languages |= CppLanguage;
|
params.languages |= CppLanguage;
|
||||||
params.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
params.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
||||||
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
|
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
|
||||||
@@ -128,42 +130,36 @@ RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfi
|
|||||||
params.executable = runConfig->exePath().toString();
|
params.executable = runConfig->exePath().toString();
|
||||||
params.remoteChannel = QLatin1String("connect://localhost:0");
|
params.remoteChannel = QLatin1String("connect://localhost:0");
|
||||||
}
|
}
|
||||||
if (aspect->useQmlDebugger()) {
|
if (qmlDebug) {
|
||||||
params.languages |= QmlLanguage;
|
params.languages |= QmlLanguage;
|
||||||
QTcpServer server;
|
|
||||||
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|
|
||||||
|| server.listen(QHostAddress::LocalHostIPv6), return 0);
|
|
||||||
params.qmlServerAddress = server.serverAddress().toString();
|
|
||||||
params.remoteSetupNeeded = true;
|
|
||||||
//TODO: Not sure if these are the right paths.
|
|
||||||
params.projectSourceDirectory = project->projectDirectory();
|
params.projectSourceDirectory = project->projectDirectory();
|
||||||
params.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles);
|
params.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles);
|
||||||
params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir();
|
params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir();
|
||||||
|
if (!cppDebug)
|
||||||
|
params.startMode = AttachToRemoteServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
DebuggerRunControl * const debuggerRunControl
|
DebuggerRunControl * const debuggerRunControl
|
||||||
= DebuggerPlugin::createDebugger(params, runConfig, errorMessage);
|
= DebuggerPlugin::createDebugger(params, runConfig, errorMessage);
|
||||||
if (debuggerRunControl)
|
if (debuggerRunControl)
|
||||||
new IosDebugSupport(runConfig, debuggerRunControl);
|
new IosDebugSupport(runConfig, debuggerRunControl, cppDebug, qmlDebug);
|
||||||
return debuggerRunControl;
|
return debuggerRunControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
IosDebugSupport::IosDebugSupport(IosRunConfiguration *runConfig,
|
IosDebugSupport::IosDebugSupport(IosRunConfiguration *runConfig,
|
||||||
DebuggerRunControl *runControl)
|
DebuggerRunControl *runControl, bool cppDebug, bool qmlDebug)
|
||||||
: QObject(runControl), m_runControl(runControl),
|
: QObject(runControl), m_runControl(runControl),
|
||||||
m_runner(new IosRunner(this, runConfig, true)),
|
m_runner(new IosRunner(this, runConfig, cppDebug, qmlDebug))
|
||||||
m_qmlPort(0)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
connect(m_runControl->engine(), SIGNAL(requestRemoteSetup()),
|
connect(m_runControl->engine(), SIGNAL(requestRemoteSetup()),
|
||||||
m_runner, SLOT(start()));
|
m_runner, SLOT(start()));
|
||||||
connect(m_runControl, SIGNAL(finished()),
|
connect(m_runControl, SIGNAL(finished()),
|
||||||
m_runner, SLOT(stop()));
|
m_runner, SLOT(stop()));
|
||||||
|
|
||||||
connect(m_runner, SIGNAL(gotGdbserverPort(int)),
|
connect(m_runner, SIGNAL(gotServerPorts(int,int)),
|
||||||
SLOT(handleGdbServerPort(int)));
|
SLOT(handleServerPorts(int,int)));
|
||||||
connect(m_runner, SIGNAL(gotInferiorPid(Q_PID)),
|
connect(m_runner, SIGNAL(gotInferiorPid(Q_PID, int)),
|
||||||
SLOT(handleGotInferiorPid(Q_PID)));
|
SLOT(handleGotInferiorPid(Q_PID, int)));
|
||||||
connect(m_runner, SIGNAL(finished(bool)),
|
connect(m_runner, SIGNAL(finished(bool)),
|
||||||
SLOT(handleRemoteProcessFinished(bool)));
|
SLOT(handleRemoteProcessFinished(bool)));
|
||||||
|
|
||||||
@@ -177,22 +173,22 @@ IosDebugSupport::~IosDebugSupport()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDebugSupport::handleGdbServerPort(int gdbServerPort)
|
void IosDebugSupport::handleServerPorts(int gdbServerPort, int qmlPort)
|
||||||
{
|
{
|
||||||
if (gdbServerPort > 0) {
|
if (gdbServerPort > 0 || (m_runner && !m_runner->cppDebug() && qmlPort > 0)) {
|
||||||
m_runControl->engine()->notifyEngineRemoteSetupDone(gdbServerPort, m_qmlPort);
|
m_runControl->engine()->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
|
||||||
} else {
|
} else {
|
||||||
m_runControl->engine()->notifyEngineRemoteSetupFailed(
|
m_runControl->engine()->notifyEngineRemoteSetupFailed(
|
||||||
tr("Could not get debug server file descriptor."));
|
tr("Could not get debug server file descriptor."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDebugSupport::handleGotInferiorPid(Q_PID pid)
|
void IosDebugSupport::handleGotInferiorPid(Q_PID pid, int qmlPort)
|
||||||
{
|
{
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
//m_runControl->engine()->notifyInferiorPid(pid);
|
//m_runControl->engine()->notifyInferiorPid(pid);
|
||||||
#ifndef Q_OS_WIN // Q_PID might be 64 bit pointer...
|
#ifndef Q_OS_WIN // Q_PID might be 64 bit pointer...
|
||||||
m_runControl->engine()->notifyEngineRemoteSetupDone(int(pid), m_qmlPort);
|
m_runControl->engine()->notifyEngineRemoteSetupDone(int(pid), qmlPort);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
m_runControl->engine()->notifyEngineRemoteSetupFailed(
|
m_runControl->engine()->notifyEngineRemoteSetupFailed(
|
||||||
|
|||||||
@@ -50,12 +50,12 @@ public:
|
|||||||
QString *errorMessage);
|
QString *errorMessage);
|
||||||
|
|
||||||
IosDebugSupport(IosRunConfiguration *runConfig,
|
IosDebugSupport(IosRunConfiguration *runConfig,
|
||||||
Debugger::DebuggerRunControl *runControl);
|
Debugger::DebuggerRunControl *runControl, bool cppDebug, bool qmlDebug);
|
||||||
~IosDebugSupport();
|
~IosDebugSupport();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleGdbServerPort(int gdbServerFd);
|
void handleServerPorts(int gdbServerFd, int qmlPort);
|
||||||
void handleGotInferiorPid(Q_PID);
|
void handleGotInferiorPid(Q_PID, int qmlPort);
|
||||||
void handleRemoteProcessFinished(bool cleanEnd);
|
void handleRemoteProcessFinished(bool cleanEnd);
|
||||||
|
|
||||||
void handleRemoteOutput(const QString &output);
|
void handleRemoteOutput(const QString &output);
|
||||||
@@ -65,8 +65,6 @@ private:
|
|||||||
Debugger::DebuggerRunControl *m_runControl;
|
Debugger::DebuggerRunControl *m_runControl;
|
||||||
IosRunner * const m_runner;
|
IosRunner * const m_runner;
|
||||||
const QString m_dumperLib;
|
const QString m_dumperLib;
|
||||||
|
|
||||||
int m_qmlPort;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Internal {
|
|||||||
|
|
||||||
IosRunControl::IosRunControl(IosRunConfiguration *rc)
|
IosRunControl::IosRunControl(IosRunConfiguration *rc)
|
||||||
: RunControl(rc, NormalRunMode)
|
: RunControl(rc, NormalRunMode)
|
||||||
, m_runner(new IosRunner(this, rc, false))
|
, m_runner(new IosRunner(this, rc, false, false))
|
||||||
, m_running(false)
|
, m_running(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,12 @@
|
|||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <debugger/debuggerrunconfigurationaspect.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QRegExp>
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
@@ -52,11 +54,12 @@ using namespace ProjectExplorer;
|
|||||||
namespace Ios {
|
namespace Ios {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
IosRunner::IosRunner(QObject *parent, IosRunConfiguration *runConfig, bool debuggingMode)
|
IosRunner::IosRunner(QObject *parent, IosRunConfiguration *runConfig, bool cppDebug, bool qmlDebug)
|
||||||
: QObject(parent), m_toolHandler(0), m_bundleDir(runConfig->bundleDir().toString()),
|
: QObject(parent), m_toolHandler(0), m_bundleDir(runConfig->bundleDir().toString()),
|
||||||
m_arguments(runConfig->commandLineArguments()),
|
m_arguments(runConfig->commandLineArguments()),
|
||||||
m_device(ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit())),
|
m_device(ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit())),
|
||||||
m_debuggingMode(debuggingMode), m_cleanExit(false), m_pid(0)
|
m_cppDebug(cppDebug), m_qmlDebug(qmlDebug), m_cleanExit(false),
|
||||||
|
m_qmlPort(0), m_pid(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +75,10 @@ QString IosRunner::bundlePath()
|
|||||||
|
|
||||||
QStringList IosRunner::extraArgs()
|
QStringList IosRunner::extraArgs()
|
||||||
{
|
{
|
||||||
return m_arguments;
|
QStringList res = m_arguments;
|
||||||
|
if (m_qmlPort != 0)
|
||||||
|
res << QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(m_qmlPort);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IosRunner::deviceId()
|
QString IosRunner::deviceId()
|
||||||
@@ -85,11 +91,21 @@ QString IosRunner::deviceId()
|
|||||||
|
|
||||||
IosToolHandler::RunKind IosRunner::runType()
|
IosToolHandler::RunKind IosRunner::runType()
|
||||||
{
|
{
|
||||||
if (m_debuggingMode)
|
if (m_cppDebug)
|
||||||
return IosToolHandler::DebugRun;
|
return IosToolHandler::DebugRun;
|
||||||
return IosToolHandler::NormalRun;
|
return IosToolHandler::NormalRun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IosRunner::cppDebug() const
|
||||||
|
{
|
||||||
|
return m_cppDebug;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosRunner::qmlDebug() const
|
||||||
|
{
|
||||||
|
return m_qmlDebug;
|
||||||
|
}
|
||||||
|
|
||||||
void IosRunner::start()
|
void IosRunner::start()
|
||||||
{
|
{
|
||||||
if (m_toolHandler) {
|
if (m_toolHandler) {
|
||||||
@@ -97,15 +113,27 @@ void IosRunner::start()
|
|||||||
emit finished(m_cleanExit);
|
emit finished(m_cleanExit);
|
||||||
}
|
}
|
||||||
m_cleanExit = false;
|
m_cleanExit = false;
|
||||||
|
m_qmlPort = 0;
|
||||||
IosToolHandler::DeviceType devType = IosToolHandler::IosDeviceType;
|
IosToolHandler::DeviceType devType = IosToolHandler::IosDeviceType;
|
||||||
if (m_device->type() != Ios::Constants::IOS_DEVICE_TYPE) {
|
if (m_device->type() == Ios::Constants::IOS_DEVICE_TYPE) {
|
||||||
|
IosDevice::ConstPtr iosDevice = m_device.dynamicCast<const IosDevice>();
|
||||||
|
if (m_device.isNull()) {
|
||||||
|
emit finished(m_cleanExit);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (m_qmlDebug)
|
||||||
|
m_qmlPort = iosDevice->nextPort();
|
||||||
|
} else {
|
||||||
IosSimulator::ConstPtr sim = m_device.dynamicCast<const IosSimulator>();
|
IosSimulator::ConstPtr sim = m_device.dynamicCast<const IosSimulator>();
|
||||||
if (sim.isNull()) {
|
if (sim.isNull()) {
|
||||||
emit finished(m_cleanExit);
|
emit finished(m_cleanExit);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
devType = IosToolHandler::IosSimulatedIphoneRetina4InchType; // store type in sim?
|
devType = IosToolHandler::IosSimulatedIphoneRetina4InchType; // store type in sim?
|
||||||
|
if (m_qmlDebug)
|
||||||
|
m_qmlPort = sim->nextPort();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_toolHandler = new IosToolHandler(devType, this);
|
m_toolHandler = new IosToolHandler(devType, this);
|
||||||
connect(m_toolHandler, SIGNAL(appOutput(Ios::IosToolHandler*,QString)),
|
connect(m_toolHandler, SIGNAL(appOutput(Ios::IosToolHandler*,QString)),
|
||||||
SLOT(handleAppOutput(Ios::IosToolHandler*,QString)));
|
SLOT(handleAppOutput(Ios::IosToolHandler*,QString)));
|
||||||
@@ -114,8 +142,8 @@ void IosRunner::start()
|
|||||||
SLOT(handleDidStartApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)));
|
SLOT(handleDidStartApp(Ios::IosToolHandler*,QString,QString,Ios::IosToolHandler::OpStatus)));
|
||||||
connect(m_toolHandler, SIGNAL(errorMsg(Ios::IosToolHandler*,QString)),
|
connect(m_toolHandler, SIGNAL(errorMsg(Ios::IosToolHandler*,QString)),
|
||||||
SLOT(handleErrorMsg(Ios::IosToolHandler*,QString)));
|
SLOT(handleErrorMsg(Ios::IosToolHandler*,QString)));
|
||||||
connect(m_toolHandler, SIGNAL(gotGdbserverPort(Ios::IosToolHandler*,QString,QString,int)),
|
connect(m_toolHandler, SIGNAL(gotServerPorts(Ios::IosToolHandler*,QString,QString,int,int)),
|
||||||
SLOT(handleGotGdbserverPort(Ios::IosToolHandler*,QString,QString,int)));
|
SLOT(handleGotServerPorts(Ios::IosToolHandler*,QString,QString,int,int)));
|
||||||
connect(m_toolHandler, SIGNAL(gotInferiorPid(Ios::IosToolHandler*,QString,QString,Q_PID)),
|
connect(m_toolHandler, SIGNAL(gotInferiorPid(Ios::IosToolHandler*,QString,QString,Q_PID)),
|
||||||
SLOT(handleGotInferiorPid(Ios::IosToolHandler*,QString,QString,Q_PID)));
|
SLOT(handleGotInferiorPid(Ios::IosToolHandler*,QString,QString,Q_PID)));
|
||||||
connect(m_toolHandler, SIGNAL(toolExited(Ios::IosToolHandler*,int)),
|
connect(m_toolHandler, SIGNAL(toolExited(Ios::IosToolHandler*,int)),
|
||||||
@@ -144,12 +172,13 @@ void IosRunner::handleDidStartApp(IosToolHandler *handler, const QString &bundle
|
|||||||
emit didStartApp(status);
|
emit didStartApp(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleGotGdbserverPort(IosToolHandler *handler, const QString &bundlePath,
|
void IosRunner::handleGotServerPorts(IosToolHandler *handler, const QString &bundlePath,
|
||||||
const QString &deviceId, int gdbPort)
|
const QString &deviceId, int gdbPort, int qmlPort)
|
||||||
{
|
{
|
||||||
Q_UNUSED(bundlePath); Q_UNUSED(deviceId);
|
Q_UNUSED(bundlePath); Q_UNUSED(deviceId);
|
||||||
|
m_qmlPort = qmlPort;
|
||||||
if (m_toolHandler == handler)
|
if (m_toolHandler == handler)
|
||||||
emit gotGdbserverPort(gdbPort);
|
emit gotServerPorts(gdbPort, qmlPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleGotInferiorPid(IosToolHandler *handler, const QString &bundlePath,
|
void IosRunner::handleGotInferiorPid(IosToolHandler *handler, const QString &bundlePath,
|
||||||
@@ -158,13 +187,18 @@ void IosRunner::handleGotInferiorPid(IosToolHandler *handler, const QString &bun
|
|||||||
Q_UNUSED(bundlePath); Q_UNUSED(deviceId);
|
Q_UNUSED(bundlePath); Q_UNUSED(deviceId);
|
||||||
m_pid = pid;
|
m_pid = pid;
|
||||||
if (m_toolHandler == handler)
|
if (m_toolHandler == handler)
|
||||||
emit gotInferiorPid(pid);
|
emit gotInferiorPid(pid, m_qmlPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleAppOutput(IosToolHandler *handler, const QString &output)
|
void IosRunner::handleAppOutput(IosToolHandler *handler, const QString &output)
|
||||||
{
|
{
|
||||||
Q_UNUSED(handler);
|
Q_UNUSED(handler);
|
||||||
emit appOutput(output);
|
QRegExp qmlPortRe(QLatin1String("QML Debugger: Waiting for connection on port ([0-9]+)..."));
|
||||||
|
int index = qmlPortRe.indexIn(output);
|
||||||
|
QString res(output);
|
||||||
|
if (index != -1 && m_qmlPort)
|
||||||
|
res.replace(qmlPortRe.cap(1), QString::number(m_qmlPort));
|
||||||
|
emit appOutput(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg)
|
void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg)
|
||||||
@@ -174,11 +208,16 @@ void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg)
|
|||||||
TaskHub::addTask(Task::Warning,
|
TaskHub::addTask(Task::Warning,
|
||||||
tr("Run failed. The settings in the Organizer window of Xcode might be incorrect."),
|
tr("Run failed. The settings in the Organizer window of Xcode might be incorrect."),
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
||||||
else if (msg.contains(QLatin1String("Unexpected reply: ELocked (454c6f636b6564) vs OK (OK)")))
|
else if (msg.contains(QLatin1String("Unexpected reply: ELocked (454c6f636b6564) vs OK (4f4b)")))
|
||||||
TaskHub::addTask(Task::Error,
|
TaskHub::addTask(Task::Error,
|
||||||
tr("The device is locked, please unlock."),
|
tr("The device is locked, please unlock."),
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
|
||||||
emit errorMsg(msg);
|
QRegExp qmlPortRe(QLatin1String("QML Debugger: Waiting for connection on port ([0-9]+)..."));
|
||||||
|
int index = qmlPortRe.indexIn(msg);
|
||||||
|
QString res(msg);
|
||||||
|
if (index != -1 && m_qmlPort)
|
||||||
|
res.replace(qmlPortRe.cap(1), QString::number(m_qmlPort));
|
||||||
|
emit errorMsg(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleToolExited(IosToolHandler *handler, int code)
|
void IosRunner::handleToolExited(IosToolHandler *handler, int code)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class IosRunner : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IosRunner(QObject *parent, IosRunConfiguration *m_runConfig, bool m_debuggingMode);
|
IosRunner(QObject *parent, IosRunConfiguration *runConfig, bool cppDebug, bool qmlDebug);
|
||||||
~IosRunner();
|
~IosRunner();
|
||||||
|
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
@@ -58,22 +58,24 @@ public:
|
|||||||
QStringList extraArgs();
|
QStringList extraArgs();
|
||||||
QString deviceId();
|
QString deviceId();
|
||||||
IosToolHandler::RunKind runType();
|
IosToolHandler::RunKind runType();
|
||||||
|
bool cppDebug() const;
|
||||||
|
bool qmlDebug() const;
|
||||||
public slots:
|
public slots:
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void didStartApp(Ios::IosToolHandler::OpStatus status);
|
void didStartApp(Ios::IosToolHandler::OpStatus status);
|
||||||
void gotGdbserverPort(int gdbPort);
|
void gotServerPorts(int gdbPort, int qmlPort);
|
||||||
void gotInferiorPid(Q_PID pid);
|
void gotInferiorPid(Q_PID pid, int);
|
||||||
void appOutput(const QString &output);
|
void appOutput(const QString &output);
|
||||||
void errorMsg(const QString &msg);
|
void errorMsg(const QString &msg);
|
||||||
void finished(bool cleanExit);
|
void finished(bool cleanExit);
|
||||||
private slots:
|
private slots:
|
||||||
void handleDidStartApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void handleDidStartApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
||||||
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
||||||
void handleGotGdbserverPort(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void handleGotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath,
|
||||||
const QString &deviceId, int gdbPort);
|
const QString &deviceId, int gdbPort, int qmlPort);
|
||||||
void handleGotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void handleGotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
||||||
const QString &deviceId, Q_PID pid);
|
const QString &deviceId, Q_PID pid);
|
||||||
void handleAppOutput(Ios::IosToolHandler *handler, const QString &output);
|
void handleAppOutput(Ios::IosToolHandler *handler, const QString &output);
|
||||||
@@ -85,8 +87,10 @@ private:
|
|||||||
QString m_bundleDir;
|
QString m_bundleDir;
|
||||||
QStringList m_arguments;
|
QStringList m_arguments;
|
||||||
ProjectExplorer::IDevice::ConstPtr m_device;
|
ProjectExplorer::IDevice::ConstPtr m_device;
|
||||||
bool m_debuggingMode;
|
bool m_cppDebug;
|
||||||
|
bool m_qmlDebug;
|
||||||
bool m_cleanExit;
|
bool m_cleanExit;
|
||||||
|
quint16 m_qmlPort;
|
||||||
Q_PID m_pid;
|
Q_PID m_pid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ struct ParserState {
|
|||||||
ControlChar,
|
ControlChar,
|
||||||
AppStarted,
|
AppStarted,
|
||||||
InferiorPid,
|
InferiorPid,
|
||||||
GdbServerPort,
|
ServerPorts,
|
||||||
Item,
|
Item,
|
||||||
Status,
|
Status,
|
||||||
AppTransfer,
|
AppTransfer,
|
||||||
@@ -79,6 +79,7 @@ struct ParserState {
|
|||||||
QString value;
|
QString value;
|
||||||
QMap<QString,QString> info;
|
QMap<QString,QString> info;
|
||||||
int progress, maxProgress;
|
int progress, maxProgress;
|
||||||
|
int gdbPort, qmlPort;
|
||||||
bool collectChars() {
|
bool collectChars() {
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case Msg:
|
case Msg:
|
||||||
@@ -87,9 +88,9 @@ struct ParserState {
|
|||||||
case Value:
|
case Value:
|
||||||
case Status:
|
case Status:
|
||||||
case InferiorPid:
|
case InferiorPid:
|
||||||
case GdbServerPort:
|
|
||||||
case AppOutput:
|
case AppOutput:
|
||||||
return true;
|
return true;
|
||||||
|
case ServerPorts:
|
||||||
case QueryResult:
|
case QueryResult:
|
||||||
case ControlChar:
|
case ControlChar:
|
||||||
case AppStarted:
|
case AppStarted:
|
||||||
@@ -103,7 +104,7 @@ struct ParserState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ParserState(Kind kind) :
|
ParserState(Kind kind) :
|
||||||
kind(kind) { }
|
kind(kind), gdbPort(0), qmlPort(0) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class IosToolHandlerPrivate
|
class IosToolHandlerPrivate
|
||||||
@@ -142,7 +143,8 @@ public:
|
|||||||
IosToolHandler::OpStatus status);
|
IosToolHandler::OpStatus status);
|
||||||
void didStartApp(const QString &bundlePath, const QString &deviceId,
|
void didStartApp(const QString &bundlePath, const QString &deviceId,
|
||||||
IosToolHandler::OpStatus status);
|
IosToolHandler::OpStatus status);
|
||||||
void gotGdbserverPort(const QString &bundlePath, const QString &deviceId, int gdbPort);
|
void gotServerPorts(const QString &bundlePath, const QString &deviceId, int gdbPort,
|
||||||
|
int qmlPort);
|
||||||
void gotInferiorPid(const QString &bundlePath, const QString &deviceId, Q_PID pid);
|
void gotInferiorPid(const QString &bundlePath, const QString &deviceId, Q_PID pid);
|
||||||
void deviceInfo(const QString &deviceId, const IosToolHandler::Dict &info);
|
void deviceInfo(const QString &deviceId, const IosToolHandler::Dict &info);
|
||||||
void appOutput(const QString &output);
|
void appOutput(const QString &output);
|
||||||
@@ -301,10 +303,10 @@ void IosToolHandlerPrivate::didStartApp(const QString &bundlePath, const QString
|
|||||||
emit q->didStartApp(q, bundlePath, deviceId, status);
|
emit q->didStartApp(q, bundlePath, deviceId, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosToolHandlerPrivate::gotGdbserverPort(const QString &bundlePath,
|
void IosToolHandlerPrivate::gotServerPorts(const QString &bundlePath,
|
||||||
const QString &deviceId, int gdbPort)
|
const QString &deviceId, int gdbPort, int qmlPort)
|
||||||
{
|
{
|
||||||
emit q->gotGdbserverPort(q, bundlePath, deviceId, gdbPort);
|
emit q->gotServerPorts(q, bundlePath, deviceId, gdbPort, qmlPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosToolHandlerPrivate::gotInferiorPid(const QString &bundlePath, const QString &deviceId,
|
void IosToolHandlerPrivate::gotInferiorPid(const QString &bundlePath, const QString &deviceId,
|
||||||
@@ -439,8 +441,12 @@ void IosToolHandlerPrivate::processXml()
|
|||||||
stack.append(ParserState(ParserState::DeviceInfo));
|
stack.append(ParserState(ParserState::DeviceInfo));
|
||||||
} else if (elName == QLatin1String("inferior_pid")) {
|
} else if (elName == QLatin1String("inferior_pid")) {
|
||||||
stack.append(ParserState(ParserState::InferiorPid));
|
stack.append(ParserState(ParserState::InferiorPid));
|
||||||
} else if (elName == QLatin1String("gdb_server_port")) {
|
} else if (elName == QLatin1String("server_ports")) {
|
||||||
stack.append(ParserState(ParserState::GdbServerPort));
|
stack.append(ParserState(ParserState::ServerPorts));
|
||||||
|
QXmlStreamAttributes attributes = outputParser.attributes();
|
||||||
|
int gdbServerPort = attributes.value(QLatin1String("gdb_server")).toString().toInt();
|
||||||
|
int qmlServerPort = attributes.value(QLatin1String("qml_server")).toString().toInt();
|
||||||
|
gotServerPorts(bundlePath, deviceId, gdbServerPort, qmlServerPort);
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "unexpected element " << elName;
|
qDebug() << "unexpected element " << elName;
|
||||||
}
|
}
|
||||||
@@ -494,8 +500,7 @@ void IosToolHandlerPrivate::processXml()
|
|||||||
case ParserState::InferiorPid:
|
case ParserState::InferiorPid:
|
||||||
gotInferiorPid(bundlePath, deviceId, Q_PID(p.chars.toInt()));
|
gotInferiorPid(bundlePath, deviceId, Q_PID(p.chars.toInt()));
|
||||||
break;
|
break;
|
||||||
case ParserState::GdbServerPort:
|
case ParserState::ServerPorts:
|
||||||
gotGdbserverPort(bundlePath, deviceId, p.chars.toInt());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ signals:
|
|||||||
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
||||||
void didStartApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void didStartApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
||||||
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
||||||
void gotGdbserverPort(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void gotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath,
|
||||||
const QString &deviceId, int gdbPort);
|
const QString &deviceId, int gdbPort, int qmlPort);
|
||||||
void gotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void gotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
||||||
const QString &deviceId, Q_PID pid);
|
const QString &deviceId, Q_PID pid);
|
||||||
void deviceInfo(Ios::IosToolHandler *handler, const QString &deviceId,
|
void deviceInfo(Ios::IosToolHandler *handler, const QString &deviceId,
|
||||||
|
|||||||
Reference in New Issue
Block a user