pub struct SymbolMap { /* private fields */ }Implementations§
Source§impl SymbolMap
impl SymbolMap
pub fn new() -> Self
pub fn from_symbols(symbols: Vec<Symbol>) -> Self
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, SymbolMapParseError>
pub fn load<P: AsRef<Path>>( &mut self, path: P, ) -> Result<(), SymbolMapParseError>
pub fn to_file<P: AsRef<Path>>( &self, path: P, ) -> Result<(), SymbolMapWriteError>
pub fn for_address( &self, address: u32, ) -> Option<impl DoubleEndedIterator<Item = (SymbolIndex, &Symbol)>>
pub fn by_address( &self, address: u32, ) -> Result<Option<(SymbolIndex, &Symbol)>, SymbolMapError>
pub fn first_at_address(&self, address: u32) -> Option<(SymbolIndex, &Symbol)>
pub fn for_name( &self, name: &str, ) -> Option<impl DoubleEndedIterator<Item = (SymbolIndex, &Symbol)>>
pub fn by_name( &self, name: &str, ) -> Result<Option<(SymbolIndex, &Symbol)>, SymbolMapError>
pub fn iter_by_address(&self, range: Range<u32>) -> SymbolIterator<'_> ⓘ
Sourcepub fn first_symbol_before(
&self,
max_address: u32,
) -> Option<Vec<(SymbolIndex, &Symbol)>>
pub fn first_symbol_before( &self, max_address: u32, ) -> Option<Vec<(SymbolIndex, &Symbol)>>
Returns the first symbol before the given address, or multiple symbols if they are at the same address.
Sourcepub fn first_symbol_after(
&self,
min_address: u32,
) -> Option<Vec<(SymbolIndex, &Symbol)>>
pub fn first_symbol_after( &self, min_address: u32, ) -> Option<Vec<(SymbolIndex, &Symbol)>>
Returns the first symbol after the given address, or multiple symbols if they are at the same address.
pub fn iter(&self) -> impl Iterator<Item = &Symbol>
pub fn indices_by_address(&self) -> impl Iterator<Item = &SymbolIndex>
pub fn get(&self, index: SymbolIndex) -> Option<&Symbol>
pub fn get_mut(&mut self, index: SymbolIndex) -> Option<&mut Symbol>
Sourcepub fn get_symbol_containing(
&self,
addr: u32,
section_end: u32,
) -> Result<Option<(&Symbol, u32)>, SymbolMapError>
pub fn get_symbol_containing( &self, addr: u32, section_end: u32, ) -> Result<Option<(&Symbol, u32)>, SymbolMapError>
Returns the symbol containing the given address and the symbol’s size.
pub fn add(&mut self, symbol: Symbol) -> (SymbolIndex, &Symbol)
pub fn add_if_new_address( &mut self, symbol: Symbol, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
pub fn get_function( &self, address: u32, ) -> Result<Option<(SymFunction, &Symbol)>, SymbolMapError>
pub fn get_function_mut( &mut self, address: u32, ) -> Result<Option<&mut Symbol>, SymbolMapError>
pub fn get_function_containing( &self, addr: u32, ) -> Option<(SymFunction, &Symbol)>
pub fn functions(&self) -> impl Iterator<Item = (SymFunction, &Symbol)>
pub fn clone_functions(&self) -> Vec<(SymFunction, Symbol)>
pub fn data_symbols(&self) -> impl Iterator<Item = (SymData, &Symbol)>
pub fn bss_symbols(&self) -> impl Iterator<Item = (SymBss, &Symbol)>
pub fn label_name(addr: u32) -> String
pub fn add_label( &mut self, addr: u32, thumb: bool, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
Sourcepub fn add_external_label(
&mut self,
addr: u32,
thumb: bool,
) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
pub fn add_external_label( &mut self, addr: u32, thumb: bool, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
See SymLabel::external.
pub fn get_label(&self, addr: u32) -> Result<Option<&Symbol>, SymbolMapError>
pub fn add_pool_constant( &mut self, addr: u32, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
pub fn get_pool_constant( &self, addr: u32, ) -> Result<Option<&Symbol>, SymbolMapError>
pub fn get_jump_table( &self, addr: u32, ) -> Result<Option<(SymJumpTable, &Symbol)>, SymbolMapError>
pub fn add_function(&mut self, function: &Function) -> (SymbolIndex, &Symbol)
pub fn add_unknown_function( &mut self, name: String, addr: u32, thumb: bool, ) -> (SymbolIndex, &Symbol)
pub fn add_jump_table( &mut self, table: &JumpTable, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
pub fn add_data( &mut self, name: Option<String>, addr: u32, data: SymData, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
pub fn add_ambiguous_data( &mut self, name: Option<String>, addr: u32, data: SymData, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
pub fn add_skip_data( &mut self, name: Option<String>, addr: u32, data: SymData, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
pub fn get_data( &self, addr: u32, ) -> Result<Option<(SymData, &Symbol)>, SymbolMapError>
pub fn add_bss( &mut self, name: Option<String>, addr: u32, data: SymBss, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
pub fn add_ambiguous_bss( &mut self, name: Option<String>, addr: u32, data: SymBss, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>
Sourcepub fn rename_by_address(
&mut self,
address: u32,
new_name: &str,
) -> Result<bool, SymbolMapError>
pub fn rename_by_address( &mut self, address: u32, new_name: &str, ) -> Result<bool, SymbolMapError>
Renames a symbol at the given address to the new name.
Returns true if the symbol was renamed, or false if it was already named the same.
Auto Trait Implementations§
impl Freeze for SymbolMap
impl RefUnwindSafe for SymbolMap
impl Send for SymbolMap
impl Sync for SymbolMap
impl Unpin for SymbolMap
impl UnwindSafe for SymbolMap
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