[dds/dap] Fix ConcurrentModificationError when sending breakpoints

See https://github.com/dart-lang/sdk/issues/52932.

Change-Id: Iebfc335a44e3a8767341f678cf8af1627c21e50a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313782
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Danny Tuppeny 2023-07-17 14:35:57 +00:00 committed by Commit Queue
parent 53ead360bb
commit 98b63e1dcf

View file

@ -820,7 +820,7 @@ class IsolateManager {
// If we were passed a single URI, we should send breakpoints only for that
// (this means the request came from the client), otherwise we should send
// all of them (because this is a new/restarting isolate).
final uris = uri != null ? [uri] : _clientBreakpointsByUri.keys;
final uris = uri != null ? [uri] : _clientBreakpointsByUri.keys.toList();
for (final uri in uris) {
// Clear existing breakpoints.