How does gdb print structs? From the "GDB Internals" document referenced by zengr at how does gdb work? it looks like GDB loads symbols in from one or more symbol tables using the BFD library. If this is the case, how does gdb know how to print structs? The name of the gdb source code file(s) containing the printing algorithm would be greatly appreciated (I tried to find it myself but couldn't).
Asked
Active
Viewed 608 times
1 Answers
5
GDB does use the BFD library, but it has much more code to handle symbols than what BFD provides. You are looking for val_print()
in valprint.c

Employed Russian
- 199,314
- 34
- 295
- 362
-
The link doesn't go to the right place anymore. Can you update the link to direct to valprint.c? – Ð.. Aug 14 '18 at 15:01
-
Possibly [this repo link](https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/valprint.c;hb=07aff30e92ead6c6d662462efc6ebdf83c6b8de3)? – Ð.. Aug 15 '18 at 16:07