Struct pdb_addr2line::Context

source ·
pub struct Context<'a, 's> { /* private fields */ }
Expand description

The main API of this crate. Resolves addresses to function information.

Implementations§

source§

impl<'a, 's> Context<'a, 's>

source

pub fn new_from_parts( module_info_provider: &'a (dyn ModuleProvider<'s> + Sync), sections: &[ImageSectionHeader], address_map: &'a AddressMap<'s>, global_symbols: &'a SymbolTable<'s>, string_table: Option<&'a StringTable<'s>>, debug_info: &'a DebugInformation<'_>, type_formatter: MaybeOwned<'a, TypeFormatter<'a, 's>> ) -> Result<Self, Error>

Create a Context manually. Most consumers will want to use ContextPdbData::make_context instead.

However, if you interact with a PDB directly and parse some of its contents for other uses, you may want to call this method in order to avoid overhead from repeatedly parsing the same streams.

source

pub fn function_count(&self) -> usize

The number of functions found in public symbols.

source

pub fn functions(&self) -> FunctionIter<'_, 'a, 's>

Iterate over all functions in the modules.

source

pub fn find_function(&self, probe: u32) -> Result<Option<Function>, Error>

Find the function whose code contains the provided address. The return value only contains the function name and the rva range, but no file or line information.

source

pub fn find_frames( &self, probe: u32 ) -> Result<Option<FunctionFrames<'_>>, Error>

Find information about the source code which generated the instruction at the provided address. This information includes the function name, file name and line number, of the containing procedure and of any functions that were inlined into the procedure by the compiler, at that address.

A lot of information is cached so that repeated calls are fast.

Auto Trait Implementations§

§

impl<'a, 's> !RefUnwindSafe for Context<'a, 's>

§

impl<'a, 's> Send for Context<'a, 's>

§

impl<'a, 's> !Sync for Context<'a, 's>

§

impl<'a, 's> Unpin for Context<'a, 's>

§

impl<'a, 's> !UnwindSafe for Context<'a, 's>

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

§

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

§

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.