Skip to content

Debugging experience for patterns needs a cleanup #1974

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

Closed
annagrin opened this issue Feb 18, 2023 · 6 comments
Closed

Debugging experience for patterns needs a cleanup #1974

annagrin opened this issue Feb 18, 2023 · 6 comments
Assignees
Labels
dart3 P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@annagrin
Copy link
Contributor

image

  • Stepping into the statement on the breakpoint line seems to stuck forever on the same spot

    • I suppose it goes through all ddc statements the patterns has been translated to
    • Can we remove unnecessary locations in source maps?
  • Compiler-generated locals appear in the variables window

@annagrin annagrin added the dart3 label Feb 18, 2023
@annagrin annagrin changed the title Debuging experience for patterns needs a cleanup Debugging experience for patterns needs a cleanup Feb 18, 2023
@nshahan
Copy link
Contributor

nshahan commented Feb 22, 2023

@bkonyi Are there any expectations for how stepping through patterns like this works when debugging on the VM?

@bkonyi
Copy link
Collaborator

bkonyi commented Feb 22, 2023

I'm not sure what the behavior will be like as it depends on where we insert breakpoints into generated code. Maybe @alexmarkov will have a better idea or know who will?

@alexmarkov
Copy link

Debugger behavior depends on how patterns are lowered in the front-end and how source positions are assigned to the AST nodes.

However, VM has a logic to avoid stopping at the same position repeatedly:

https://github.com/dart-lang/sdk/blob/b8dc6762921aa2fd3ef3c7415d3d7f946ee6f21b/runtime/vm/debugger.cc#L3809-L3814

So even if there are many AST nodes with the same source position, VM would stop at the first one and then skip the rest of the stops, until the source position changes.

@nshahan
Copy link
Contributor

nshahan commented Feb 22, 2023

Looking at the screenshot, there are a few initial questions that come to my mind.

  • If you set a breakpoint and pause on line 15 then step where would you expect the next pause to be?
  • If you set a breakpoint on line 16 and the debugger pauses there do we expect the evaluation to be paused before the when?
  • Is there any point that you can hover over variables in the patterns like [var a, int n]to see values?

I don't expect these all to be answered already but I'd like to get the discussion started and I'm not sure who should be involved.

@annagrin annagrin self-assigned this Feb 23, 2023
@annagrin
Copy link
Contributor Author

annagrin commented Feb 23, 2023

@annagrin
Copy link
Contributor Author

All done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dart3 P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

4 participants