What exact debugging information is added to the binary and how to parse it all?

Basile B. b2.temp at gmx.com
Fri May 13 16:56:55 UTC 2022


On Friday, 13 May 2022 at 16:11:14 UTC, BoQsc wrote:
> Haven't used debuggers or debugged a lot just yet, but I've had 
> this question in my mind and I'd like to inspect some debugging 
> information manually. Are there some kind of documentation or 
> specification and are there a lot of information that is hidden 
> in a an average "debuggable" binary?

if you're on linux then the debug information are generated in a 
format that's well specified called DWARF.

DWARF essentially contain information about

- translation unit filename
- call stack
- each instruction of the runtime code is associated to a 
location (allowing to put breakpoints)
- the layout of user defined types (allowing to inspect instances)
- the inheritance chain of user defined types
- the variable types (alowing to inspect variables)

That's a lot of information, they non-trivially increase the size 
of the binary, but this is required to debug a program.

[learn more](https://dwarfstd.org/)...


More information about the Digitalmars-d-learn mailing list