Struct minidump_processor::symbols::Symbolizer
source · [−]pub struct Symbolizer { /* private fields */ }Implementations
sourceimpl Symbolizer
impl Symbolizer
sourcepub fn new<T>(supplier: T) -> Symbolizer where
T: 'static + SymbolSupplier + Send + Sync,
pub fn new<T>(supplier: T) -> Symbolizer where
T: 'static + SymbolSupplier + Send + Sync,
Create a Symbolizer that uses supplier to locate symbols.
sourcepub async fn get_symbol_at_address(
&self,
debug_file: &str,
debug_id: DebugId,
address: u64
) -> Option<String>
pub async fn get_symbol_at_address(
&self,
debug_file: &str,
debug_id: DebugId,
address: u64
) -> Option<String>
Helper method for non-minidump-using callers.
Pass debug_file and debug_id describing a specific module,
and address, a module-relative address, and get back
a symbol in that module that covers that address, or None.
See the module-level documentation for an example.
sourcepub async fn fill_symbol(
&self,
module: &(dyn Module + Sync),
frame: &mut (dyn FrameSymbolizer + Send)
) -> Result<(), FillSymbolError>
pub async fn fill_symbol(
&self,
module: &(dyn Module + Sync),
frame: &mut (dyn FrameSymbolizer + Send)
) -> Result<(), FillSymbolError>
Fill symbol information in frame using the instruction address
from frame, and the module information from module. If you’re not
using a minidump module, you can use SimpleModule and
SimpleFrame.
An Error indicates that no symbols could be found for the relevant module.
Examples
use std::str::FromStr;
use debugid::DebugId;
use breakpad_symbols::{SimpleSymbolSupplier,Symbolizer,SimpleFrame,SimpleModule};
#[tokio::main]
async fn main() {
use std::path::PathBuf;
let paths = vec!(PathBuf::from("../testdata/symbols/"));
let supplier = SimpleSymbolSupplier::new(paths);
let symbolizer = Symbolizer::new(supplier);
let debug_id = DebugId::from_str("5A9832E5287241C1838ED98914E9B7FF1").unwrap();
let m = SimpleModule::new("test_app.pdb", debug_id);
let mut f = SimpleFrame::with_instruction(0x1010);
let _ = symbolizer.fill_symbol(&m, &mut f).await;
assert_eq!(f.function.unwrap(), "vswprintf");
assert_eq!(f.source_file.unwrap(),
r"c:\program files\microsoft visual studio 8\vc\include\swprintf.inl");
assert_eq!(f.source_line.unwrap(), 51);
}sourcepub fn stats(&self) -> HashMap<String, SymbolStats, RandomState>
pub fn stats(&self) -> HashMap<String, SymbolStats, RandomState>
Collect various statistics on the symbols.
Keys are the file name of the module (code_file’s file name).
sourcepub fn pending_stats(&self) -> PendingSymbolStats
pub fn pending_stats(&self) -> PendingSymbolStats
Get live symbol stats for interactive updates.
sourcepub async fn walk_frame(
&self,
module: &(dyn Module + Sync),
walker: &mut (dyn FrameWalker + Send)
) -> Option<()>
pub async fn walk_frame(
&self,
module: &(dyn Module + Sync),
walker: &mut (dyn FrameWalker + Send)
) -> Option<()>
Tries to use CFI to walk the stack frame of the FrameWalker
using the symbols of the given Module. Output will be written
using the FrameWalker’s set_caller_* APIs.
Trait Implementations
sourceimpl SymbolProvider for Symbolizer
impl SymbolProvider for Symbolizer
sourcefn fill_symbol<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
module: &'life1 (dyn Module + Sync),
frame: &'life2 mut (dyn FrameSymbolizer + Send)
) -> Pin<Box<dyn Future<Output = Result<(), FillSymbolError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn fill_symbol<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
module: &'life1 (dyn Module + Sync),
frame: &'life2 mut (dyn FrameSymbolizer + Send)
) -> Pin<Box<dyn Future<Output = Result<(), FillSymbolError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Fill symbol information in FrameSymbolizer using the instruction
address from frame, and the module information from Module. Read more
sourcefn walk_frame<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
module: &'life1 (dyn Module + Sync),
walker: &'life2 mut (dyn FrameWalker + Send)
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn walk_frame<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
module: &'life1 (dyn Module + Sync),
walker: &'life2 mut (dyn FrameWalker + Send)
) -> Pin<Box<dyn Future<Output = Option<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Tries to use CFI to walk the stack frame of the FrameWalker
using the symbols of the given Module. Read more
sourcefn get_file_path<'life0, 'life1, 'async_trait>(
&'life0 self,
module: &'life1 (dyn Module + Sync),
file_kind: FileKind
) -> Pin<Box<dyn Future<Output = Result<PathBuf, FileError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_file_path<'life0, 'life1, 'async_trait>(
&'life0 self,
module: &'life1 (dyn Module + Sync),
file_kind: FileKind
) -> Pin<Box<dyn Future<Output = Result<PathBuf, FileError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Gets the path to the binary code file for a given module (or an Error). Read more
sourcefn stats(&self) -> HashMap<String, SymbolStats>
fn stats(&self) -> HashMap<String, SymbolStats>
Collect various statistics on the symbols. Read more
sourcefn pending_stats(&self) -> PendingSymbolStats
fn pending_stats(&self) -> PendingSymbolStats
Collect various pending statistics on the symbols. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Symbolizer
impl Send for Symbolizer
impl Sync for Symbolizer
impl Unpin for Symbolizer
impl !UnwindSafe for Symbolizer
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