Hot to not print fields with specific word filter.
I mean, have TBigStructureWithSoManyFields *a;
and now under gdb
OMG! Only few (but still many) i want see. So i don't want to doCode:p a[0]
Code:p a->field1 p a->field2 p a->field3 ...
Hot to not print fields with specific word filter.
I mean, have TBigStructureWithSoManyFields *a;
and now under gdb
OMG! Only few (but still many) i want see. So i don't want to doCode:p a[0]
Code:p a->field1 p a->field2 p a->field3 ...
The GDB manual says: Pretty Printing - Debugging with GDB
Sorry, i don't knowe python at all What means "registering" in gdb. Besides my version of gdb returns
(gdb) info pretty-printer
Undefined info command: "pretty-printer". Try "help info".
That's what mine says too (from Ubuntu 10.10). Section 23.2 of the above manual says you have to give --with-python as an option when you configure gdb. (It also says that's supposed to happen automatically if you have python installed already.) Perhaps the people managing your distro's packages have deliberately set it up without it?
I'm guessing instead you can try and set up some macros.
You can write a function which prints the information you are interested in to stdout, then call this function from inside the debugger:
Then inside gdb, when you are at a breakpoint or stepping somewhere:Code:void PrintInterestingInfo(TBigStructureWithSoManyFields *x) { printf("%d\n", x->field0); printf("%d\n", x->field1); ... etc ... }
Obviously you probably don't want to include the debugging function in your final build.Code:> call PrintInterestingInfo(foo)
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}