dart-lang / webdev

A CLI for Dart web development.
https://pub.dev/packages/webdev
212 stars 75 forks source link

Debugging experience for patterns needs a cleanup #1974

Closed annagrin closed 1 year ago

annagrin commented 1 year ago
image
nshahan commented 1 year ago

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

bkonyi commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

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 commented 1 year ago

I am going to split this into a few things:

annagrin commented 1 year ago

All done!