QmlProfiler: Support local connections on Qt >= 5.6

This removes the need to receive messages from the application via
stderr. The "Connecting to socket" is still parsed, but only for
diagnostic purposes. If it doesn't arrive, the profiling will still
work.

Change-Id: I022691293da2a1e671ba1263bc76e4044bf1a5b7
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-11-17 16:42:21 +01:00
parent 2217eef3a3
commit 7b4e253a1e
11 changed files with 94 additions and 27 deletions

View File

@@ -44,6 +44,8 @@
#include <projectexplorer/project.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
#include <utils/qtcassert.h>
@@ -79,7 +81,19 @@ static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration
sp.debuggee = rc->executable();
sp.debuggeeArgs = rc->commandLineArguments();
sp.displayName = rc->displayName();
sp.analyzerPort = LocalQmlProfilerRunner::findFreePort(sp.analyzerHost);
const QtSupport::BaseQtVersion *version =
QtSupport::QtKitInformation::qtVersion(runConfiguration->target()->kit());
if (version) {
QtSupport::QtVersionNumber versionNumber = version->qtVersion();
if (versionNumber.majorVersion >= 5 && versionNumber.minorVersion >= 6)
sp.analyzerSocket = LocalQmlProfilerRunner::findFreeSocket();
else
sp.analyzerPort = LocalQmlProfilerRunner::findFreePort(sp.analyzerHost);
} else {
qWarning() << "Running QML profiler on Kit without Qt version??";
sp.analyzerPort = LocalQmlProfilerRunner::findFreePort(sp.analyzerHost);
}
return sp;
}