Description
the issue was originally filed at Dart-Code/Dart-Code#4707
Describe the bug
The breakpoint at line 382 is ignored as shown in the screen recording below (it's taking several seconds because the setup prepares a database):
Screen.Recording.2023-08-25.at.8.49.56.PM.mov
To Reproduce
I could not reproduce outside of the project that I was working on, but I made a branch in my fork to reproduce:
- Checkout the
debugger_breakpoint_issue
branch - Make sure Docker is available -- the tests will pull the latest postgres image so first run may be slow.
- Go to
tests/v3_test.dart
to line 382 and set a breakpoint as shown in the video Clickdebug
above the test and the debugger skips the breakpoint
[Update] this is a minimal code sample to reproduce
void main() {
final int y = 0;
/* breakpoint here would hit */ final yd = y.toDouble();
late final int x = 1; // late initialization causes the issue
/* breakpoint here would miss */ final xd = x.toDouble();
}
Expected behavior
I expect the debugger to hit the breakpoint.
Please complete the following information:
- Operating System and version: 12.6 (21G115)
- VS Code version: 1.81.1
- Dart extension version: v3.70.0
- Dart/Flutter SDK version: Dart SDK version: 3.1.0 (stable) (Tue Aug 15 21:33:36 2023 +0000) on "macos_x64"
Additional context from see @DanTup:
Nothing looks wrong in the log until the debugger pauses at the wrong place. A new isolate starts paused, we send breakpoints, the VM responds. We then resume the isolate and both breakpoints resolve, but then we hit the second breakpoint.