forked from qt-creator/qt-creator
Debugger: Client Service synchronization
Sends connect command after all initial commands have been sent. This ensures that the initialization is complete before the start of the debugging session. Change-Id: I1903caa9c213fef4e6b40df89a352d80e350a46d Reviewed-on: http://codereview.qt.nokia.com/3526 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
@@ -170,8 +170,8 @@ 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();
|
||||||
|
d->m_qmlClient->startSession();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,8 +52,8 @@ public:
|
|||||||
QmlDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection* client, QLatin1String clientName);
|
QmlDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection* client, QLatin1String clientName);
|
||||||
virtual ~QmlDebuggerClient();
|
virtual ~QmlDebuggerClient();
|
||||||
|
|
||||||
virtual void connect() = 0;
|
virtual void startSession() = 0;
|
||||||
virtual void disconnect() = 0;
|
virtual void endSession() = 0;
|
||||||
|
|
||||||
virtual void executeStep() = 0;
|
virtual void executeStep() = 0;
|
||||||
virtual void executeStepOut() = 0;
|
virtual void executeStepOut() = 0;
|
||||||
|
@@ -375,7 +375,7 @@ void QmlEngine::handleRemoteSetupFailed(const QString &message)
|
|||||||
|
|
||||||
void QmlEngine::shutdownInferior()
|
void QmlEngine::shutdownInferior()
|
||||||
{
|
{
|
||||||
d->m_adapter.activeDebuggerClient()->disconnect();
|
d->m_adapter.activeDebuggerClient()->endSession();
|
||||||
|
|
||||||
if (isSlaveEngine()) {
|
if (isSlaveEngine()) {
|
||||||
resetLocation();
|
resetLocation();
|
||||||
|
@@ -192,7 +192,7 @@ void QmlV8DebuggerClient::interruptInferior()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlV8DebuggerClient::connect()
|
void QmlV8DebuggerClient::startSession()
|
||||||
{
|
{
|
||||||
QByteArray request;
|
QByteArray request;
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ void QmlV8DebuggerClient::connect()
|
|||||||
sendMessage(packMessage(request));
|
sendMessage(packMessage(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlV8DebuggerClient::disconnect()
|
void QmlV8DebuggerClient::endSession()
|
||||||
{
|
{
|
||||||
QByteArray request;
|
QByteArray request;
|
||||||
|
|
||||||
|
@@ -52,8 +52,8 @@ public:
|
|||||||
explicit QmlV8DebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
explicit QmlV8DebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
||||||
~QmlV8DebuggerClient();
|
~QmlV8DebuggerClient();
|
||||||
|
|
||||||
void connect();
|
void startSession();
|
||||||
void disconnect();
|
void endSession();
|
||||||
|
|
||||||
void executeStep();
|
void executeStep();
|
||||||
void executeStepOut();
|
void executeStepOut();
|
||||||
|
@@ -192,11 +192,17 @@ void QScriptDebuggerClient::interruptInferior()
|
|||||||
sendMessage(reply);
|
sendMessage(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QScriptDebuggerClient::connect()
|
void QScriptDebuggerClient::startSession()
|
||||||
{
|
{
|
||||||
|
//Set all breakpoints
|
||||||
|
BreakHandler *handler = d->engine->breakHandler();
|
||||||
|
foreach (BreakpointModelId id, handler->engineBreakpointIds(d->engine)) {
|
||||||
|
QTC_ASSERT(handler->state(id) == BreakpointInsertProceeding,/**/);
|
||||||
|
handler->notifyBreakpointInsertOk(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QScriptDebuggerClient::disconnect()
|
void QScriptDebuggerClient::endSession()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,8 +414,6 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
|
|||||||
BreakHandler *handler = d->engine->breakHandler();
|
BreakHandler *handler = d->engine->breakHandler();
|
||||||
foreach (BreakpointModelId id, handler->engineBreakpointIds(d->engine)) {
|
foreach (BreakpointModelId id, handler->engineBreakpointIds(d->engine)) {
|
||||||
QString processedFilename = handler->fileName(id);
|
QString processedFilename = handler->fileName(id);
|
||||||
QTC_ASSERT(handler->state(id) == BreakpointInsertProceeding,/**/);
|
|
||||||
handler->notifyBreakpointInsertOk(id);
|
|
||||||
|
|
||||||
if (processedFilename == file && handler->lineNumber(id) == line) {
|
if (processedFilename == file && handler->lineNumber(id) == line) {
|
||||||
QTC_ASSERT(handler->state(id) == BreakpointInserted,/**/);
|
QTC_ASSERT(handler->state(id) == BreakpointInserted,/**/);
|
||||||
|
@@ -51,8 +51,8 @@ public:
|
|||||||
QScriptDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
QScriptDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
|
||||||
~QScriptDebuggerClient();
|
~QScriptDebuggerClient();
|
||||||
|
|
||||||
void connect();
|
void startSession();
|
||||||
void disconnect();
|
void endSession();
|
||||||
|
|
||||||
void executeStep();
|
void executeStep();
|
||||||
void executeStepOut();
|
void executeStepOut();
|
||||||
|
Reference in New Issue
Block a user