Debugger: Set breakpoints on actual locations in code

This fix sets moves breakpoints on commented lines to the next executable line.

Change-Id: Ie9ca8a7c6e0360ce4a916053ef7aedd1cc28484d
Reviewed-on: http://codereview.qt.nokia.com/3525
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
Aurindam Jana
2011-08-24 17:32:12 +02:00
parent e3849b5ebd
commit 21e50d82df
2 changed files with 5 additions and 11 deletions

View File

@@ -416,15 +416,11 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
QString event(value.findChild("event").toVariant().toString());
if (event == "break") {
//Check if this break is due to a breakpoint
QList<QVariant> breakpoints = value.findChild("body").findChild("breakpoints").toVariant().toList();
if (breakpoints.count()) {
d->engine->inferiorSpontaneousStop();
listBreakpoints();
}
}
}
}
}
void QmlV8DebuggerClient::setStackFrames(QByteArray &message)
@@ -577,7 +573,6 @@ void QmlV8DebuggerClient::updateBreakpoints(QByteArray &message)
{
JsonValue response(message);
JsonValue refs = response.findChild("refs");
JsonValue body = response.findChild("body");
QList<JsonValue> breakpoints = body.findChild("breakpoints").children();

View File

@@ -218,10 +218,6 @@ void QScriptDebuggerClient::insertBreakpoint(BreakpointModelId id)
bp.lineNumber = handler->lineNumber(id);
bp.functionName = handler->functionName(id).toUtf8();
d->breakpoints.insert(bp);
if (handler->state(id) == BreakpointInsertProceeding) {
handler->notifyBreakpointInsertOk(id);
}
}
void QScriptDebuggerClient::removeBreakpoint(BreakpointModelId id)
@@ -412,6 +408,9 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
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,/**/);
BreakpointResponse br = handler->response(id);