Introduction
DWARF is the debug information format of Linux, the BSDs, macOS and most other systems
outside Windows. It is normally stored in sections of the program’s own
ELF or object files. With split DWARF, chosen with the
compiler option -gsplit-dwarf in GCC and Clang, most of it goes instead
into a .dwo file (“DWARF object”) beside each object file. The linker
then has far less to copy, which makes large programs much quicker to link.
For shipping, the dwp tool packs a program’s .dwo files
into one .dwp file (“DWARF package”). Split DWARF began as a GCC
extension and became part of the standard in DWARF version 5.
Structure
A .dwo file is itself an ELF file whose sections carry the DWARF data,
with names ending in .dwo: .debug_info.dwo for the
description of types, functions and variables, .debug_abbrev.dwo,
.debug_str.dwo, .debug_line.dwo and others. The object file
keeps a small skeleton unit that names the .dwo file and holds a 64-bit
ID; the debugger uses the name to find the file and the ID to check that it matches.
A .dwp file adds index sections that map each ID to its data.
Links
Software
Developers
Reference
- DWARF Debugging Information Format, the standard, from version 5 including split DWARF