diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-07-19 14:24:33 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-07-19 13:49:51 +0000 |
commit | 957d7d83ff9e6a7ce446a86861d8e9ca46357986 (patch) | |
tree | f5333dbded190b539ae778ffff555dc124c22a09 | |
parent | 9b36fb24efb2b1dee656c06164edc2ae239f6e98 (diff) |
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>
-rw-r--r-- | src/plugins/debugger/qml/qmlengine.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 2e0f655abd..c62856be4a 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -753,20 +753,17 @@ void QmlEngine::changeBreakpoint(Breakpoint bp) BreakpointResponse br = bp.response(); if (params.type == BreakpointAtJavaScriptThrow) { d->setExceptionBreak(AllExceptions, params.enabled); - br.enabled = params.enabled; - bp.setResponse(br); } else if (params.type == BreakpointOnQmlSignalEmit) { d->setBreakpoint(EVENT, params.functionName, params.enabled); - br.enabled = params.enabled; - bp.setResponse(br); } else { - //V8 supports only minimalistic changes in breakpoint - //Remove the breakpoint and add again - bp.notifyBreakpointChangeOk(); - bp.removeBreakpoint(); - BreakHandler *handler = d->engine->breakHandler(); - handler->appendBreakpoint(params); + d->clearBreakpoint(d->breakpoints.take(bp.id())); + d->setBreakpoint(SCRIPTREGEXP, params.fileName, + params.enabled, params.lineNumber, 0, + params.condition, params.ignoreCount); + d->breakpointsSync.insert(d->sequence, bp.id()); } + br.enabled = params.enabled; + bp.setResponse(br); if (bp.state() == BreakpointChangeProceeding) bp.notifyBreakpointChangeOk(); |