SymbolMap

Struct SymbolMap 

Source
pub struct SymbolMap { /* private fields */ }

Implementations§

Source§

impl SymbolMap

Source

pub fn new() -> Self

Source

pub fn from_symbols(symbols: Vec<Symbol>) -> Self

Source

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, SymbolMapParseError>

Source

pub fn load<P: AsRef<Path>>( &mut self, path: P, ) -> Result<(), SymbolMapParseError>

Source

pub fn to_file<P: AsRef<Path>>( &self, path: P, ) -> Result<(), SymbolMapWriteError>

Source

pub fn for_address( &self, address: u32, ) -> Option<impl DoubleEndedIterator<Item = (SymbolIndex, &Symbol)>>

Source

pub fn by_address( &self, address: u32, ) -> Result<Option<(SymbolIndex, &Symbol)>, SymbolMapError>

Source

pub fn first_at_address(&self, address: u32) -> Option<(SymbolIndex, &Symbol)>

Source

pub fn for_name( &self, name: &str, ) -> Option<impl DoubleEndedIterator<Item = (SymbolIndex, &Symbol)>>

Source

pub fn by_name( &self, name: &str, ) -> Result<Option<(SymbolIndex, &Symbol)>, SymbolMapError>

Source

pub fn iter_by_address(&self, range: Range<u32>) -> SymbolIterator<'_>

Source

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.

Source

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.

Source

pub fn iter(&self) -> impl Iterator<Item = &Symbol>

Source

pub fn indices_by_address(&self) -> impl Iterator<Item = &SymbolIndex>

Source

pub fn get(&self, index: SymbolIndex) -> Option<&Symbol>

Source

pub fn get_mut(&mut self, index: SymbolIndex) -> Option<&mut Symbol>

Source

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.

Source

pub fn add(&mut self, symbol: Symbol) -> (SymbolIndex, &Symbol)

Source

pub fn add_if_new_address( &mut self, symbol: Symbol, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn get_function( &self, address: u32, ) -> Result<Option<(SymFunction, &Symbol)>, SymbolMapError>

Source

pub fn get_function_mut( &mut self, address: u32, ) -> Result<Option<&mut Symbol>, SymbolMapError>

Source

pub fn get_function_containing( &self, addr: u32, ) -> Option<(SymFunction, &Symbol)>

Source

pub fn functions(&self) -> impl Iterator<Item = (SymFunction, &Symbol)>

Source

pub fn clone_functions(&self) -> Vec<(SymFunction, Symbol)>

Source

pub fn data_symbols(&self) -> impl Iterator<Item = (SymData, &Symbol)>

Source

pub fn bss_symbols(&self) -> impl Iterator<Item = (SymBss, &Symbol)>

Source

pub fn label_name(addr: u32) -> String

Source

pub fn add_label( &mut self, addr: u32, thumb: bool, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn add_external_label( &mut self, addr: u32, thumb: bool, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn get_label(&self, addr: u32) -> Result<Option<&Symbol>, SymbolMapError>

Source

pub fn add_pool_constant( &mut self, addr: u32, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn get_pool_constant( &self, addr: u32, ) -> Result<Option<&Symbol>, SymbolMapError>

Source

pub fn get_jump_table( &self, addr: u32, ) -> Result<Option<(SymJumpTable, &Symbol)>, SymbolMapError>

Source

pub fn add_function(&mut self, function: &Function) -> (SymbolIndex, &Symbol)

Source

pub fn add_unknown_function( &mut self, name: String, addr: u32, thumb: bool, ) -> (SymbolIndex, &Symbol)

Source

pub fn add_jump_table( &mut self, table: &JumpTable, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn add_data( &mut self, name: Option<String>, addr: u32, data: SymData, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn add_ambiguous_data( &mut self, name: Option<String>, addr: u32, data: SymData, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn add_skip_data( &mut self, name: Option<String>, addr: u32, data: SymData, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn get_data( &self, addr: u32, ) -> Result<Option<(SymData, &Symbol)>, SymbolMapError>

Source

pub fn add_bss( &mut self, name: Option<String>, addr: u32, data: SymBss, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

pub fn add_ambiguous_bss( &mut self, name: Option<String>, addr: u32, data: SymBss, ) -> Result<(SymbolIndex, &Symbol), SymbolMapError>

Source

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§

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> Same for T

Source§

type Output = T

Should always be Self
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.