Closed annagrin closed 1 year ago
@bkonyi Are there any expectations for how stepping through patterns like this works when debugging on the VM?
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?
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:
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.
Looking at the screenshot, there are a few initial questions that come to my mind.
when
?[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.
I am going to split this into a few things:
[x] (DDC) do not show temp variables generated by CFE https://github.com/dart-lang/sdk/issues/51554 https://github.com/dart-lang/sdk/issues/51589
https://github.com/dart-lang/webdev/issues/2041 https://github.com/dart-lang/webdev/pull/2042
[ ] (dwds) minimize the number of debugger steps through CFE code https://github.com/dart-lang/webdev/issues/2034 https://github.com/dart-lang/webdev/pull/2043
[ ] (dwds, DevTools, dart-code?) cleanup hover over and evaluation behavior if needed
All done!
Stepping into the statement on the breakpoint line seems to stuck forever on the same spot
Compiler-generated locals appear in the variables window