You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
debugging session unusable if local variable is too large #4205
Describe the bug
When trying to debug app, if a local variable representing a very long list (list of 100M file bytes), the debugging session is not usable and often crash
To Reproduce
Steps to reproduce the behavior:
Create a local big file (on Linux : dd if=/dev/zero of=my_big_file bs=100M count=1)
Create a small dart app to read this file :
import'dart:io';
voidmain() async {
final bytes =awaitFile('my_big_file').readAsBytes();
final myVar ="foo";
final myVar2 ="bar";
final myVar3 ="";
}
Add breakpoint on line 5 or 6
Run app in debug mode
On left side, it's not possible to see local variables (infinite loading) or go to next line. The session will crash few seconds later.
Connecting to VM Service at http://127.0.0.1:37661/g8bL_J7yzYI=/
Exited (sigint)
Due to its size, the bytes variable prevent debug next lines.
Expected behavior
Have a usable debugging session
Screenshots
If applicable, add screenshots to help explain your problem.
This fix is in the SDK so it'll show up in a future SDK release. It's also limited to the new debug adapters (currently behind a flag dart:previewNewSdkDaps, but will hopefully be progressively rolled out after the next SDK release).
Activity
DanTup commentedon Oct 11, 2022
This is essentially a dupe of #4204 which is that large lists are not handled correctly.
The same fix applies - we tell VS Code up-front how big the list is and it will provide the ability to page though the items instead:
I don't think it's particularly useful to page through a list of bytes like this, but it should no longer hang the VM trying to load the entire file.
DanTup commentedon Oct 11, 2022
This fix is in the SDK so it'll show up in a future SDK release. It's also limited to the new debug adapters (currently behind a flag
dart:previewNewSdkDaps, but will hopefully be progressively rolled out after the next SDK release).