6

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

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

The link doesn't go to the right place anymore. Can you update the link to direct to valprint.c?
Possibly this repo link?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.