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).
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With