djondal
djondal

Reputation: 2541

How is the debug information organized and what does it contain?

How is the debug information organized in a compiled C/C++ program? What does it contain?

How is the debug information used by the debugger, e.g. gdb, and how can I read the debug information better than nm or objdump?

Upvotes: 2

Views: 476

Answers (1)

caf
caf

Reputation: 239011

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

Upvotes: 2

Related Questions