Struct minidump_processor::symbols::SymbolFile
source · [−]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: u64The 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: u64The 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: u64The 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: u64The 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
sourceimpl SymbolFile
impl SymbolFile
sourcepub fn parse<R>(
input_reader: R,
callback: impl FnMut(&[u8])
) -> Result<SymbolFile, SymbolError> where
R: Read,
pub fn parse<R>(
input_reader: R,
callback: impl FnMut(&[u8])
) -> Result<SymbolFile, SymbolError> where
R: Read,
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.
sourcepub async fn parse_async(
response: Response,
callback: impl FnMut(&[u8])
) -> Result<SymbolFile, SymbolError>
pub async fn parse_async(
response: Response,
callback: impl FnMut(&[u8])
) -> Result<SymbolFile, SymbolError>
parse but async
pub fn from_bytes(bytes: &[u8]) -> Result<SymbolFile, SymbolError>
pub fn from_file(path: &Path) -> Result<SymbolFile, SymbolError>
sourcepub fn fill_symbol(&self, module: &dyn Module, frame: &mut dyn FrameSymbolizer)
pub fn fill_symbol(&self, module: &dyn Module, frame: &mut dyn FrameSymbolizer)
Fill in as much source information for frame as possible.
pub fn walk_frame(
&self,
module: &dyn Module,
walker: &mut dyn FrameWalker
) -> Option<()>
sourcepub fn find_nearest_public(&self, addr: u64) -> Option<&PublicSymbol>
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
sourceimpl Debug for SymbolFile
impl Debug for SymbolFile
sourceimpl PartialEq<SymbolFile> for SymbolFile
impl PartialEq<SymbolFile> for SymbolFile
sourcefn eq(&self, other: &SymbolFile) -> bool
fn eq(&self, other: &SymbolFile) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &SymbolFile) -> bool
fn ne(&self, other: &SymbolFile) -> bool
This method tests for !=.
impl StructuralPartialEq for SymbolFile
Auto Trait Implementations
impl RefUnwindSafe for SymbolFile
impl Send for SymbolFile
impl Sync for SymbolFile
impl Unpin for SymbolFile
impl UnwindSafe for SymbolFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more