I'd like to be able to print the variables with their values and their corresponding types.
typedef struct inner { int aOut; int bOut; } Inner;
typedef struct inner2 { int aOut; Inner bOut; } Inner2;
typedef struct outer { Inner2 thStruct; int var; } Outer;
Outer global = { { 1, { 2, 3 } }, 4 };
int main(int argc, char *argv[])
{
Outer local = { { 666, { 2, 3 } }, 4 };
return 0;
}
p local
in gdb gives me:
$1 = {thStruct = {aOut = 666, bOut = {aOut = 2, bOut = 3}}, var = 4}
but I'd also like to see the types of the fields such as:
$1: Outer = {thStruct: Inner2 = {aOut: int = 666, bOut: Inner = {aOut: int = 2, bOut: int = 3}}, var: int = 4}
I have found explore local
but you need to expand the non-scalar types yourself.