4d1b418230
When there are multiple isolates, we may get breakpoint responses/events like this: - Request/Response to add breakpoint to Isolate 1 - Request/Response to add breakpoint to Isolate 2 - BreakpointAdded for Isolate 1 - BreakpointResolved for Isolate 1 - BreakpointAdded for Isolate 2 Because Isolate 2 did not load the script, the last breakpoint was never resolved. However because the breakpoint ID matched, we would forward this event to the client and un-resolve the previously resolved breakpoint. This would result in odd behaviour in VS Code. Additionally, the VM may return the same BM breakpoint ID for what the client thinks are two breakpoints (they are on different lines, but resolve to the same location) so when we get a resolved breakpoint, we need to handle both: - Client breakpoints that have already been transmitted - Future client breakpoints that may resolve to this same VM breakpoint The previous code assumed that a BreakpointResolved event could be handled just once. Either for an existing breakpoint, or a future one. This change swaps from storing queued events to storing the resolution information for each breakpoint, and it does this even if there was an existing breakpoint (in case the breakpoint is reused in future). Fixes at least some of https://github.com/Dart-Code/Dart-Code/issues/4598 Change-Id: I53b92debfaa0c8f538dc8d67966854bb89634708 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311480 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>