forked from qt-creator/qt-creator
Synchronize the client with the debug service
The v8 engine is blocked till the client is connected to the service to ensure proper hitting of breakpoints. Task-number: QTCREATORBUG-5412 Change-Id: Iec772cb547a31fef4cccbd4bb1116699c52d20e5 Reviewed-on: http://codereview.qt.nokia.com/3308 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -170,6 +170,7 @@ void QmlAdapter::clientStatusChanged(QDeclarativeDebugClient::Status status)
|
|||||||
|
|
||||||
if (status == QDeclarativeDebugClient::Enabled) {
|
if (status == QDeclarativeDebugClient::Enabled) {
|
||||||
d->m_qmlClient = d->debugClients.value(serviceName);
|
d->m_qmlClient = d->debugClients.value(serviceName);
|
||||||
|
d->m_qmlClient->connect();
|
||||||
d->m_qmlClient->flushSendBuffer();
|
d->m_qmlClient->flushSendBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -52,6 +52,9 @@ public:
|
|||||||
QmlDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection* client, QLatin1String clientName);
|
QmlDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection* client, QLatin1String clientName);
|
||||||
virtual ~QmlDebuggerClient();
|
virtual ~QmlDebuggerClient();
|
||||||
|
|
||||||
|
virtual void connect() = 0;
|
||||||
|
virtual void disconnect() = 0;
|
||||||
|
|
||||||
virtual void executeStep() = 0;
|
virtual void executeStep() = 0;
|
||||||
virtual void executeStepOut() = 0;
|
virtual void executeStepOut() = 0;
|
||||||
virtual void executeNext() = 0;
|
virtual void executeNext() = 0;
|
||||||
@@ -59,7 +62,6 @@ public:
|
|||||||
|
|
||||||
virtual void continueInferior() = 0;
|
virtual void continueInferior() = 0;
|
||||||
virtual void interruptInferior() = 0;
|
virtual void interruptInferior() = 0;
|
||||||
virtual void shutdownInferior() = 0;
|
|
||||||
|
|
||||||
virtual void activateFrame(int index) = 0;
|
virtual void activateFrame(int index) = 0;
|
||||||
|
|
||||||
|
@@ -375,7 +375,7 @@ void QmlEngine::handleRemoteSetupFailed(const QString &message)
|
|||||||
|
|
||||||
void QmlEngine::shutdownInferior()
|
void QmlEngine::shutdownInferior()
|
||||||
{
|
{
|
||||||
d->m_adapter.activeDebuggerClient()->shutdownInferior();
|
d->m_adapter.activeDebuggerClient()->disconnect();
|
||||||
|
|
||||||
if (isSlaveEngine()) {
|
if (isSlaveEngine()) {
|
||||||
resetLocation();
|
resetLocation();
|
||||||
|
@@ -192,7 +192,19 @@ void QmlV8DebuggerClient::interruptInferior()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlV8DebuggerClient::shutdownInferior()
|
void QmlV8DebuggerClient::connect()
|
||||||
|
{
|
||||||
|
QByteArray request;
|
||||||
|
|
||||||
|
JsonInputStream(request) << '{' << INITIALPARAMS ;
|
||||||
|
JsonInputStream(request) << ',' << "command" << ':' << "connect";
|
||||||
|
|
||||||
|
JsonInputStream(request) << '}';
|
||||||
|
|
||||||
|
sendMessage(packMessage(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QmlV8DebuggerClient::disconnect()
|
||||||
{
|
{
|
||||||
QByteArray request;
|
QByteArray request;
|
||||||
|
|
||||||
|
@@ -52,6 +52,9 @@ public:
|
|||||||
explicit QmlV8DebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
explicit QmlV8DebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
||||||
~QmlV8DebuggerClient();
|
~QmlV8DebuggerClient();
|
||||||
|
|
||||||
|
void connect();
|
||||||
|
void disconnect();
|
||||||
|
|
||||||
void executeStep();
|
void executeStep();
|
||||||
void executeStepOut();
|
void executeStepOut();
|
||||||
void executeNext();
|
void executeNext();
|
||||||
@@ -59,7 +62,6 @@ public:
|
|||||||
|
|
||||||
void continueInferior();
|
void continueInferior();
|
||||||
void interruptInferior();
|
void interruptInferior();
|
||||||
void shutdownInferior();
|
|
||||||
|
|
||||||
void activateFrame(int index);
|
void activateFrame(int index);
|
||||||
|
|
||||||
|
@@ -192,9 +192,12 @@ void QScriptDebuggerClient::interruptInferior()
|
|||||||
sendMessage(reply);
|
sendMessage(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QScriptDebuggerClient::shutdownInferior()
|
void QScriptDebuggerClient::connect()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QScriptDebuggerClient::disconnect()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void QScriptDebuggerClient::activateFrame(int index)
|
void QScriptDebuggerClient::activateFrame(int index)
|
||||||
|
@@ -51,6 +51,9 @@ public:
|
|||||||
QScriptDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
QScriptDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
||||||
~QScriptDebuggerClient();
|
~QScriptDebuggerClient();
|
||||||
|
|
||||||
|
void connect();
|
||||||
|
void disconnect();
|
||||||
|
|
||||||
void executeStep();
|
void executeStep();
|
||||||
void executeStepOut();
|
void executeStepOut();
|
||||||
void executeNext();
|
void executeNext();
|
||||||
@@ -58,7 +61,6 @@ public:
|
|||||||
|
|
||||||
void continueInferior();
|
void continueInferior();
|
||||||
void interruptInferior();
|
void interruptInferior();
|
||||||
void shutdownInferior();
|
|
||||||
|
|
||||||
void activateFrame(int index);
|
void activateFrame(int index);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user