pub struct Dwarf<'a> { /* private fields */ }Expand description
DWARF debugging information parsed from an ELF image.
Dwarf encapsulates parsed DWARF sections and a mapping from compile
unit offsets to address ranges. It provides helpers to build the DWARF
representation from an executable and resolve addresses to source
locations.
Implementations§
Source§impl<'a> Dwarf<'a>
impl<'a> Dwarf<'a>
Sourcepub fn build(process: &'a Info) -> Result<Self>
pub fn build(process: &'a Info) -> Result<Self>
Builds a Dwarf struct from the given process information.
§Arguments
process- The process information.
§Errors
Returns an Err upon any failure to retrieve ELF sections or parse DWARF format.
§Returns
Returns a Dwarf struct on success, wrapped in an Ok variant. Returns an error on failure, wrapped in an Err variant.
Sourcepub fn addr2line(&self, addr: u64) -> Result<Option<LineInfo>>
pub fn addr2line(&self, addr: u64) -> Result<Option<LineInfo>>
Resolves the source file name and line number for a given address in the binary.
§Arguments
addr: The address in the binary’s address space.
§Errors
Returns an error if there’s any failure in reading or parsing the DWARF debug information.
§Returns
Ok(Some(LineInfo)): The resolved source file name and line number.Ok(None): The address does not correspond to any source line information.Err: Error reading or parsing the DWARF information.
Auto Trait Implementations§
impl<'a> Freeze for Dwarf<'a>
impl<'a> RefUnwindSafe for Dwarf<'a>
impl<'a> Send for Dwarf<'a>
impl<'a> Sync for Dwarf<'a>
impl<'a> Unpin for Dwarf<'a>
impl<'a> UnsafeUnpin for Dwarf<'a>
impl<'a> UnwindSafe for Dwarf<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more