Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does gdb implement printing of structs?

Tags:

gdb

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).

like image 343
jvm_update Avatar asked Oct 10 '22 09:10

jvm_update


1 Answers

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

like image 61
Employed Russian Avatar answered Oct 14 '22 02:10

Employed Russian