c++ - gdb: show typeinfo of some data - Stack Overflow At least in gdb v7 6 1 that doesn't help with this question, as it only prints the static type, not the polymorphic type For example where "d" is an object of type "D" derived from base class "B" then B* b = d; (gdb) ptype b type = class B {
gdb. types (Debugging with GDB) - sourceware. org get_basic_type (type) Return type with const and volatile qualifiers stripped, and with typedefs and C ++ references converted to the underlying type C ++ example: typedef const int const_int; const_int foo (3); const_int foo_ref (foo); int main () { return 0; } Then in gdb: (gdb) start (gdb) python import gdb types (gdb) python foo_ref = gdb parse_and_eval ("foo_ref") (gdb) python print
gdb in C: Get type of variable as string - Stack Overflow Why do you need the type as a string in a debugger variable? It's okay if it's just for curiosity (but then please state it in the question), otherwise it's better to ask about the problem you have directly instead of asking about a possible solution
find type definition in gdb - C++ Forum - C++ Users It seems to me that in order to gdb to find where a type is defined, you have to declare a variable of that type Is it possible to find where a type is defined in gdb without declaring a variable of that type?
Variables (Debugging with GDB) - sourceware. org See unknown type, for more about unknown types If you cast the variable to its declared type, GDB gets the variable’s value using the cast-to type as the variable’s type For example, in a C program: (gdb) p var 'var' has unknown type; cast it to its declared type (gdb) p (float) var $1 = 3 14