/dwarf-debug-format
DWARF debug format skill for understanding debug information. Use when inspecting DWARF sections with dwarfdump, working with split DWARF (.dwo files), setting up debuginfod for remote symbol resolution, or understanding how DWARF interacts with LTO and symbol stripping.
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill dwarf-debug-format --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/dwarf-debug-format
Context preview
The summary Claude sees to decide when to auto-load this skill.
DWARF debug format skill for understanding debug information. Use when inspecting DWARF sections with dwarfdump, working with split DWARF (.dwo files), setting up debuginfod for remote symbol resolution, or understanding how DWARF interacts with LTO and symbol stripping.
SKILL.md
dwarf-debug-format.SKILL.mdname: dwarf-debug-format
description: DWARF debug format skill for understanding debug information. Use when inspecting DWARF sections with dwarfdump, working with split DWARF (.dwo files), setting up debuginfod for remote symbol resolution, or understanding how DWARF interacts with LTO and symbol stripping. Activates on queries about DWARF, .debug_info, .debug_line, dwarfdump, split DWARF, .dwo files, debuginfod, or debug info stripping.
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
# Show all sections in a binary (including DWARF)
readelf -S prog | grep "\.debug"
# Common DWARF sections:
# .debug_info — types, variables, functions (DIEs — Debug Info Entries)
# .debug_abbrev — abbreviation table for .debug_info encoding
# .debug_line — line number table (source line → address mapping)
# .debug_str — string table for identifiers
# .debug_loc — location expressions (where variables live)
# .debug_ranges — non-contiguous address ranges for CUs
# .debug_aranges — fast lookup: address → compilation unit
# .debug_pubnames — global variable and function names
# .debug_frame — call frame information (for unwinding)
# .debug_types — type unit entries (DWARF 4+)
# .debug_rnglists — range lists (DWARF 5)
# .debug_loclists — location lists (DWARF 5)
# .debug_addr — address table (DWARF 5)
# .debug_line_str — line number string table (DWARF 5)
2. Inspecting DWARF with dwarfdump
# Install dwarfdump
apt-get install dwarfdump # Ubuntu (part of libdwarf)
brew install libdwarf # macOS
# Dump all DWARF info
dwarfdump prog
# Dump specific sections
dwarfdump --debug-info prog # types, variables, functions
dwarfdump --debug-line prog # line number table
dwarfdump --debug-loc prog # variable locations
dwarfdump --debug-frame prog # call frame info
# readelf alternatives (less verbose)
readelf --debug-dump=info prog | head -100
readelf --debug-dump=lines prog | head -50
# llvm-dwarfdump (more readable output)
llvm-dwarfdump prog
llvm-dwarfdump --debug-info prog | grep "DW_AT_name"
llvm-dwarfdump --statistics prog # summarize DWARF sizes
3. Reading DWARF DIE structure
# Sample dwarfdump output for a variable
DW_TAG_compile_unit
DW_AT_producer : "GNU C17 13.2.0"
DW_AT_language : DW_LANG_C11
DW_AT_name : "main.c"
DW_AT_comp_dir : "/home/user/project"
DW_TAG_subprogram
DW_AT_name : "add"
DW_AT_type : <0x42> → points to int type DIE
DW_AT_low_pc : 0x401130 ← function start address
DW_AT_high_pc : 0x401150 ← function end address
DW_TAG_formal_parameter
DW_AT_name : "a"
DW_AT_type : <0x42>
DW_AT_location : DW_OP_reg5 (rdi) ← lives in register rdi
DW_TAG_formal_parameter
DW_AT_name : "b"
DW_AT_location : DW_OP_reg4 (rsi) ← lives in register rsiTags (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:
# Compile with split DWARF
gcc -g -gsplit-dwarf -O2 -c main.c -o main.o
# Creates: main.o (object without full DWARF) + main.dwo (debug info)
# Link (linker only processes small .o files, not large DWARF)
gcc main.o -o prog
# prog references main.dwo but doesn't embed it
# GDB finds .dwo files via DW_AT_GNU_dwo_name attribute in prog
gdb prog # works if main.dwo is in the same directory
# Inspect the split reference
readelf -S prog | grep "\.gnu_debuglink\|dwo"
dwarfdump prog | grep "dwo_name" # shows path to .dwo files
# Package .dwo files into a single .dwp for distribution
dwp -o prog.dwp prog # GNU dwp tool
llvm-dwp -o prog.dwp prog # LLVM version
# With .dwp next to prog, GDB finds all debug info
5. debuginfod — remote debug symbol server
`debuginfod` serves debug symbols, source code, and executables via HTTP:
# Client: configure to use a debuginfod server
export DEBUGINFOD_URLS="https://debuginfod.elfutils.org/"
# GDB uses it automatically when symbols are missing
gdb /usr/bin/git
# GDB will fetch debug symbols from debuginfod if not locally installed
# Explicit fetch
debuginfod-find debuginfo /usr/bin/git # fetch debug info
debuginfod-find source /usr/bin/git # fetch source
# Distribution servers
# Fedora: https://debuginfod.fedoraproject.org/
# Ubuntu: https://debuginfod.ubuntu.com/
# Debian: https://debuginfod.debian.net/
# elfutils: https://debuginfod.elfutils.org/
# Configure in GDB
(gdb) set debuginfod enabled on
(gdb) set debuginfod verbose 1
# Set up your own debuginfod server
debuginfod -d /var/cache/debuginfod -p 8002 /path/to/binaries/
export DEBUGINFOD_URLS="http://localhost:8002"
6. LTO and DWARF
LTO affects DWARF debug information significantly:
# Full LTO: DWARF is generated after link-time optimization
# Variables and functions may be merged, inlined, or eliminated
gcc -flto -O2 -g main.c util.c -o prog
# DWARF in prog reflects post-LTO state (may lose some info)
# Thin LTO (better for debug info preservation)
clang -flto=thin -O2 -g
Read more
name: dwarf-debug-format description: DWARF debug format skill for understanding debug information. Use when inspecting DWARF sections with dwarfdump, working with split DWARF (.dwo files), setting up debuginfod for remote symbol resolution, or understanding how DWARF interacts with LTO and symbol stripping. Activates on queries about DWARF, .debug_info, .debug_line, dwarfdump, split DWARF, .dwo files, debuginfod, or debug info stripping.
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
# Show all sections in a binary (including DWARF) readelf -S prog | grep "\.debug" # Common DWARF sections: # .debug_info — types, variables, functions (DIEs — Debug Info Entries) # .debug_abbrev — abbreviation table for .debug_info encoding # .debug_line — line number table (source line → address mapping) # .debug_str — string table for identifiers # .debug_loc — location expressions (where variables live) # .debug_ranges — non-contiguous address ranges for CUs # .debug_aranges — fast lookup: address → compilation unit # .debug_pubnames — global variable and function names # .debug_frame — call frame information (for unwinding) # .debug_types — type unit entries (DWARF 4+) # .debug_rnglists — range lists (DWARF 5) # .debug_loclists — location lists (DWARF 5) # .debug_addr — address table (DWARF 5) # .debug_line_str — line number string table (DWARF 5)
2. Inspecting DWARF with dwarfdump
# Install dwarfdump apt-get install dwarfdump # Ubuntu (part of libdwarf) brew install libdwarf # macOS # Dump all DWARF info dwarfdump prog # Dump specific sections dwarfdump --debug-info prog # types, variables, functions dwarfdump --debug-line prog # line number table dwarfdump --debug-loc prog # variable locations dwarfdump --debug-frame prog # call frame info # readelf alternatives (less verbose) readelf --debug-dump=info prog | head -100 readelf --debug-dump=lines prog | head -50 # llvm-dwarfdump (more readable output) llvm-dwarfdump prog llvm-dwarfdump --debug-info prog | grep "DW_AT_name" llvm-dwarfdump --statistics prog # summarize DWARF sizes
3. Reading DWARF DIE structure
# Sample dwarfdump output for a variable
DW_TAG_compile_unit
DW_AT_producer : "GNU C17 13.2.0"
DW_AT_language : DW_LANG_C11
DW_AT_name : "main.c"
DW_AT_comp_dir : "/home/user/project"
DW_TAG_subprogram
DW_AT_name : "add"
DW_AT_type : <0x42> → points to int type DIE
DW_AT_low_pc : 0x401130 ← function start address
DW_AT_high_pc : 0x401150 ← function end address
DW_TAG_formal_parameter
DW_AT_name : "a"
DW_AT_type : <0x42>
DW_AT_location : DW_OP_reg5 (rdi) ← lives in register rdi
DW_TAG_formal_parameter
DW_AT_name : "b"
DW_AT_location : DW_OP_reg4 (rsi) ← lives in register rsiTags (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:
# Compile with split DWARF gcc -g -gsplit-dwarf -O2 -c main.c -o main.o # Creates: main.o (object without full DWARF) + main.dwo (debug info) # Link (linker only processes small .o files, not large DWARF) gcc main.o -o prog # prog references main.dwo but doesn't embed it # GDB finds .dwo files via DW_AT_GNU_dwo_name attribute in prog gdb prog # works if main.dwo is in the same directory # Inspect the split reference readelf -S prog | grep "\.gnu_debuglink\|dwo" dwarfdump prog | grep "dwo_name" # shows path to .dwo files # Package .dwo files into a single .dwp for distribution dwp -o prog.dwp prog # GNU dwp tool llvm-dwp -o prog.dwp prog # LLVM version # With .dwp next to prog, GDB finds all debug info
5. debuginfod — remote debug symbol server
`debuginfod` serves debug symbols, source code, and executables via HTTP:
# Client: configure to use a debuginfod server export DEBUGINFOD_URLS="https://debuginfod.elfutils.org/" # GDB uses it automatically when symbols are missing gdb /usr/bin/git # GDB will fetch debug symbols from debuginfod if not locally installed # Explicit fetch debuginfod-find debuginfo /usr/bin/git # fetch debug info debuginfod-find source /usr/bin/git # fetch source # Distribution servers # Fedora: https://debuginfod.fedoraproject.org/ # Ubuntu: https://debuginfod.ubuntu.com/ # Debian: https://debuginfod.debian.net/ # elfutils: https://debuginfod.elfutils.org/ # Configure in GDB (gdb) set debuginfod enabled on (gdb) set debuginfod verbose 1 # Set up your own debuginfod server debuginfod -d /var/cache/debuginfod -p 8002 /path/to/binaries/ export DEBUGINFOD_URLS="http://localhost:8002"
6. LTO and DWARF
LTO affects DWARF debug information significantly:
# Full LTO: DWARF is generated after link-time optimization # Variables and functions may be merged, inlined, or eliminated gcc -flto -O2 -g main.c util.c -o prog # DWARF in prog reflects post-LTO state (may lose some info) # Thin LTO (better for debug info preservation) clang -flto=thin -O2 -g
A curated suite of AI agent skills for systems and low-level programming — C/C++, Rust, Zig, GPU, bare-metal firmware, Linux kernel/driver development, computer architecture, compiler internals, HPC, and more.
Repo: mohitmishra786/low-level-dev-skills
Other skills on low-level-dev-skills.
- /custom-allocators
Custom allocator skill for memory allocation strategies. Use when implementing pool/slab/arena allocators, tuning jemalloc/mimalloc, writing Rust GlobalAlloc, or benchmarking allocator performance. Activates on queries about jemalloc, mimalloc, tcmalloc, arena allocator,
Open skill - /numa-programming
NUMA programming skill for multi-socket memory locality. Use when detecting NUMA topology, binding processes with numactl, using libnuma API, building NUMA-aware data structures, or measuring remote access penalties. Activates on queries about numactl, libnuma, NUMA topology,
Open skill - /af-xdp
AF_XDP skill for high-performance XDP sockets. Use when creating AF_XDP sockets, configuring UMEM and XSK rings, XDP_REDIRECT programs, copy vs zero-copy mode, or comparing with DPDK. Activates on queries about AF_XDP, xsk_umem, XDP_REDIRECT, libbpf xsk, or zero-copy XDP.
Open skill - /dpdk
DPDK skill for userspace packet I/O. Use when initializing EAL, configuring PMD drivers, using mbuf pools and rte_ring, setting up huge pages, RSS, or testpmd validation. Activates on queries about DPDK, EAL, rte_eth_rx_burst, hugepages, PMD, or testpmd.
Open skill - /io-uring
io_uring skill for Linux async I/O. Use when building high-performance servers with liburing, multi-shot operations, provided buffers, fixed files, zero-copy send, or tokio-uring. Activates on queries about io_uring, SQE/CQE, liburing, IORING_OP_PROVIDE_BUFFERS, or io_uring vs
Open skill - /adc-dac-baremetal
Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates on queries about ADC bare-metal, sampling time, DMA ADC, or DAC channel setup.
Open skill

