Struct addr2line::Context [−][src]
pub struct Context<R: Reader> { /* fields omitted */ }Expand description
The state necessary to perform address to line translation.
Constructing a Context is somewhat costly, so users should aim to reuse Contexts
when performing lookups for many addresses in the same executable.
Implementations
Construct a new Context.
The resulting Context uses gimli::EndianRcSlice<gimli::RunTimeEndian>.
This means it is not thread safe, has no lifetime constraints (since it copies
the input data), and works for any endianity.
Performance sensitive applications may want to use Context::from_dwarf
with a more specialised gimli::Reader implementation.
Construct a new Context.
Optionally also use a supplementary object file.
The resulting Context uses gimli::EndianRcSlice<gimli::RunTimeEndian>.
This means it is not thread safe, has no lifetime constraints (since it copies
the input data), and works for any endianity.
Performance sensitive applications may want to use Context::from_dwarf_with_sup
with a more specialised gimli::Reader implementation.
pub fn from_sections(
debug_abbrev: DebugAbbrev<R>,
debug_addr: DebugAddr<R>,
debug_aranges: DebugAranges<R>,
debug_info: DebugInfo<R>,
debug_line: DebugLine<R>,
debug_line_str: DebugLineStr<R>,
debug_ranges: DebugRanges<R>,
debug_rnglists: DebugRngLists<R>,
debug_str: DebugStr<R>,
debug_str_offsets: DebugStrOffsets<R>,
default_section: R
) -> Result<Self, Error>
pub fn from_sections(
debug_abbrev: DebugAbbrev<R>,
debug_addr: DebugAddr<R>,
debug_aranges: DebugAranges<R>,
debug_info: DebugInfo<R>,
debug_line: DebugLine<R>,
debug_line_str: DebugLineStr<R>,
debug_ranges: DebugRanges<R>,
debug_rnglists: DebugRngLists<R>,
debug_str: DebugStr<R>,
debug_str_offsets: DebugStrOffsets<R>,
default_section: R
) -> Result<Self, Error>
Construct a new Context from DWARF sections.
This method does not support using a supplementary object file.
Construct a new Context from an existing gimli::Dwarf object.
Find the DWARF unit corresponding to the given virtual memory address.
Find the source file and line corresponding to the given virtual memory address.
pub fn find_location_range(
&self,
probe_low: u64,
probe_high: u64
) -> Result<LocationRangeIter<'_, R>, Error>
pub fn find_location_range(
&self,
probe_low: u64,
probe_high: u64
) -> Result<LocationRangeIter<'_, R>, Error>
Return source file and lines for a range of addresses. For each location it also returns the address and size of the range of the underlying instructions.
Return an iterator for the function frames corresponding to the given virtual memory address.
If the probe address is not for an inline function then only one frame is returned.
If the probe address is for an inline function then the first frame corresponds to the innermost inline function. Subsequent frames contain the caller and call location, until an non-inline caller is reached.