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>
if (status == QDeclarativeDebugClient::Enabled) {
d->m_qmlClient = d->debugClients.value(serviceName);
- d->m_qmlClient->connect();
d->m_qmlClient->flushSendBuffer();
+ d->m_qmlClient->startSession();
}
}
QmlDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection* client, QLatin1String clientName);
virtual ~QmlDebuggerClient();
- virtual void connect() = 0;
- virtual void disconnect() = 0;
+ virtual void startSession() = 0;
+ virtual void endSession() = 0;
virtual void executeStep() = 0;
virtual void executeStepOut() = 0;
void QmlEngine::shutdownInferior()
{
- d->m_adapter.activeDebuggerClient()->disconnect();
+ d->m_adapter.activeDebuggerClient()->endSession();
if (isSlaveEngine()) {
resetLocation();
}
-void QmlV8DebuggerClient::connect()
+void QmlV8DebuggerClient::startSession()
{
QByteArray request;
sendMessage(packMessage(request));
}
-void QmlV8DebuggerClient::disconnect()
+void QmlV8DebuggerClient::endSession()
{
QByteArray request;
explicit QmlV8DebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
~QmlV8DebuggerClient();
- void connect();
- void disconnect();
+ void startSession();
+ void endSession();
void executeStep();
void executeStepOut();
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()
{
}
BreakHandler *handler = d->engine->breakHandler();
foreach (BreakpointModelId id, handler->engineBreakpointIds(d->engine)) {
QString processedFilename = handler->fileName(id);
- QTC_ASSERT(handler->state(id) == BreakpointInsertProceeding,/**/);
- handler->notifyBreakpointInsertOk(id);
if (processedFilename == file && handler->lineNumber(id) == line) {
QTC_ASSERT(handler->state(id) == BreakpointInserted,/**/);
QScriptDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection *client);
~QScriptDebuggerClient();
- void connect();
- void disconnect();
+ void startSession();
+ void endSession();
void executeStep();
void executeStepOut();