dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.28k stars 1.58k forks source link

DDC async function stepping improvements #56316

Open biggs0125 opened 4 months ago

biggs0125 commented 4 months ago

Tracking issue to monitor progress on improving debugger stepping through async function bodies.

The new DDC async semantics expand async function bodies into complex state machines. The normal JS stepping semantics don't map cleanly to steps through Dart code given this lowering. There are a couple potential approaches to fix this: 1) Add more logic to the Dart debugger to perform custom stepping behavior when stepping through async code. 2) Modify the async lowering in such a way that stepping more closely resembles stepping through Dart. For example, rather than returning multiple times, the state machine function might be able to yield. Stepping over a yield might allow the debugger to stay within the function body.

biggs0125 commented 4 months ago

When this work is done, Flutter debugger tests should be updated. See https://github.com/flutter/flutter/pull/152204