Bug 16223 - add "layout mode" to ptype
Summary: add "layout mode" to ptype
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: cli (show other bugs)
Version: HEAD
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: good-first-bug
Depends on:
Blocks:
 
Reported: 2013-11-25 15:33 UTC by Tom Tromey
Modified: 2022-11-12 17:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2013-11-25 15:33:33 UTC
It would be nice sometimes if ptype had a "layout mode"
that inlined superclass definitions into the structure
layout, so that all the details of a given class could
be seen at once, without needing multiple invocations of ptype.
Comment 1 Tom Tromey 2022-11-12 17:37:33 UTC
This would be particularly good for ptype/o
Comment 2 Tom Tromey 2022-11-12 17:40:16 UTC
You can see how confusing this is for ptype/o in gdb itself:

/* offset    |  size */  type = struct dwarf2_per_bfd {
                         public:
/*    0      |     8 */    bfd *obfd;
/*    8      |    88 */    struct auto_obstack : public obstack {
/* XXX 80-byte padding  */

                               /* total size (bytes):   88 */
                           } obstack;


Here the "padding" comment is just wrong, but the type-printer
is confused because it doesn't really do anything sensible
with superclasses.