Dwarf Expert logo

Dwarf Expert

OrganizationPopular
trailofbits
dwarf-expert

Analyzes DWARF debug information in compiled binaries. Use when inspecting .debug_* sections, DIE trees, or DW_TAG_/DW_AT_ entries with dwarfdump/llvm-dwarfdump or readelf, verifying debug info with llvm-dwarfdump --verify, answering DWARF standard questions, or writing code that parses DWARF (libdwarf, pyelftools, gimli).

Overview

Publishertrailofbits
Repositoryskills
Skill namedwarf-expert
Stars
7.1K
Forks
611
Bundled files
2
LicenseCC-BY-SA-4.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by trailofbits on GitHub. Read the source before you install it.

Installation

Install the Dwarf Expert AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/trailofbits/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/plugins/dwarf-expert/skills/dwarf-expert .claude/skills/dwarf-expert
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Dwarf Expert in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Dwarf Expert on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Dwarf Expert is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

DWARF Expert

Expertise for DWARF debug info: parsing and searching it, verifying its integrity, answering questions about the standard, and writing code that consumes it. Out of scope: runtime debugging (use gdb/lldb), reverse engineering beyond the DWARF sections (use Ghidra/IDA), and compiler-specific DWARF generation bugs.

Authoritative Sources

When precision matters, look standard details up instead of answering from memory:

  1. dwarfstd.org — the official specification. Web-search specific sections, e.g. "DWARF5 DW_TAG_subprogram attributes site:dwarfstd.org".
  2. LLVMllvm/lib/DebugInfo/DWARF/ is a reliable reference implementation: DWARFDie.cpp (DIE and attribute access), DWARFUnit.cpp (compilation units), DWARFDebugLine.cpp (line tables), DWARFVerifier.cpp (validation).
  3. libdwarf — the reference C implementation at github.com/davea42/libdwarf-code.

Parsing and Searching with dwarfdump

Prefer dwarfdump over readelf for DWARF-specific work. Two implementations exist — libdwarf's dwarfdump and LLVM's llvm-dwarfdump — with different options, and a bare dwarfdump command may be either: check dwarfdump --version first. The options below are LLVM's.

On macOS, linked Mach-O executables do not carry DWARF: it stays in the .o files until dsymutil collects it into a .dSYM bundle. Point dwarfdump at the dSYM (or the object files), not the executable. pyelftools is ELF-only — for Mach-O scripted work, stay with the LLVM tools.

  • --all: dump every DWARF section; --debug-info, --debug-line, etc. dump one
  • --show-children [--recurse-depth=<n>]: include child DIEs when printing selected entries — parameters, locals, and struct members are children of function and type DIEs
  • --show-parents [--parent-recurse-depth=<n>]: include parent DIEs
  • --show-form: print attribute form types, for when encoding details matter
  • --find=<name>: exact-name lookup via the accelerator tables — fast but not exhaustive; fall back to --name when it misses
  • --name=<pattern> [--ignore-case] [--regex]: exhaustive DIE-name search
  • --lookup=<address>: find the DIE covering an address
  • --verbose: print low-level encoding detail

Searching DIEs

Escalate through these strategies as the query grows more complex:

  1. Name or address match: --find, then --name; --lookup for addresses.
  2. Attribute or type queries (e.g. all parameters of type float *): dump and filter. grep -B pulls in the header line carrying each DIE's offset: llvm-dwarfdump file | grep -B 5 "float \*" | grep DW_TAG_formal_parameter, then print each DIE at its offset with --debug-info=<offset> --show-children (--lookup takes a program address, not a DIE offset).
  3. Multi-attribute or structural queries: when grep pipelines turn brittle, write a Python script using pyelftools instead.

Verifying DWARF Integrity

  • llvm-dwarfdump --verify <binary>: structural checks (unit chains, DIE relationships, address ranges). --error-display=<quiet|summary|details|full> controls detail; --verify-json=<path> writes a machine-readable error summary; --quiet for exit-code-only checks.
  • llvm-dwarfdump --statistics <binary>: debug-info quality metrics as JSON — compare across compiler versions or optimization levels to catch regressions.

Verify after producing DWARF (compilers, binary rewriters), when a debugger misbehaves on a binary, and when developing DWARF tooling against known-good files.

When a current-generation compiler emitted an old DWARF version, the build explicitly passed -gdwarf-N — modern gcc and clang default to v4/v5, so check the build system rather than assuming a toolchain default. GCC embeds its flags in DW_AT_producer, so the pin is often readable right there; clang's producer string carries no flags. Old versions remain common in the wild and read the same way apart from surface forms: in v2 output, member offsets appear as location expressions (DW_OP_plus_uconst) and linkage names as DW_AT_MIPS_linkage_name.

readelf

For general ELF structure, or when dwarfdump is unavailable:

  • --debug-dump=<section>: dump a DWARF section (info, line, ...)
  • --dwarf-depth=<n> / --dwarf-start=<n>: limit DIE depth / start offset

Writing Code That Parses DWARF

Prefer an existing library over parsing by hand:

LibraryLanguageNotes
libdwarfC/C++github.com/davea42/libdwarf-code — low-level; used to implement dwarfdump
pyelftoolsPythongithub.com/eliben/pyelftools — also parses ELF in general
gimliRustgithub.com/gimli-rs/gimli — pair with object to load container files
debug/dwarfGostandard library
LibObjectFile.NETgithub.com/xoofx/LibObjectFile — also handles ELF/PE object files

Default to Python with pyelftools for one-off scripts unless the task dictates otherwise.

DWARF-specific pitfalls to handle — and to check for when reviewing DWARF code:

  • Attributes are optional: a DIE may omit DW_AT_name, DW_AT_type, ranges, etc.
  • Attribute indirection: a DIE's attributes may live on the DIE referenced by its DW_AT_abstract_origin (inlined instances) or DW_AT_specification (out-of-line definitions) — resolve the chain before concluding data is absent.
  • Type chains: qualifiers and modifiers (DW_TAG_const_type, DW_TAG_pointer_type, ...) wrap the underlying type; walk DW_AT_type links to reach the base type.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Dwarf Expert AI skill do?

Analyzes DWARF debug information in compiled binaries. Use when inspecting .debug_* sections, DIE trees, or DW_TAG_/DW_AT_ entries with dwarfdump/llvm-dwarfdump or readelf, verifying debug info with llvm-dwarfdump --verify, answering DWARF standard questions, or writing code that parses DWARF (libdwarf, pyelftools, gimli).

Why use Dwarf Expert on TypingMind?

Because you install it once and use it with any model. Dwarf Expert is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Dwarf Expert in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/trailofbits/skills/tree/main/plugins/dwarf-expert/skills/dwarf-expert. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Dwarf Expert?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Dwarf Expert?

As many as you like. As long as a model supports skills, you can use Dwarf Expert with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Dwarf Expert AI skill free?

Yes. It is published on GitHub by trailofbits under the CC-BY-SA-4.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇