pub struct SymbolFile {
Show 14 fields pub module_id: String, pub debug_file: String, pub files: HashMap<u32, String>, pub publics: Vec<PublicSymbol>, pub functions: RangeMap<u64, Function>, pub inline_origins: HashMap<u32, String>, pub cfi_stack_info: RangeMap<u64, StackInfoCfi>, pub win_stack_framedata_info: RangeMap<u64, StackInfoWin>, pub win_stack_fpo_info: RangeMap<u64, StackInfoWin>, pub url: Option<String>, pub ambiguities_repaired: u64, pub ambiguities_discarded: u64, pub corruptions_discarded: u64, pub cfi_eval_corruptions: u64,
}
Expand description

A parsed .sym file containing debug symbols.

Fields§

§module_id: String§debug_file: String§files: HashMap<u32, String>

The set of source files involved in compilation.

§publics: Vec<PublicSymbol>

Publicly visible symbols.

§functions: RangeMap<u64, Function>

Functions.

§inline_origins: HashMap<u32, String>

Function names for inlined functions.

§cfi_stack_info: RangeMap<u64, StackInfoCfi>

DWARF CFI unwind information.

§win_stack_framedata_info: RangeMap<u64, StackInfoWin>

Windows unwind information (frame data).

§win_stack_fpo_info: RangeMap<u64, StackInfoWin>

Windows unwind information (FPO data).

§url: Option<String>

If the symbol file was loaded from a URL, this is the url

§ambiguities_repaired: u64

The number of times the parser found that the symbol file was strictly ambiguous but simple heuristics repaired it. (e.g. two STACK WIN entries overlapped, but the second was a suffix of the first, so we just truncated the first.)

Ideally dump_syms would never output this kind of thing, but it’s tolerable.

§ambiguities_discarded: u64

The number of times the parser found that the symbol file was ambiguous and just randomly picked one of the options to make progress.

e.g. two STACK WIN entries with identical ranges but different values, so one was discarded arbitrarily.

§corruptions_discarded: u64

The number of times the parser found that a section of the file (generally a line) was corrupt and discarded it.

e.g. a STACK WIN entry where the type and has_program fields have inconsistent values.

§cfi_eval_corruptions: u64

The number of times the cfi evaluator failed out in a way that implies the cfi entry is fundamentally corrupt.

This isn’t detectected during parsing for two reasons:

  • We don’t parse cfi program strings until we are requested to execute them (there’s ~millions of program strings which will never need to be parsed, so eagerly parsing them would be horribly expensive and pointless for anything but debug stats.)

  • A program string may technically parse but still be impossible to fully evaluate. For instance, it might try to pop values from its internal stack when there are none left.

This number may be inflated if a corrupt cfi entry occurs in multiple frames, as each attempted eval will be counted.

This number does not include cfi evaluations that failed in ways that may be a result of incorrect input memory/registers (e.g. failing to evaluate a “dereference pointer” instruction because the pointer was not mapped memory). In these situations the cfi entry may still be correct.

Implementations§

source§

impl SymbolFile

source

pub fn parse<R: Read>( input_reader: R, callback: impl FnMut(&[u8]) ) -> Result<SymbolFile, SymbolError>

Parse a SymbolFile from the given Reader.

Every time a chunk of the input is parsed, that chunk will be passed to callback to allow you to do something else with the data as it’s streamed in (e.g. you can save the input to a cache).

The reader is wrapped in a buffer reader so you shouldn’t buffer the input yourself.

source

pub fn from_bytes(bytes: &[u8]) -> Result<SymbolFile, SymbolError>

source

pub fn from_file(path: &Path) -> Result<SymbolFile, SymbolError>

source

pub fn fill_symbol(&self, module: &dyn Module, frame: &mut dyn FrameSymbolizer)

Fill in as much source information for frame as possible.

source

pub fn walk_frame( &self, module: &dyn Module, walker: &mut dyn FrameWalker ) -> Option<()>

source

pub fn find_nearest_public(&self, addr: u64) -> Option<&PublicSymbol>

Find the nearest PublicSymbol whose address is less than or equal to addr.

Trait Implementations§

source§

impl Debug for SymbolFile

source§

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

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

impl PartialEq for SymbolFile

source§

fn eq(&self, other: &SymbolFile) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for SymbolFile

source§

impl StructuralPartialEq for SymbolFile

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

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more