forked from qt-creator/qt-creator
Debugger: Fix breakpoint disabling and enabling in for QML
As QML currently does not expose a command to atomically enable or disable a breakpoint, we need to remove and re-insert it. The previous code scheduled the removal through a timer, and depending on if the timer hit before the insertion or after, the operation was successful or not. As the QML engine doesn't have to be in a specific state to insert and remove breakpoints, we can just directly send the messages instead and therefore be certain that they arrive in the right order. Task-number: QTCREATORBUG-20795 Change-Id: If69797b2c75e1107ad552f88e709e1580b4164db Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -753,20 +753,17 @@ void QmlEngine::changeBreakpoint(Breakpoint bp)
|
|||||||
BreakpointResponse br = bp.response();
|
BreakpointResponse br = bp.response();
|
||||||
if (params.type == BreakpointAtJavaScriptThrow) {
|
if (params.type == BreakpointAtJavaScriptThrow) {
|
||||||
d->setExceptionBreak(AllExceptions, params.enabled);
|
d->setExceptionBreak(AllExceptions, params.enabled);
|
||||||
br.enabled = params.enabled;
|
|
||||||
bp.setResponse(br);
|
|
||||||
} else if (params.type == BreakpointOnQmlSignalEmit) {
|
} else if (params.type == BreakpointOnQmlSignalEmit) {
|
||||||
d->setBreakpoint(EVENT, params.functionName, params.enabled);
|
d->setBreakpoint(EVENT, params.functionName, params.enabled);
|
||||||
br.enabled = params.enabled;
|
|
||||||
bp.setResponse(br);
|
|
||||||
} else {
|
} else {
|
||||||
//V8 supports only minimalistic changes in breakpoint
|
d->clearBreakpoint(d->breakpoints.take(bp.id()));
|
||||||
//Remove the breakpoint and add again
|
d->setBreakpoint(SCRIPTREGEXP, params.fileName,
|
||||||
bp.notifyBreakpointChangeOk();
|
params.enabled, params.lineNumber, 0,
|
||||||
bp.removeBreakpoint();
|
params.condition, params.ignoreCount);
|
||||||
BreakHandler *handler = d->engine->breakHandler();
|
d->breakpointsSync.insert(d->sequence, bp.id());
|
||||||
handler->appendBreakpoint(params);
|
|
||||||
}
|
}
|
||||||
|
br.enabled = params.enabled;
|
||||||
|
bp.setResponse(br);
|
||||||
|
|
||||||
if (bp.state() == BreakpointChangeProceeding)
|
if (bp.state() == BreakpointChangeProceeding)
|
||||||
bp.notifyBreakpointChangeOk();
|
bp.notifyBreakpointChangeOk();
|
||||||
|
Reference in New Issue
Block a user