How does gdb implement printing of structs?
How does gdb print structs? From the "GDB Internals" document referenced by z开发者_如何学Pythonengr 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
精彩评论