Struct libdw::Dwarf
[−]
[src]
pub struct Dwarf<'dw> { /* fields omitted */ }
Methods
impl<'dw> Dwarf<'dw>
[src]
fn open<P: AsRef<Path>>(path: P) -> Result<Dwarf<'static>>
Open a Dwarf
from a path.
Examples
let exe = std::env::current_exe().unwrap(); let dw = libdw::Dwarf::open(exe).unwrap();
fn from_fd<FD: AsRawFd>(fd: &'dw FD) -> Result<Dwarf<'dw>>
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();
fn from_elf(elf: &'dw Elf) -> Result<Dwarf<'dw>>
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();
unsafe fn from_raw(dwarf: *mut Dwarf) -> Dwarf<'dw>
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.