tags:

views:

61

answers:

1

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?

+2  A: 

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

caf
for microsoft compilers its generally in a pdb, one can use the DIA SDK to examine these(it ships with VS).
Necrolis