From 41a66d7478ba2141775820902718a78ab303288a Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Wed, 14 Mar 2012 10:11:08 +0100 Subject: QmlV8DebuggerClient: Make breakpoint non-pending Make breakpoint non-pending when the breakpoint is accepted by the v8 debugger. Change-Id: Id67ce764ef6be9279d3fcc0f34734e5ac9541425 Reviewed-by: Kai Koehne --- src/plugins/debugger/qml/qmlv8debuggerclient.cpp | 29 ++++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/plugins/debugger/qml/qmlv8debuggerclient.cpp') diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp index 1ce9aa8ff7..9067ec08c3 100644 --- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp +++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp @@ -1310,13 +1310,22 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data) BreakpointModelId id = d->breakpointsSync.take(seq); d->breakpoints.insert(id, index); - BreakHandler *handler = d->engine->breakHandler(); - if (handler->state(id) != BreakpointInserted) { - BreakpointResponse br = handler->response(id); - br.lineNumber = breakpointData.value(_("line") - ).toInt() + 1; - handler->setResponse(id, br); - handler->notifyBreakpointInsertOk(id); + //Is actual position info present? Then breakpoint was + //accepted + const QVariantList actualLocations = + breakpointData.value( + _("actual_locations")).toList(); + if (actualLocations.count()) { + //The breakpoint requested line should be same as + //actual line + BreakHandler *handler = d->engine->breakHandler(); + if (handler->state(id) != BreakpointInserted) { + BreakpointResponse br = handler->response(id); + br.lineNumber = breakpointData.value(_("line") + ).toInt() + 1; + handler->setResponse(id, br); + handler->notifyBreakpointInsertOk(id); + } } @@ -1481,6 +1490,12 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data) br.functionName = invocationText; handler->setResponse(id, br); } + if (handler->state(id) != BreakpointInserted) { + br.lineNumber = breakData.value( + _("sourceLine")).toInt() + 1; + handler->setResponse(id, br); + handler->notifyBreakpointInsertOk(id); + } } } } -- cgit v1.2.1