Skip to content

Strings in debugger are truncated in fields but not in the parent objects toString() representation #4986

Closed

Description

@benji-farquhar

The image shows the variable in watch, console, local debugger, and tooltip.

Screenshot 2024-02-15 at 07 56 55

"Copy value" shows:

"/Users/benjaminfarquhar/Library/Developer/CoreSimulator/Devices/F56DA440-80AE-494E-A141-4EB263A9FF4F/data/Containers/Data/Applic…"

Interestingly, the grey text in the debug variables is not truncated. So you can see the whole value if you hover over file.value, it shows the File which seems to contain the path inline inside the File. But I think if the variable was a primitive String (not a String within a File) it would be impossible to see the whole value.

Activity

  1. DanTup commented on Feb 15, 2024

    @DanTup
    Member

    Turns out, this was fixed more recently than I remembered and hasn't made it to a stable release yet:

    dart-lang/sdk@5929460

    I tested on Flutter stable and it's truncated, but on beta it's not.

    Interestingly, the grey text in the debug variables is not truncated.

    Hmm, that might be a bug. Generally in this view we are given truncated strings by the VM Service. We don't normally expand them except in the REPL/Debug Console and Copy Value because in a large object, there could be a lot of large strings.

    However, we to (by default) call toString() on complex objects, and I wonder if that's bypassing the truncation. I'll take a look because this should be consistent.

    When the current beta goes stable, Copy Value should work as you expect though.

  2. changed the title [-]Variable in debugger is truncated everywhere with ellipses.[/-] [+]Strings in debugger are truncated in fields but not in the parent objects toString() representation[/+] on Feb 15, 2024
  3. DanTup commented on Feb 15, 2024

    @DanTup
    Member

    I've renamed this issue and will use it to track the inconsistency noted above (the fix may be for the grey text to also be truncated).

  4. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    on Feb 15, 2024
  5. added this to the v3.86.0 milestone on Feb 15, 2024
  6. modified the milestones: v3.86.0, v3.88.0 on Apr 2, 2024
  7. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Apr 17, 2024
  8. DanTup commented on Apr 24, 2024

    @DanTup
    Member

    This is fixed (that is, we will consistently use truncated values unless you're in the REPL or using "Copy Value") by dart-lang/sdk@2f2564c. The fix is in the SDK debug adapters so will ship in a future SDK release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsis bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions