pretty printer display hints for collections

Tom Tromey
Wed Apr 24 19:16:00 GMT 2013

>>>>> "Jens" == Elmenthaler, Jens <> writes:

Jens> Before I move to the libstdc++ mailing list or scratch my head how to
Jens> adapt Eclipse CDT being robust AND usable at the same time, is there
Jens> any good reason why the STL pretty printers for list, bitset, dqueue,
Jens> ... don't use display hint "array"?

For list, I can't think of a reason.

deque seems to return 'array' in the current libstdc++

bitset is funny because the interesting information is in the indices.
The values are all '1'.  However, this could be changed.

Jens> Or more generally, shouldn't any pretty printer for a collection
Jens> either use display hint "array" or "map"?

I wouldn't want to make a sweeping statement like that, but it seems
like a reasonable first approximation.

A long time ago we discussed how to get gdb to print multi-dimensional
arrays more nicely.  Those would not fit into this scheme.  (Nobody is
working on this right now, but there's still a bug open somewhere.)

Maybe a "set" style would be appropriate.  I'm not sure.


More information about the Gdb mailing list