Commit daac0787 authored by Kai Koehne's avatar Kai Koehne

QmlCppEngine: Properly handle requestRemoteSetupCalls

Remember which engines called requestRemoteSetup.

Change-Id: I75d11a21f0ebcbce1bba0aa4f653d1cc35b43483
Reviewed-by: default avatarAurindam Jana <aurindam.jana@nokia.com>
Reviewed-by: default avatarhjk <qthjk@ovi.com>
Reviewed-by: default avatarChristiaan Janssen <christiaan.janssen@nokia.com>
parent 73464a1d
......@@ -92,6 +92,7 @@ private:
QmlEngine *m_qmlEngine;
DebuggerEngine *m_cppEngine;
DebuggerEngine *m_activeEngine;
QList<DebuggerEngine*> m_enginesAwaitingRemoteSetup;
int m_stackBoundary;
};
......@@ -154,8 +155,9 @@ QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp,
connect(d->m_qmlEngine->stackHandler(), SIGNAL(stackChanged()),
d, SLOT(qmlStackChanged()), Qt::QueuedConnection);
connect(d->m_cppEngine, SIGNAL(stackFrameCompleted()), this, SIGNAL(stackFrameCompleted()));
connect(d->m_cppEngine, SIGNAL(requestRemoteSetup()), this, SIGNAL(requestRemoteSetup()));
connect(d->m_qmlEngine, SIGNAL(stackFrameCompleted()), this, SIGNAL(stackFrameCompleted()));
connect(d->m_cppEngine, SIGNAL(requestRemoteSetup()), this, SLOT(slaveEngineRequestedRemoteSetup()));
connect(d->m_qmlEngine, SIGNAL(requestRemoteSetup()), this, SLOT(slaveEngineRequestedRemoteSetup()));
}
QmlCppEngine::~QmlCppEngine()
......@@ -462,6 +464,19 @@ void QmlCppEngine::notifyInferiorShutdownOk()
DebuggerEngine::notifyInferiorShutdownOk();
}
void QmlCppEngine::slaveEngineRequestedRemoteSetup()
{
DebuggerEngine *slaveEngine = qobject_cast<DebuggerEngine*>(sender());
QTC_ASSERT(slaveEngine, return);
bool emitRequest = d->m_enginesAwaitingRemoteSetup.isEmpty();
d->m_enginesAwaitingRemoteSetup << slaveEngine;
if (emitRequest) {
emit requestRemoteSetup();
}
}
void QmlCppEngine::setupInferior()
{
EDEBUG("\nMASTER SETUP INFERIOR");
......@@ -659,15 +674,17 @@ void QmlCppEngine::slaveEngineStateChanged
void QmlCppEngine::handleRemoteSetupDone(int gdbServerPort, int qmlPort)
{
EDEBUG("MASTER REMOTE SETUP DONE");
d->m_qmlEngine->startParameters().qmlServerPort = qmlPort;
d->m_cppEngine->handleRemoteSetupDone(gdbServerPort, qmlPort);
foreach (DebuggerEngine *slaveEngine, d->m_enginesAwaitingRemoteSetup)
slaveEngine->handleRemoteSetupDone(gdbServerPort, qmlPort);
d->m_enginesAwaitingRemoteSetup.clear();
}
void QmlCppEngine::handleRemoteSetupFailed(const QString &message)
{
EDEBUG("MASTER REMOTE SETUP FAILED");
d->m_qmlEngine->handleRemoteSetupFailed(message);
d->m_cppEngine->handleRemoteSetupFailed(message);
foreach (DebuggerEngine *slaveEngine, d->m_enginesAwaitingRemoteSetup)
slaveEngine->handleRemoteSetupFailed(message);
d->m_enginesAwaitingRemoteSetup.clear();
}
void QmlCppEngine::showMessage(const QString &msg, int channel, int timeout) const
......
......@@ -124,6 +124,9 @@ protected:
void notifyEngineRunAndInferiorRunOk();
void notifyInferiorShutdownOk();
private slots:
void slaveEngineRequestedRemoteSetup();
private:
void engineStateChanged(DebuggerState newState);
void setState(DebuggerState newState, bool forced = false);
......
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