Dart-Code: Attaching to running flutter process doesn't highlight source paused on

Describe 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:

  1. 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 .)
  2. Start the flutter app using the CLI on a connected (android) device (flutter run)
  3. Attach to the running flutter app on the connected device
  4. Set a breakpoint, ensure the corresponding code is executed
  5. 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 image

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Since this is different to the original issue here, let’s continue this at https://github.com/Dart-Code/Dart-Code/issues/3896.