Commit 07f10a02 authored by Aurindam Jana's avatar Aurindam Jana

QmlEngine: Connect to port for remote setup

In the case of remote setup, the application output
may take a while. The timeout is increased to 60s.
Additionally in the case of mixed debugging, we check
the state of the master engine to determine if we should
keep waiting for the application output.

Change-Id: I237a3501c1e70dbe62870929e50f12ede80e7c56
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent 2af60cb1
......@@ -403,10 +403,19 @@ void QmlEngine::tryToConnect(quint16 port)
{
showMessage(QLatin1String("QML Debugger: No application output received in time, trying to connect ..."), LogStatus);
m_retryOnConnectFail = true;
if (state() == EngineRunRequested)
beginConnection(port);
else
if (state() == EngineRunRequested) {
if (isSlaveEngine()) {
// Probably cpp is being debugged and hence we did not get the output yet.
if (!masterEngine()->isDying())
m_noDebugOutputTimer.start();
else
appStartupFailed(tr("No application output received in time"));
} else {
beginConnection(port);
}
} else {
m_automaticConnect = true;
}
}
void QmlEngine::beginConnection(quint16 port)
......@@ -625,6 +634,12 @@ void QmlEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
notifyEngineRemoteSetupDone();
notifyEngineSetupOk();
// 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 m_outputParser will start the connection.
m_noDebugOutputTimer.setInterval(60000);
}
void QmlEngine::handleRemoteSetupFailed(const QString &message)
......@@ -1061,6 +1076,14 @@ bool QmlEngine::hasCapability(unsigned cap) const
| AddWatcherCapability;*/
}
void QmlEngine::quitDebugger()
{
m_noDebugOutputTimer.stop();
m_automaticConnect = false;
m_retryOnConnectFail = false;
DebuggerEngine::quitDebugger();
}
void QmlEngine::inferiorSpontaneousStop()
{
if (state() == InferiorRunOk)
......
......@@ -169,6 +169,7 @@ private:
bool evaluateScriptExpression(const QString &expression);
bool hasCapability(unsigned) const;
void quitDebugger();
private:
void closeConnection();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment