Debugger: Remove remote setup sub-statemachinery

Not needed anymore in the world of RunWorkers.

Change-Id: Id7fb24fece6acb03de12f2677dd99a05c513e7a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
hjk
2017-06-13 08:49:18 +02:00
parent 107df0a7c1
commit ffc97df7a6
15 changed files with 47 additions and 331 deletions

View File

@@ -376,9 +376,6 @@ void QmlCppEngine::setupEngine()
m_activeEngine = m_cppEngine;
m_qmlEngine->setupSlaveEngine();
m_cppEngine->setupSlaveEngine();
if (runParameters().remoteSetupNeeded)
notifyEngineRequestRemoteSetup();
}
void QmlCppEngine::notifyEngineRunAndInferiorRunOk()
@@ -411,11 +408,6 @@ void QmlCppEngine::notifyInferiorSetupOk()
DebuggerEngine::notifyInferiorSetupOk();
}
void QmlCppEngine::notifyEngineRemoteServerRunning(const QString &serverChannel, int pid)
{
m_cppEngine->notifyEngineRemoteServerRunning(serverChannel, pid);
}
void QmlCppEngine::setupInferior()
{
EDEBUG("\nMASTER SETUP INFERIOR");
@@ -723,15 +715,6 @@ void QmlCppEngine::slaveEngineStateChanged
}
}
void QmlCppEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
{
EDEBUG("MASTER REMOTE SETUP FINISHED");
DebuggerEngine::notifyEngineRemoteSetupFinished(result);
cppEngine()->notifyEngineRemoteSetupFinished(result);
qmlEngine()->notifyEngineRemoteSetupFinished(result);
}
void QmlCppEngine::resetLocation()
{
if (m_qmlEngine)

View File

@@ -83,7 +83,6 @@ public:
DebuggerEngine *activeEngine() override { return m_activeEngine; }
void setRunTool(DebuggerRunTool *runTool) override;
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
void resetLocation() override;
void notifyInferiorIll() override;
@@ -121,7 +120,6 @@ protected:
void notifyInferiorShutdownOk() override;
void notifyInferiorSetupOk() override;
void notifyEngineRemoteServerRunning(const QString &, int pid) override;
void loadAdditionalQmlStack() override;
private:

View File

@@ -593,65 +593,38 @@ void QmlEngine::stopApplicationLauncher()
}
}
void QmlEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &result)
{
QObject::disconnect(d->startupMessageFilterConnection);
DebuggerEngine::notifyEngineRemoteSetupFinished(result);
// FIXME: Is the timeout raise still needed? Since the RunWorker conversion,
// the debugger tool only starts when the remote setup has all interesting
// ports gathered, so much less chance for waiting on longer operations.
//void QmlEngine::notifyEngineRemoteSetupFinished()
//{
// QObject::disconnect(d->startupMessageFilterConnection);
// switch (state()) {
// case InferiorSetupOk:
// // FIXME: This is not a legal transition, but we need to
// // get to EngineSetupOk somehow from InferiorSetupOk.
// // fallthrough. QTCREATORBUG-14089.
// case EngineSetupRequested:
// notifyEngineSetupOk();
// break;
// case EngineSetupOk:
// case EngineRunRequested:
// // QTCREATORBUG-17718: On Android while doing debugging in mixed mode, the QML debug engine
// // sometimes reports EngineSetupOK after the EngineRunRequested thus overwriting the state
// // which eventually results into app to waiting for the QML engine connection.
// // Skipping the EngineSetupOK in aforementioned case.
// // Nothing to do here. The setup is already done.
// break;
// default:
// QTC_ASSERT(false, qDebug() << "Unexpected state" << state());
// }
if (result.success) {
if (result.qmlServerPort.isValid())
runParameters().qmlServer.port = result.qmlServerPort;
switch (state()) {
case InferiorSetupOk:
// FIXME: This is not a legal transition, but we need to
// get to EngineSetupOk somehow from InferiorSetupOk.
// fallthrough. QTCREATORBUG-14089.
case EngineSetupRequested:
notifyEngineSetupOk();
break;
case EngineSetupOk:
case EngineRunRequested:
// QTCREATORBUG-17718: On Android while doing debugging in mixed mode, the QML debug engine
// sometimes reports EngineSetupOK after the EngineRunRequested thus overwriting the state
// which eventually results into app to waiting for the QML engine connection.
// Skipping the EngineSetupOK in aforementioned case.
// Nothing to do here. The setup is already done.
break;
default:
QTC_ASSERT(false, qDebug() << "Unexpected state" << state());
}
// The remote setup can take while especialy with mixed debugging.
// Just waiting for 8 seconds is not enough. Increase the timeout
// to 60 s
// In case we get an output the d->outputParser will start the connection.
d->noDebugOutputTimer.setInterval(60000);
} else {
if (isMasterEngine())
QMessageBox::critical(ICore::dialogParent(), tr("Failed to start application"),
tr("Application startup failed: %1").arg(result.reason));
notifyEngineSetupFailed();
}
}
void QmlEngine::notifyEngineRemoteServerRunning(const QString &serverChannel, int pid)
{
bool ok = false;
quint16 qmlPort = serverChannel.toUInt(&ok);
if (ok)
runParameters().qmlServer.port = Utils::Port(qmlPort);
else
qWarning() << tr("QML debugging port not set: Unable to convert %1 to unsigned int.").arg(serverChannel);
DebuggerEngine::notifyEngineRemoteServerRunning(serverChannel, pid);
notifyEngineSetupOk();
// The remote setup can take a while especially with mixed debugging.
// Just waiting for 8 seconds is not enough. Increase the timeout to 60 s.
// In case we get an output the d->outputParser will start the connection.
d->noDebugOutputTimer.setInterval(60000);
}
// // The remote setup can take while especialy with mixed debugging.
// // Just waiting for 8 seconds is not enough. Increase the timeout
// // to 60 s
// // In case we get an output the d->outputParser will start the connection.
// d->noDebugOutputTimer.setInterval(60000);
//}
void QmlEngine::shutdownInferior()
{
@@ -687,12 +660,7 @@ void QmlEngine::shutdownEngine()
void QmlEngine::setupEngine()
{
if (runParameters().remoteSetupNeeded) {
// we need to get the port first
notifyEngineRequestRemoteSetup();
} else {
notifyEngineSetupOk();
}
notifyEngineSetupOk();
}
void QmlEngine::continueInferior()

View File

@@ -69,9 +69,6 @@ private:
void setState(DebuggerState state, bool forced) override;
void notifyEngineRemoteServerRunning(const QString &, int pid) override;
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result) override;
void gotoLocation(const Internal::Location &location) override;
void insertBreakpoint(Breakpoint bp) override;