Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dart SDK files are not correctly mapped to local sources when debugging a Flutter app #4128

Closed
DanTup opened this issue Aug 30, 2022 · 5 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Aug 30, 2022

#3551 is fixed with the new SDK DAPs, however in Flutter apps the returned URIs aren't the same as the Dart ones, so the fix is not complete for Flutter.

I've filed dart-lang/sdk#49863 to find out whether this is a bug, and if not, exactly what the rules for the mapping are.

@DanTup DanTup added is bug in flutter Relates to running Flutter apps in debugger Relates to the debug adapter or process of launching a debug session labels Aug 30, 2022
@DanTup DanTup added this to the v3.50.0 milestone Aug 30, 2022
@BlueDev5
Copy link

BlueDev5 commented Sep 5, 2022

I also encountered this issue, which appeared out of nowhere, after about 2 hrs I got to #3551 from where I finally found the best thing possible was just to roll back to 3.46.1

@DanTup
Copy link
Member Author

DanTup commented Sep 5, 2022

@BlueDev5 the issue described above is not something that should be worse in 3.48 to 3.46, as SDK sources were not mapped at all in the old SDK DAPs. Could you file a new issue describing the behaviour you're seeing in v3.48 and does not occur in v3.46 so I can take a look? Thanks!

@BlueDev5
Copy link

BlueDev5 commented Sep 6, 2022

Filed issue #4147

@DanTup
Copy link
Member Author

DanTup commented Sep 7, 2022

When this is fixed, web should be tested specifically because it may behave differently (since it goes through DWDS). It currently results in this:

[+6526 ms] DevHandler: VmService proxy responded with an error:
           {jsonrpc: 2.0, id: 646, error: {code: -32603, message: addBreakpointWithScriptUri: Invalid argument (uri): Unknown library: "file:///Users/danny/Dev/Google/flutter/bin/cache/pkg/sky_engine/lib/core/print.dart", data: {details: #0      new DartUri._fromFileUri (package:dwds/src/utilities/dart_uri.dart:75:5)
           #1      new DartUri (package:dwds/src/utilities/dart_uri.dart:42:22)
           #2      ChromeProxyService.addBreakpointWithScriptUri (package:dwds/src/services/chrome_proxy_service.dart:355:21)
           <asynchronous suspension>
           #3      StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:125:47)
           <asynchronous suspension>
           }}}

@DanTup
Copy link
Member Author

DanTup commented Oct 31, 2022

Fix in progress at flutter/flutter#114369.

Unfortunately this doesn't work for Web yet because of dart-lang/webdev#606. Hopefully once that's done this will just start working without any further changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is bug
Projects
None yet
Development

No branches or pull requests

2 participants