Bug 31428 - ptype should respect "set print vtbl"
Summary: ptype should respect "set print vtbl"
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-28 17:05 UTC by Tom Tromey
Modified: 2024-02-28 17:05 UTC (History)
0 users

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 2024-02-28 17:05:00 UTC
With "set print vtbl on", I think ptype should also show
the vtable.

struct q {
  virtual ~q () = default;
  int x = 23;
};

q qqq;


(gdb) set print vtbl on
(gdb) ptype q
type = struct q {
  public:
    int x;

    ~q();
}


It would also be nice to have a ptype flag to enable this
per-use.

Finally, perhaps ptype/o should always show the vtables, since
the point of this is to understand the layout of the object in
memory.