Skip to main content

Dwarf

Struct Dwarf 

Source
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>

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.