This question stay in my head for a long time.
 As we know, we can easily print data structure in GDB when we debugging, like gdb ptype command, it can output all field value of structure. I know GDB use bfd library to read symbolic information in object file.
 My question is: if I want to do this in my C source code, how to do? because I don't want to printf each field of structure one by one. Is there have any exist library to solve this issue?
 I think that library will not only meets my requirement, it will be very useful for many others programmers when writing C/C++ code.