wire / wire-format / dwarf-debug

DWARF debug information format

DWARF is the standard debug information format for ELF (and other) binaries. It provides source-level debugging: line number tables (mapping PC to source line), variable locations (register/stack), type information, and call frame information (CFI) for unwinding. DWARF uses sections: .debug_info (DIEs - Debugging Information Entries), .debug_line (line number program), .debug_str (string table), .debug_abbrev (abbreviation table), .debug_frame/.eh_frame (call frame info).

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: DWARF debug information format

wire format

spec: DWARF 5 specification

DWARF is the standard debug information format for ELF (and other) binaries. It provides source-level debugging: line number tables (mapping PC to source line), variable locations (register/stack), type information, and call frame information (CFI) for unwinding. DWARF uses sections: .debug_info (DIEs - Debugging Information Entries), .debug_line (line number program), .debug_str (string table), .debug_abbrev (abbreviation table), .debug_frame/.eh_frame (call frame info).

fieldsizemeaning
.debug_infovariableDIEs (Debugging Information Entries): tree of tagged entries describing types, variables, functions, scopes.
DIE tagULEB128Tag: DW_TAG_compile_unit, DW_TAG_subprogram, DW_TAG_variable, DW_TAG_base_type, DW_TAG_pointer_type, etc.
DIE attributesvariableAttributes: DW_AT_name, DW_AT_type, DW_AT_location, DW_AT_low_pc, DW_AT_high_pc, DW_AT_decl_file, DW_AT_decl_line, etc.
.debug_linevariableLine number program: state machine mapping addresses to source lines (file, line, column).
.debug_abbrevvariableAbbreviation table: templates for DIEs (which attributes each tag has).
.eh_framevariableCall Frame Information (CFI): unwind rules for each function (how to restore registers and SP).
LEB128variableLittle-Endian Base 128: variable-length integer encoding (7 bits per byte, MSB = continue).
Location expressionsvariableDW_OP_reg0 (register), DW_OP_fbreg (frame base + offset), DW_OP_addr (absolute address), DW_OP_deref (dereference).

example:

00 00 00 00

DWARF (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/dwarf-debug or /wire-format/dwarf-debug.json