forked from qt-creator/qt-creator
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:
@@ -416,12 +416,8 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
|
|||||||
QString event(value.findChild("event").toVariant().toString());
|
QString event(value.findChild("event").toVariant().toString());
|
||||||
|
|
||||||
if (event == "break") {
|
if (event == "break") {
|
||||||
//Check if this break is due to a breakpoint
|
d->engine->inferiorSpontaneousStop();
|
||||||
QList<QVariant> breakpoints = value.findChild("body").findChild("breakpoints").toVariant().toList();
|
listBreakpoints();
|
||||||
if (breakpoints.count()) {
|
|
||||||
d->engine->inferiorSpontaneousStop();
|
|
||||||
listBreakpoints();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -577,7 +573,6 @@ void QmlV8DebuggerClient::updateBreakpoints(QByteArray &message)
|
|||||||
{
|
{
|
||||||
JsonValue response(message);
|
JsonValue response(message);
|
||||||
|
|
||||||
JsonValue refs = response.findChild("refs");
|
|
||||||
JsonValue body = response.findChild("body");
|
JsonValue body = response.findChild("body");
|
||||||
|
|
||||||
QList<JsonValue> breakpoints = body.findChild("breakpoints").children();
|
QList<JsonValue> breakpoints = body.findChild("breakpoints").children();
|
||||||
|
@@ -218,10 +218,6 @@ void QScriptDebuggerClient::insertBreakpoint(BreakpointModelId id)
|
|||||||
bp.lineNumber = handler->lineNumber(id);
|
bp.lineNumber = handler->lineNumber(id);
|
||||||
bp.functionName = handler->functionName(id).toUtf8();
|
bp.functionName = handler->functionName(id).toUtf8();
|
||||||
d->breakpoints.insert(bp);
|
d->breakpoints.insert(bp);
|
||||||
|
|
||||||
if (handler->state(id) == BreakpointInsertProceeding) {
|
|
||||||
handler->notifyBreakpointInsertOk(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QScriptDebuggerClient::removeBreakpoint(BreakpointModelId id)
|
void QScriptDebuggerClient::removeBreakpoint(BreakpointModelId id)
|
||||||
@@ -412,6 +408,9 @@ 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,/**/);
|
||||||
BreakpointResponse br = handler->response(id);
|
BreakpointResponse br = handler->response(id);
|
||||||
|
Reference in New Issue
Block a user