I came upon a struct called ngx_http_variable_value_t
in my GDB session and I would like to print what fields it has in the console.
Is that possible?
I came upon a struct called ngx_http_variable_value_t
in my GDB session and I would like to print what fields it has in the console.
Is that possible?
In addition to using the command line option, you can also use graphical debuggers. I suggest gdbgui, but there are quite a few out there.
Disclaimer: I am the developer of gdbgui
I've only done this through graphic front ends for gdb. Found this entry in gdb online docs. Hope it helps. I believe this will require that the code was created with debugging info included.
ptype [arg] ptype accepts the same arguments as whatis, but prints a detailed description of the type, instead of just the name of the type.
Debugging with GDB:Symbols
You can use the GDB command
ptype
to print out the definition of a struct or class.set print pretty on
This option also gives newlines and indentation for
p *my_struct_pointer
.Which do you prefer:
or:
If you have debugging symbols built in, you should just be able to print the value:
print variable
orprint *variable
if it's a pointer to a struct.I would have a look at the Data Display Debugger.