diff options
author | Ulf Hermann <[email protected]> | 2015-08-10 17:43:58 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2015-08-17 15:13:56 +0000 |
commit | 5f90990c308e2deddc3f9491262e354477ebe5f4 (patch) | |
tree | 65f7524332bc61168836ebf16fd5d84dc4deb083 /src/plugins/android/androidrunner.cpp | |
parent | be31022276ced789d3a0ea2fb373a63a5921e157 (diff) |
Tell the QML debug server exactly what services we expect
The services need to be loaded before the first QML engine is created.
The first QML engine may be created before a client connects. When the
JavaScript debug service is loaded the engine is put into interpreter
mode as we don't support debugging in JIT mode. Profiling, however
should be done in JIT mode, whenever possible.
Thus, in order to avoid the loading of unnecessary plugins and to get
better results from the QML profiler we tell the debug server which
services we expect, even before the client connects. Qt 5.6 will support
additional command line arguments to specify the services and this
change uses them.
Change-Id: I6dcee016c39995e9adada6eaf0e39d8299c9b7e7
Reviewed-by: Christian Kandeler <[email protected]>
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/android/androidrunner.cpp')
-rw-r--r-- | src/plugins/android/androidrunner.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp index 7dcd549e63c..d1d0a8b2e6e 100644 --- a/src/plugins/android/androidrunner.cpp +++ b/src/plugins/android/androidrunner.cpp @@ -134,13 +134,17 @@ AndroidRunner::AndroidRunner(QObject *parent, = runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>(); const bool debuggingMode = (runMode == ProjectExplorer::Constants::DEBUG_RUN_MODE || runMode == ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN); m_useCppDebugger = debuggingMode && aspect->useCppDebugger(); - m_useQmlDebugger = debuggingMode && aspect->useQmlDebugger(); + if (debuggingMode && aspect->useQmlDebugger()) + m_qmlDebugServices = QmlDebug::QmlDebuggerServices; + else if (runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) + m_qmlDebugServices = QmlDebug::QmlProfilerServices; + else + m_qmlDebugServices = QmlDebug::NoQmlDebugServices; QString channel = runConfig->remoteChannel(); QTC_CHECK(channel.startsWith(QLatin1Char(':'))); m_localGdbServerPort = channel.mid(1).toUShort(); QTC_CHECK(m_localGdbServerPort); - m_useQmlProfiler = runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE; - if (m_useQmlDebugger || m_useQmlProfiler) { + if (m_qmlDebugServices != QmlDebug::NoQmlDebugServices) { QTcpServer server; QTC_ASSERT(server.listen(QHostAddress::LocalHost) || server.listen(QHostAddress::LocalHostIPv6), @@ -289,12 +293,12 @@ void AndroidRunner::checkPID() // gdb. Afterwards this ends up in handleRemoteDebuggerRunning() below. QByteArray serverChannel = ':' + QByteArray::number(m_localGdbServerPort); emit remoteServerRunning(serverChannel, m_processPID); - } else if (m_useQmlDebugger) { + } else if (m_qmlDebugServices == QmlDebug::QmlDebuggerServices) { // This will be funneled to the engine to actually start and attach // gdb. Afterwards this ends up in handleRemoteDebuggerRunning() below. QByteArray serverChannel = QByteArray::number(m_qmlPort); emit remoteServerRunning(serverChannel, m_processPID); - } else if (m_useQmlProfiler) { + } else if (m_qmlDebugServices == QmlDebug::QmlProfilerServices) { emit remoteProcessStarted(-1, m_qmlPort); } else { // Start without debugging. @@ -389,7 +393,7 @@ void AndroidRunner::asyncStart() } } - if (m_useQmlDebugger || m_useQmlProfiler) { + if (m_qmlDebugServices != QmlDebug::NoQmlDebugServices) { // currently forward to same port on device and host const QString port = QString::fromLatin1("tcp:%1").arg(m_qmlPort); QProcess adb; @@ -402,8 +406,11 @@ void AndroidRunner::asyncStart() emit remoteProcessFinished(tr("Failed to forward QML debugging ports.")); return; } - args << _("-e") << _("qml_debug") << _("true"); - args << _("-e") << _("qmljsdebugger") << QString::fromLatin1("port:%1,block").arg(m_qmlPort); + + args << _("-e") << _("qml_debug") << _("true") + << _("-e") << _("qmljsdebugger") + << QString::fromLatin1("port:%1,block,services:%2") + .arg(m_qmlPort).arg(QmlDebug::qmlDebugServices(m_qmlDebugServices)); } QProcess adb; |