www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What exact debugging information is added to the binary and how to

reply BoQsc <vaidas.boqsc gmail.com> writes:
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?
May 13 2022
parent Basile B. <b2.temp gmx.com> writes:
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/)...
May 13 2022