Basically, I want to get typeid(*this).name()
, i.e. the real type of this
.
I want to get this in GDB (without modifying the source code). I
This question may be related: vtable in polymorphic class of C++ using gdb:
(gdb) help set print object
Set printing of object's derived type based on vtable info.
It's not exactly typeid() but it should show the real object type when inspecting a polymorphic pointer (e.g. this
in a base class). Naturally works only for classes with a vtable (i.e. at least one virtual method) but so does typeid
.