Search

Lib.rs

› Development tools › Debugging | Parser implementations
#elf #dwarf #eh-frame

no-std gimli

A library for reading and writing the DWARF debugging format

by Philip Craig, Nick Fitzgerald and 73 contributors

  • Audit
  • Install
  • API reference
  • GitHub repo (gimli-rs)

45 releases (breaking)

Uses new Rust 2024

0.33.1 Mar 29, 2026
0.32.3 Sep 13, 2025
0.32.0 Jun 11, 2025
0.31.1 Oct 4, 2024
0.3.0 Jul 27, 2016

#7 in Debugging

Download history 5504815/week @ 2026-01-18 5761365/week @ 2026-01-25 5845762/week @ 2026-02-01 6212835/week @ 2026-02-08 5506394/week @ 2026-02-15 5245933/week @ 2026-02-22 6445063/week @ 2026-03-01 6642933/week @ 2026-03-08 6200197/week @ 2026-03-15 5449105/week @ 2026-03-22 5868424/week @ 2026-03-29 5845520/week @ 2026-04-05 6126102/week @ 2026-04-12 6346738/week @ 2026-04-19 6869750/week @ 2026-04-26 7114812/week @ 2026-05-03

26,977,689 downloads per month
Used in 12,688 crates (160 directly)

MIT/Apache

2MB
41K SLoC

gimli

Build Status Coverage Status

gimli is a library for reading and writing the DWARF debugging format.

  • Zero copy: everything is just a reference to the original input buffer. No copies of the input data get made.

  • Lazy: you can iterate compilation units without parsing their contents. Parse only as many debugging information entry (DIE) trees as you iterate over. gimli also uses DW_AT_sibling references to avoid parsing a DIE's children to find its next sibling, when possible.

  • Cross-platform: gimli makes no assumptions about what kind of object file you're working with. The flipside to that is that it's up to you to provide an ELF loader on Linux or Mach-O loader on macOS.

    • Unsure which object file parser to use? Try the cross-platform object crate. See the gimli-examples crate for usage with gimli.

Install

To add a gimli dependency to your Cargo.toml, run:

$ cargo add gimli

The minimum supported Rust version is 1.88.

Documentation

  • Documentation on docs.rs

  • Example programs:

    • A simple .debug_info parser

    • A simple .debug_line parser

    • A simple DWARF writer

    • A simple DWARF converter to read DWARF sections then write them back out again.

    • A DWARF converter that modifies the DWARF by removing entries for dead code.

    • A dwarfdump clone

    • An addr2line clone

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)

at your option.

Contribution

See CONTRIBUTING.md for hacking.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

  • optional fallible-iterator 0.3
  • write fnv
  • write hashbrown 0.16
  • write indexmap
  • rustc-dep-of-std? rustc-std-workspace-alloc
  • rustc-dep-of-std? rustc-std-workspace-core
  • endian-reader std stable_deref_trait
  • dev criterion 0.8
  • dev test-assembler

Other features

  • read
  • read-all
  • read-core
Related: leb128, ddbug, cpp_demangle, object, addr2line
See also: blazesym, quick-xml, log, asm-annotate, blazesym-c, blazecli, rustc-demangle, x509-parser, backtrace, walrus, lexical-core

Lib.rs is an unofficial list of Rust/Cargo crates, created by kornelski. It contains data from multiple sources, including heuristics, and manually curated data. Content of this page is not necessarily endorsed by the authors of the crate. This site is not affiliated with nor endorsed by the Rust Project. If something is missing or incorrect, please file a bug.