Attaching to running flutter process doesn't highlight source paused on
See original GitHub issueDescribe the bug
When starting a flutter project using flutter run
outside of vscode and then attaching the debugger inside vscode by running >Debug: Attach to Flutter on Device
and pasting the URI provided by flutter, it is possible to set a breakpoint in a file and the debugger also stops the app, but it doesn’t give any information about the current state and doesn’t highlight the line that’s paused on. The problem only occurs if in vscode the flutter project is nested in subfolder. As setting the breakpoint and breaking on it works correctly, but from then on it’s pretty useless, it’s hard to figure out what’s wrong.
To Reproduce Steps to reproduce the behavior:
- Create a flutter project in a subfolder of the current vscode workspace (
mkdir -p flutter-test/src; code flutter-test; cd flutter-test/src; flutter create .
) - Start the flutter app using the CLI on a connected (android) device (
flutter run
) - Attach to the running flutter app on the connected device
- Set a breakpoint, ensure the corresponding code is executed
- Locate call stack, notice it only says “unknown source”; check code, notice it doesn’t highlight the current line when stepping;
Expected behavior Either setting the breakpoint should fail with a meaningful error message or locating the source should work not only for setting the breakpoints but also for resolving the debugged code.
Screenshots
Versions (please complete the following information):
- VS Code Version: 1.63.2 Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3 Date: 2022-01-19T16:00:00.869Z Electron: 13.6.7 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.40-electron.0 OS: Linux x64 5.16.2-arch1-1
- Dart extension version: v3.34.0
- Dart/Flutter SDK version: Flutter (Channel stable, 2.5.3, on Arch Linux 5.16.2-arch1-1, locale en_US.UTF-8
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:14 (9 by maintainers)
Top GitHub Comments
Since this is different to the original issue here, let’s continue this at https://github.com/Dart-Code/Dart-Code/issues/3896.
I’ve re-tested this on the current Flutter beta (v3.3.0-0.5.pre) with the latest Dart extension and
dart.previewSdkDaps: true
and confirmed it’s all working as expected.The new SDK DAPs will be gradually become default over the coming months (though you can still opt-in with that flag) when you’re using a new enough SDK.