Skip to main content

SymbolMapBuilder

Struct SymbolMapBuilder 

Source
pub struct SymbolMapBuilder(/* private fields */);
Expand description

A builder for a SymbolMap.

Implementations§

Source§

impl SymbolMapBuilder

Source

pub fn new() -> Self

Construct a new symbol map builder.

Source

pub fn build<'data, O>(self, object: &O) -> SymbolMap<SymbolMapName<'data>>
where O: Object<'data> + ?Sized,

Read the symbols from an object file to create a symbol map.

The map will only contain defined text and data symbols. The dynamic symbol table will only be used if there are no debugging symbols.

If symbol sizes are unknown then we guess the size based on the next symbol or end of section.

This does not work well if multiple sections use the same base address, which is common for relocatable object files. The symbols will be overlapping, and the symbol returned by lookups may be indeterministic. Additionally, if the symbol size is unknown then we may use a symbol or section end address from a different section to guess its size.

Trait Implementations§

Source§

impl Debug for SymbolMapBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SymbolMapBuilder

Source§

fn default() -> SymbolMapBuilder

Returns the “default value” for a type. Read more

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, 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.