Skip to content

cannot view contents of Map<DateTime, List> while debugging #2146

Closed

Description

@s-j-a

I have a structure defined as Map<DateTime, List> , each element of List is also a map. During debugging I cannot view the data in the List maps. Expanding each list element shows only its meta data values (_checkSum, _data, _deletedKeys, _hashMask, _index etc...) not the map key/values. This makes debugging very difficult.

Screen Shot 2019-12-04 at 7 48 33 PM

this worked fine in previous versions

Activity

  1. added this to the v3.8.0 milestone on Dec 4, 2019
  2. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    on Dec 4, 2019
  3. DanTup commented on Dec 4, 2019

    @DanTup
    Member

    Thanks, I can reproduce this - seems to only happen when the map has DateTime keys:

    Screenshot 2019-12-04 at 4 33 45 pm

    I'll see what I can find!

  4. DanTup commented on Dec 4, 2019

    @DanTup
    Member

    @devoncarew @pq Is there a way to get a log of the VM service traffic from Android Studio? This same code seems to work fine there, but in VS Code we get an object with kind="PlainInstance" and not kind="Map" so I want to figure out what we're doing differently.

    Screenshot 2019-12-04 at 5 01 15 pm

  5. pq commented on Dec 5, 2019

    @pq

    @DanTup: do you have the Android Studio plugin running from source? I think you'd have to add print statements to the VmServiceManager (IIRC or similar). I'm not in front of the source now but happy to help instrument if you want to spelunk.

  6. DanTup commented on Dec 5, 2019

    @DanTup
    Member

    do you have the Android Studio plugin running from source?

    I don't. Is it simple to set up? (I've never built any java in my life :-))

    Or if it's simpler - if I paste the Dart code in here, could you easily run it and capture the VM service traffic?

    Failing that - can you point me at the code that is fetching the values for this tree? I'll see if I can see any obvious differences with what you're doing there and I'm doing here. Thanks!

  7. pq commented on Dec 6, 2019

    @pq

    Go ahead and paste code here. Setup takes a bit...

  8. DanTup commented on Dec 9, 2019

    @DanTup
    Member

    @pq Here's the code from above:

    import 'dart:convert';
    
    main() {
      final mapOfListOfMaps1 = {
        1: [
          {1: 1, 2: 2},
        ],
      };
      final mapOfListOfMaps2 = {
        DateTime.now(): [
          {1: 1, 2: 2},
        ],
      };
    
      print('Hello!');
    }
    

    If you breakpojnt on the print and expand through mapOfListOfMaps2 to reveal values inside the leaf map (1:1, 2:2) capturing the VM service traffic, that should help my figure out what I'm doing differently.

    Thanks!

  9. modified the milestones: v3.8.0, v3.9.0 on Jan 16, 2020
  10. DanTup commented on Mar 11, 2020

    @DanTup
    Member

    @pq ping! I don't support you're able to capture a log for above (or give some hints on how I could do it)?

  11. modified the milestones: v3.9.0, v3.10.0 on Mar 24, 2020
  12. DanTup commented on Apr 14, 2020

    @DanTup
    Member

    @pq ping! :)

    (if it's not already possible, maybe there's value in having a way to write logs easily for end users? I'm often wishing I could get logs from Android Studio, and the logs from VS Code come in handy debugging user issues all the time!)

  13. pq commented on Apr 14, 2020

    @pq

    Ack! Sorry. Will look today.

    EDIT: whoops; looks like this is in the Dart Plugin Debugger -- let me get that setup...

  14. DanTup commented on Apr 15, 2020

    @DanTup
    Member

    Ok, I finally managed to track this down! It was a silly mistake on my part..

    Against the values we track an "evaluateName" (this is a string that evaluates to the value shown, which can be used for "Add Watch", etc.). This only works when the key is a simple type (eg. we can add a watch expression for myMap[1] but not for myMap[someComplexType]).

    When fixing up for TypeScript strict mode, I'd incorrectly assumed that value was always present/required to display the map when it's not (it's only required for things like "Add Watch") and caused it to follow a different code path.

  15. pq commented on Apr 15, 2020

    @pq

    Good deal @DanTup!

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 bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions