How is organized the debug information in a compiled C/C++ program ? What does it contain ?
How the debug information is used by the debugger, e.g. gdb and how can I read the debug information better than nm or objdump?
How is organized the debug information in a compiled C/C++ program ? What does it contain ?
How the debug information is used by the debugger, e.g. gdb and how can I read the debug information better than nm or objdump?
The debugging information depends on the operating system - gdb
uses whatever the native format is. On many UNIX-like systems, debugging information is stored in DWARF
format. You can use libdwarf
and dwarfdump
to examine this information.
EDIT: On Linux readelf -w a.out
will print all DWARF
debug info contained in the executable (also works for shared libraries and object files).