forked from qt-creator/qt-creator
Ios: Re-enable QmlProfiler
Change-Id: I55a102c8f3a0c748b483a2fa36aa51947d13764a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -182,8 +182,7 @@ RunControl *IosRunControlFactory::create(RunConfiguration *runConfig,
|
||||
if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) {
|
||||
(void) new Ios::Internal::IosRunSupport(runControl);
|
||||
} else if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
||||
runControl->createWorker(mode);
|
||||
(void) new IosAnalyzeSupport(runControl);
|
||||
(void) new IosQmlProfilerSupport(runControl);
|
||||
} else {
|
||||
(void) new IosDebugSupport(runControl);
|
||||
}
|
||||
|
@@ -357,48 +357,44 @@ void IosRunSupport::stop()
|
||||
}
|
||||
|
||||
//
|
||||
// IosAnalyzeSupport
|
||||
// IosQmlProfilerSupport
|
||||
//
|
||||
|
||||
IosAnalyzeSupport::IosAnalyzeSupport(RunControl *runControl)
|
||||
: IosRunner(runControl)
|
||||
IosQmlProfilerSupport::IosQmlProfilerSupport(RunControl *runControl)
|
||||
: RunWorker(runControl)
|
||||
{
|
||||
m_runner = new IosRunner(runControl);
|
||||
addDependency(m_runner);
|
||||
|
||||
setDisplayName("IosAnalyzeSupport");
|
||||
setQmlDebugging(QmlDebug::QmlProfilerServices);
|
||||
|
||||
auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
|
||||
StandardRunnable runnable;
|
||||
runnable.executable = iosRunConfig->localExecutable().toUserOutput();
|
||||
runnable.commandLineArguments = iosRunConfig->commandLineArguments();
|
||||
runControl->setRunnable(runnable);
|
||||
runControl->setConnection(UrlConnection::localHostWithoutPort());
|
||||
runControl->setDisplayName(iosRunConfig->applicationName());
|
||||
runControl->setRunnable(runnable);
|
||||
|
||||
connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
|
||||
this, &IosAnalyzeSupport::qmlServerReady);
|
||||
m_runner = new IosRunner(runControl);
|
||||
m_runner->setQmlDebugging(QmlDebug::QmlProfilerServices);
|
||||
addDependency(m_runner);
|
||||
|
||||
m_profiler = runControl->createWorker(runControl->runMode());
|
||||
m_profiler->addDependency(this);
|
||||
}
|
||||
|
||||
void IosAnalyzeSupport::start()
|
||||
void IosQmlProfilerSupport::start()
|
||||
{
|
||||
// Use m_runner->qmlServerPort() // FIXME
|
||||
}
|
||||
UrlConnection serverUrl;
|
||||
QTcpServer server;
|
||||
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|
||||
|| server.listen(QHostAddress::LocalHostIPv6), return);
|
||||
serverUrl.setHost(server.serverAddress().toString());
|
||||
|
||||
void IosAnalyzeSupport::qmlServerReady()
|
||||
{
|
||||
// runControl()->notifyRemoteSetupDone(m_qmlServerPort);
|
||||
}
|
||||
|
||||
void IosAnalyzeSupport::appOutput(const QString &output)
|
||||
{
|
||||
m_outputParser.processOutput(output);
|
||||
}
|
||||
|
||||
void IosAnalyzeSupport::errorMsg(const QString &output)
|
||||
{
|
||||
m_outputParser.processOutput(output);
|
||||
Port qmlPort = m_runner->qmlServerPort();
|
||||
serverUrl.setPort(qmlPort.number());
|
||||
m_profiler->recordData("QmlServerUrl", serverUrl);
|
||||
if (qmlPort.isValid())
|
||||
reportStarted();
|
||||
else
|
||||
reportFailure(tr("Could not get necessary ports for the profiler connection."));
|
||||
}
|
||||
|
||||
//
|
||||
|
@@ -65,6 +65,7 @@ public:
|
||||
|
||||
virtual void appOutput(const QString &/*output*/) {}
|
||||
virtual void errorMsg(const QString &/*msg*/) {}
|
||||
virtual void onStart() { reportStarted(); }
|
||||
|
||||
Utils::Port qmlServerPort() const;
|
||||
Utils::Port gdbServerPort() const;
|
||||
@@ -111,22 +112,17 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class IosAnalyzeSupport : public IosRunner
|
||||
class IosQmlProfilerSupport : public ProjectExplorer::RunWorker
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
IosAnalyzeSupport(ProjectExplorer::RunControl *runControl);
|
||||
IosQmlProfilerSupport(ProjectExplorer::RunControl *runControl);
|
||||
|
||||
private:
|
||||
void start() override;
|
||||
|
||||
void qmlServerReady();
|
||||
void appOutput(const QString &output) override;
|
||||
void errorMsg(const QString &output) override;
|
||||
|
||||
QmlDebug::QmlOutputParser m_outputParser;
|
||||
IosRunner *m_runner;
|
||||
IosRunner *m_runner = nullptr;
|
||||
ProjectExplorer::RunWorker *m_profiler = nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user