pub struct SymbolTable { /* private fields */ }Expand description
Symbol table extracted from an ELF .symtab section.
Internally maintained as two sorted indices for O(log n) lookup in both directions:
by_addr— sorted by address, used bylookup_addr.by_name— sorted by name, used bylookup_name.
Implementations§
Source§impl SymbolTable
impl SymbolTable
Sourcepub fn lookup_addr(&self, addr: u32) -> Option<&Symbol>
pub fn lookup_addr(&self, addr: u32) -> Option<&Symbol>
Find the symbol that contains addr.
Returns the symbol whose range [sym.addr, sym.addr + sym.size) covers
addr. If sym.size == 0, only an exact address match is accepted.
Returns None if no symbol covers the address.
Sourcepub fn lookup_name(&self, name: &str) -> Option<&Symbol>
pub fn lookup_name(&self, name: &str) -> Option<&Symbol>
Find a symbol by its exact name.
Returns None if no symbol with that name exists.
Trait Implementations§
Source§impl Debug for SymbolTable
impl Debug for SymbolTable
Source§impl Default for SymbolTable
impl Default for SymbolTable
Source§fn default() -> SymbolTable
fn default() -> SymbolTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SymbolTable
impl RefUnwindSafe for SymbolTable
impl Send for SymbolTable
impl Sync for SymbolTable
impl Unpin for SymbolTable
impl UnsafeUnpin for SymbolTable
impl UnwindSafe for SymbolTable
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