Skip to content

Case where the breakpoint resolution algorithm dosen't correctly find the first debuggable location on a line #60274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
derekxu16 opened this issue Mar 7, 2025 · 2 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. triaged Issue has been triaged by sub team vm-debugger vm-service The VM Service Protocol, both the specification and its implementation

Comments

@derekxu16
Copy link
Member

derekxu16 commented Mar 7, 2025

In the example program below, putting a breakpoint on line 2, starting a debug session, and then hitting "step over" twice results in the debugger being paused at the = at 3:12, and then hitting "step over" again results in the debugger being paused at 3:17. If a breakpoint is put on line 3 instead of line 2, then the debugger pauses at 3:22 when a debug session is started.

void main() {
  final a1 = ['a', 'b', 'c'];                // line 2
  final a2 = a1.map((c) => c.toLowerCase()); // line 3
  print(a2);
}

related to: Dart-Code/Dart-Code#5430

@derekxu16 derekxu16 added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. vm-debugger vm-service The VM Service Protocol, both the specification and its implementation labels Mar 7, 2025
@derekxu16 derekxu16 self-assigned this Mar 7, 2025
@a-siva a-siva added the triaged Issue has been triaged by sub team label Mar 12, 2025
@derekxu16
Copy link
Member Author

I looked into this and found that the way the breakpoint on line 3 is resolved actually follows our rules for breakpoint resolution, so it is not a bug, but we may want to modify those rules. Breakpoints currently get resolved at the first debuggable position within the innermost closure on the requested line. I think it would make sense to ditch the "innermost closure condition" and simply resolve a breakpoint at the first debuggable position on the requested line. I'm guessing you would prefer this as well @stan-at-work, but it would be great if you could give confirmation.

@stan-at-work
Copy link

I looked into this and found that the way the breakpoint on line 3 is resolved actually follows our rules for breakpoint resolution, so it is not a bug, but we may want to modify those rules. Breakpoints currently get resolved at the first debuggable position within the innermost closure on the requested line. I think it would make sense to ditch the "innermost closure condition" and simply resolve a breakpoint at the first debuggable position on the requested line. I'm guessing you would prefer this as well @stan-at-work, but it would be great if you could give confirmation.

I would also prefer this yes. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. triaged Issue has been triaged by sub team vm-debugger vm-service The VM Service Protocol, both the specification and its implementation
Projects
None yet
Development

No branches or pull requests

3 participants