pub struct SymbolFile {
    pub files: HashMap<u32, String, RandomState>,
    pub publics: Vec<PublicSymbol, Global>,
    pub functions: RangeMap<u64, Function>,
    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

files: HashMap<u32, String, RandomState>

The set of source files involved in compilation.

publics: Vec<PublicSymbol, Global>

Publicly visible symbols.

functions: RangeMap<u64, Function>

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

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.

parse but async

Fill in as much source information for frame as possible.

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

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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