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

Debugger views include private getters which always fail if the current stack frame is from in the library that declares them #4296

Closed
Technorocker opened this issue Dec 2, 2022 · 2 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session is bug
Milestone

Comments

@Technorocker
Copy link

Describe the bug
I am using VSCode to debug my flutter app. This may have been doing it for a long time. I'm new to debugging. but I noticed as im steeping through the code every variable has a property called _identityHashCode and instead of a value if I hover over it it says this.

<error: org-dartlang-debug:synthetic_debug_expression:1:1: Error: The getter '_identityHashCode' isn't defined for the class 'MethodChannelFirebase'.
 - 'MethodChannelFirebase' is from 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart' ('/C:/Users/andre.viau/AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core_platform_interface-4.5.2/lib/firebase_core_platform_interface.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named '_identityHashCode'.
_identityHashCode
^^^^^^^^^^^^^^^^^>

It says this for every variable it shows in the debug window. This isnt causing any crashes or anything that I am aware of yet.

To Reproduce
Steps to reproduce the behavior:

  1. Click on Run on the top bar and choose Start Debugging
  2. Go to the run and debug tab on the side of vscode and expand the "This": section to show the _identityHashCode property.
  3. Step through the code to show different variables.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
I have added a screenshot of the area this is showing me

Please complete the following information:

  • Operating System and version: Win 10 21H2
  • VS Code version: 1.73.1
  • Dart extension version: v3.54.1
  • Dart/Flutter SDK version: 2.19.0-374.0.dev
  • Target device (if the issue relates to Flutter debugging): android S10
    dart error
@DanTup
Copy link
Member

DanTup commented Dec 6, 2022

This error should be harmless, but I agree we should remove it. The original legacy debug adapters did filter this out:

// Remove _identityHashCode because it seems to throw (and probably isn't useful to the user).
return getterNames.filter((g) => g !== "_identityHashCode");

However the new SDK debug adapters are missing this.

@DanTup DanTup added this to the v3.56.0 milestone Dec 6, 2022
@DanTup DanTup added the in debugger Relates to the debug adapter or process of launching a debug session label Dec 6, 2022
@DanTup DanTup changed the title The getter '_identityHashCode' isn't defined for the class 'MethodChannelFirebase' Debugger views include private getters which always fail if the current stack frame is from in the library that declares them Dec 6, 2022
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Dec 8, 2022
These will fail unless the current stack frame happens to be in the library that declares them, which results in a lot of exceptions being shown in variable views.

Fixes Dart-Code/Dart-Code#4296.

Change-Id: I5919e391f25a08920dcdf1bf648526d175af00f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274040
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
@DanTup
Copy link
Member

DanTup commented Dec 8, 2022

Private getters will be filtered from this list from a future update (via dart-lang/sdk@c53f705). The change is in the SDK so it'll show up in a future SDK update (rather than a Dart-Code update).

@DanTup DanTup closed this as completed Dec 8, 2022
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 is bug
Projects
None yet
Development

No branches or pull requests

2 participants