vtable in polymorphic class of C++ using gdb [duplicate]
How to display vtable using a pointer to base class object having virtual functions?
Did you try set print object on
?
(gdb) help set print object
Set printing of object's derived type based on vtable info.
If you have a sufficiently new version of gdb, you may want to look at the "info vtbl" command (or perhaps it is called "info vtable"; my own version of gdb is not sufficiently new, and so I cannot test the feature out myself).
I only noticed the feature when googling for an answer to this question and I noticed posts to the gdb mailing list circa 2012, notably this one from March 2012:
http://permalink.gmane.org/gmane.comp.gdb.patches/73957
精彩评论