Skip to content

Seeing obfuscated names on the call stack #1251

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

Open
vsmenon opened this issue Feb 16, 2021 · 2 comments
Open

Seeing obfuscated names on the call stack #1251

vsmenon opened this issue Feb 16, 2021 · 2 comments
Assignees
Labels
P2 A bug or feature request we're likely to work on

Comments

@vsmenon
Copy link
Member

vsmenon commented Feb 16, 2021

Screen Shot 2021-02-15 at 7 08 49 PM

See the main$ instead of main.

This is with the latest beta:

> flutter --version
Flutter 1.26.0-17.5.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 1fe38dcb5f (5 days ago) • 2021-02-10 16:25:47 -0800
Engine • revision d4453f6018
Tools • Dart 2.12.0 (build 2.12.0-259.9.beta)
@nshahan
Copy link
Contributor

nshahan commented Feb 16, 2021

In general the names that end with the suffix $, $1, $2, ... $n are given that name when the original conflicts with another name in the Javascript scope. Our longterm solution is to emit a full mapping of the renames in every scope so we can show the Dart name in the tools and find the correct JS name when an evaluation uses the Dart name.

This specific example of obfuscated names looks like a side effect of how DDC represents async methods as two nested functions where the inner method gets renamed with the $ suffix to avoid shadowing the outer method. See dart-lang/sdk#44374 but the solution for VSCode (I think what I see in the screenshot) might be different than what we eventually do for Dart/Flutter Dev Tools.

@DanTup How does the VSCode extension decide if it should show or hide a stack frame for a web project?

@DanTup
Copy link
Contributor

DanTup commented Feb 17, 2021

VS Code currently shows all frames (preferring the asyncCausalFrames), although there's some tweaking for things like the async marker and or to flag package/SDK frames (so they can be "collapsed" and greyed by VS Code).

No frames are ever outright excluded/skipped. I think it'd be possible to do if there was a need, although it would probably be better done in the service so it's just transparent to all editors to avoid them having to rewrite the indexes when calling things like evaluateInFrame.

@annagrin annagrin added the P2 A bug or feature request we're likely to work on label Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants