Bug 461241 - CDT should display maps more clearly
Summary: CDT should display maps more clearly
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-02 16:35 EST by Simon Marchi CLA
Modified: 2020-09-04 15:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Marchi CLA 2015-03-02 16:35:17 EST
When gdb returns a variable object with displayhint "map", CDT should show its children in a way that makes it clearer that it's a map. Currently, we have this:

http://nova.polymtl.ca/~simark/ss/map.png

map ...
  [0] 111
  [1] 222
  [2] 333
  [3] 444
  [4] 555
  [5] 666

It makes it look like it's a vector, but I think that the display could be better.

My first idea was this:

map ...
  [111] 222
  [333] 444
  [555] 666

However, since keys can be complex structures with children themselves, it wouldn't work very well (you couldn't expand them).

We could do how Java does it:

map ...
  [0] ...
    [key] 111
    [value] 222
  [1] ...
    [key] 333
    [value] 444
  [2] ...
    [key] 555
    [value] 666

What is annoying with this is that when all items are collapsed, you can't quickly visually search for a particular key (or value). To make this easier, we could display a quick preview of the key besides the item.

map ...
  [0] 111 -> 222
    [key] 111
    [value] 222
  [1] 333 -> 444
    [key] 333
    [value] 444
  [2] 555 -> 666
    [key] 555
    [value] 666