In GDB, given a variable that points to a struct, print will display the raw pointer value and x will display the raw bytes pointed to. Is there any way to display the data pointed to as that struct, i.e. a list of fields and their values?
In GDB, given a variable that points to a struct, print will display the
Share
If you do that it will display the value of that variable in GDB.
You also have an option to display the struct with indentation and new lines:
For that you need to set the pretty print:
If you want to print an array of values you do: