[][src]Struct libdw::Dwarf

pub struct Dwarf<'dw> { /* fields omitted */ }

Methods

impl<'dw> Dwarf<'dw>[src]

pub fn open<P: AsRef<Path>>(path: P) -> Result<Dwarf<'static>>[src]

Open a Dwarf from a path.

Examples

let exe = std::env::current_exe().unwrap();
let dw = libdw::Dwarf::open(exe).unwrap();

pub fn from_fd<FD: AsRawFd>(fd: &'dw FD) -> Result<Dwarf<'dw>>[src]

Create a Dwarf from an open file.

Examples

let exe = std::env::current_exe().unwrap();
let f = std::fs::File::open(exe).unwrap();
let dw = libdw::Dwarf::from_fd(&f).unwrap();

pub fn from_elf(elf: &'dw Elf) -> Result<Dwarf<'dw>>[src]

Create a Dwarf from an existing Elf.

Examples

let exe = std::env::current_exe().unwrap();
let elf = libelf::Elf::open(exe).unwrap();
let dw = libdw::Dwarf::from_elf(&elf).unwrap();

pub unsafe fn from_raw(dwarf: *mut Dwarf) -> Dwarf<'dw>[src]

Create a Dwarf from a raw FFI pointer.

Safety

This function is unsafe because there is no guarantee that the given pointer is a valid libdw handle, nor whether the lifetime inferred is appropriate. This does not take ownership of the underlying object, so the caller must ensure it outlives the returned Dwarf wrapper.

pub fn get_elf(&'dw self) -> Elf<'dw>[src]

Important traits for CompileUnits<'dw>
pub fn compile_units(&'dw self) -> CompileUnits<'dw>[src]

Important traits for TypeUnits<'dw>
pub fn type_units(&'dw self) -> TypeUnits<'dw>[src]

pub fn as_ptr(&self) -> *mut Dwarf[src]

Trait Implementations

impl<'dw> Drop for Dwarf<'dw>[src]

impl<'dw> Debug for Dwarf<'dw>[src]

Auto Trait Implementations

impl<'dw> !Send for Dwarf<'dw>

impl<'dw> Unpin for Dwarf<'dw>

impl<'dw> !Sync for Dwarf<'dw>

impl<'dw> !UnwindSafe for Dwarf<'dw>

impl<'dw> !RefUnwindSafe for Dwarf<'dw>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]