diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-05-03 17:20:54 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-05-04 08:21:22 +0000 |
commit | 73a620559749cb636766ae7f94a32e0cc7cdb6e7 (patch) | |
tree | 9a6d773a6ca989b3998e243adb582e49397ab594 /src/plugins | |
parent | 02d9ede53916663ea527aec3c3c9ae3a75df7c07 (diff) |
V4 debugger: Properly count break points
We cannot just take the number of active breakpoints as ID for the next
one. It's possible to remove breakpoints after all.
Fixes: QTBUG-93404
Change-Id: Icde7a8e47c740e930f2313ffd9034b00033a54aa
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 7f12cf3346d65d0bff78fff8000ed519fbb921ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp index c74fd35ea2..710b2716d3 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.cpp @@ -163,7 +163,7 @@ int QV4DebuggerAgent::addBreakPoint(const QString &fileName, int lineNumber, boo for (QV4Debugger *debugger : qAsConst(m_debuggers)) debugger->addBreakPoint(fileName, lineNumber, condition); - int id = m_breakPoints.size(); + const int id = ++m_lastBreakPointId; m_breakPoints.insert(id, BreakPoint(fileName, lineNumber, enabled, condition)); return id; } diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h index ccaf76b269..58222deb58 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debuggeragent.h @@ -93,6 +93,7 @@ private: }; QHash<int, BreakPoint> m_breakPoints; + int m_lastBreakPointId = 0; bool m_breakOnThrow; QV4DebugServiceImpl *m_debugService; }; |