public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17436] New: better vtable inspection
@ 2014-09-26 15:09 tromey at sourceware dot org
  0 siblings, 0 replies; only message in thread
From: tromey at sourceware dot org @ 2014-09-26 15:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17436

            Bug ID: 17436
           Summary: better vtable inspection
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org

I was recently debugging some C++ code and wanted
to know where in the class hierarchy a given virtual
function was first introduced.

It would be nice if gdb had a way to give me this information.
Perhaps something like a "verbose" flag to "info vtbl",
telling gdb to print more information about the vtable layout.

Consider the example from bug 17435.
Here the full dump looks like:

(gdb) info vtbl (Der *) b1
vtable for 'Der' @ 0x4008f0 (subobject @ 0x602010):
[0]: 0x40080c <Der::b1()>
[1]: 0x400816 <Der::b2()>

vtable for 'Base2' @ 0x400910 (subobject @ 0x602020):
[0]: 0x400820 <non-virtual thunk to Der::b2()>


You can't tell from this, but "Der::b1" is an override
of a method from a class Base1.  This obscured because
the first vtable is printed in its entirety, without
a marker indicating the end of the contributions of the
various base classes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-26 15:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-26 15:09 [Bug c++/17436] New: better vtable inspection tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).