This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17436] New: better vtable inspection


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]