DWARF Debug Format
Purpose
Guide agents through understanding and working with DWARF debug information: the key DWARF sections, using dwarfdump and readelf for inspection, split DWARF (.dwo files), debuginfod for remote symbol servers, and how LTO and stripping affect debug info.
Triggers
- "What are the DWARF sections in an ELF binary?"
- "How do I inspect DWARF debug info in a binary?"
- "How does split DWARF work?"
- "How do I set up debuginfod for automatic debug symbols?"
- "Why does GDB say 'no debugging symbols found'?"
- "How does LTO affect DWARF debug information?"
Workflow
1. DWARF sections overview
2. Inspecting DWARF with dwarfdump
3. Reading DWARF DIE structure
Tags (DW_TAG_*): compile_unit, subprogram, variable, formal_parameter, typedef, structure_type, member, array_type, pointer_type, base_type
Attributes (DW_AT_*): name, type, location, low_pc, high_pc, byte_size, encoding, file, line
4. Split DWARF (.dwo files)
Split DWARF separates debug info from the linked binary into .dwo sidecar files, reducing linker input size:
5. debuginfod — remote debug symbol server
debuginfod serves debug symbols, source code, and executables via HTTP:
6. LTO and DWARF
LTO affects DWARF debug information significantly:
7. Stripping and separate debug files
Related skills
- Use
skills/debuggers/debug-optimized-buildsfor debugging with split-DWARF builds - Use
skills/debuggers/core-dumpsfor using debuginfod with core dump analysis - Use
skills/binaries/elf-inspectionfor general ELF section inspection - Use
skills/build-systems/build-accelerationfor split-DWARF to speed up linking


