Suppose one inherited a complex code base (in Visual C ++, say 2003 or perhaps later) with a large and complex inheritance schedule. Suppose this is deep, and there are many virtual functions, and possibly even multiple inheritance. (Yes, a bit of a nightmare for maintenance). Any attempt to reorganize this class hierarchy into something more reasonable should know which implementation of each virtual function is used by each class.
If we take an arbitrary leaf class L1 - which follows from the base class B1, which comes from the base class B2, etc. - it will have a vtable for the class, which will show something like (pseudo-vtable):
L1::F1 B3::F2 B1::F3 L1::F4 etc.
... depending on which virtual functions were overridden by the class.
How can I see such a vtable in this form? It could be restored manually by reading the code, but error-prone and painstaking. Presumably also, by hacking a class object in the debugger, you can check the vtable in the Watch window using the vtable pointer for this one class, but this is an inconvenient solution, especially if you also want to see vtables for L2, L3, ... LN.
Does DbgHelp.dll provide capabilities for checking vtables software products (allowing output in any form)? Or is there some other method?
source share