Struct breakpad_symbols::SymbolFile
source · 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
impl SymbolFile
sourcepub fn parse<R: Read>(
input_reader: R,
callback: impl FnMut(&[u8])
) -> Result<SymbolFile, SymbolError>
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.
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§
source§impl Debug for SymbolFile
impl Debug for SymbolFile
source§impl PartialEq for SymbolFile
impl PartialEq for SymbolFile
source§fn eq(&self, other: &SymbolFile) -> bool
fn eq(&self, other: &SymbolFile) -> bool
self
and other
values to be equal, and is used
by ==
.