Crate addr2line

source ·
Expand description

This crate provides a cross-platform library and binary for translating addresses into function names, file names and line numbers. Given an address in an executable or an offset in a section of a relocatable object, it uses the debugging information to figure out which file name and line number are associated with it.

When used as a library, files must first be loaded using the object crate. A context can then be created with Context::new. The context caches some of the parsed information so that multiple lookups are efficient. Location information is obtained with Context::find_location or Context::find_location_range. Function information is obtained with Context::find_frames, which returns a frame for each inline function. Each frame contains both name and location.

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

Currently this library only provides information from the DWARF debugging information, which is parsed using gimli. The example CLI wrapper also uses symbol table information provided by the object crate.

Re-exports§

Structs§

  • The state necessary to perform address to line translation.
  • A function frame.
  • An iterator over function frames.
  • A function name.
  • A source location.
  • Iterator over Locations in a range of addresses, returned by Context::find_location_range.
  • This struct contains the information needed to find split DWARF data and to produce a gimli::Dwarf<R> for it.

Enums§

  • Operations that consult debug information may require additional files to be loaded if split DWARF is being used. This enum returns the result of the operation in the Break variant, or information about the split DWARF that is required and a continuation to invoke once it is available in the Continue variant.

Traits§

  • This trait represents a partially complete operation that can be resumed once a load of needed split DWARF data is completed or abandoned by the API consumer.

Functions§

  • Demangle a symbol name using the demangling scheme for the given language.
  • Apply ‘best effort’ demangling of a symbol name.