#debug-information #dwarf #elf #line-numbers #symbolicate #call-stack

no-std bin+lib addr2line

A cross-platform symbolication library written in Rust, using gimli

32 releases (breaking)

0.24.2 Oct 4, 2024
0.24.1 Jul 26, 2024
0.23.0 May 26, 2024
0.21.0 Aug 13, 2023
0.1.0 Dec 3, 2016

#16 in Debugging

Download history 1550979/week @ 2024-07-18 1571462/week @ 2024-07-25 1525191/week @ 2024-08-01 1613417/week @ 2024-08-08 1567569/week @ 2024-08-15 1612537/week @ 2024-08-22 1503390/week @ 2024-08-29 1709783/week @ 2024-09-05 1667009/week @ 2024-09-12 1639229/week @ 2024-09-19 1731267/week @ 2024-09-26 1794653/week @ 2024-10-03 1717394/week @ 2024-10-10 1798341/week @ 2024-10-17 1778572/week @ 2024-10-24 1723959/week @ 2024-10-31

7,372,419 downloads per month
Used in 34,809 crates (36 directly)

Apache-2.0 OR MIT

120KB
2.5K SLoC

addr2line

Coverage Status

addr2line provides a cross-platform library for retrieving per-address debug information from files with DWARF debug information. Given an address, it can return the file name, line number, and function name associated with that address, as well as the inline call stack leading to that address.

The crate has a CLI wrapper around the library which provides some of the functionality of the addr2line command line tool distributed with GNU binutils.

Quickstart

If you want to provide your own file loading and memory management, use addr2line::Context instead of addr2line::Loader.

Performance

addr2line optimizes for speed over memory by caching parsed information. The DWARF information is parsed lazily where possible.

The library aims to perform similarly to equivalent existing tools such as addr2line from binutils, eu-addr2line from elfutils, and llvm-addr2line from the llvm project. Current benchmarks show a performance improvement in all cases:

addr2line runtime

License

Licensed under either of

at your option.

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

~2–11MB
~137K SLoC