Struct BreakpadObject

Source
pub struct BreakpadObject<'data> { /* private fields */ }
Expand description

A Breakpad object file.

To process minidump crash reports without having to understand all sorts of native symbol formats, the Breakpad processor uses a text-based symbol file format. It comprises records describing the object file, functions and lines, public symbols, as well as unwind information for stackwalking.

The platform-specific symbol dumping tools parse the debugging information the compiler provides (whether as DWARF or STABS sections in an ELF file or as stand-alone PDB files), and write that information back out in the Breakpad symbol file format. This format is much simpler and less detailed than compiler debugging information, and values legibility over compactness.

The full documentation resides here.

Implementations§

Source§

impl<'data> BreakpadObject<'data>

Source

pub fn test(data: &[u8]) -> bool

Tests whether the buffer could contain a Breakpad object.

Source

pub fn parse(data: &'data [u8]) -> Result<Self, BreakpadError>

Tries to parse a Breakpad object from the given slice.

Source

pub fn file_format(&self) -> FileFormat

The container file format, which is always FileFormat::Breakpad.

Source

pub fn code_id(&self) -> Option<CodeId>

The code identifier of this object.

Source

pub fn debug_id(&self) -> DebugId

The debug information identifier of this object.

Source

pub fn arch(&self) -> Arch

The CPU architecture of this object.

Source

pub fn name(&self) -> &'data str

The debug file name of this object.

This is the name of the original debug file that was used to create the Breakpad file. On Windows, this will have a .pdb extension, on other platforms that name is likely equivalent to the name of the code file (shared library or executable).

Source

pub fn kind(&self) -> ObjectKind

The kind of this object.

Source

pub fn load_address(&self) -> u64

The address at which the image prefers to be loaded into memory.

When Breakpad symbols are written, all addresses are rebased relative to the load address. Since the original load address is not stored in the file, it is assumed as zero.

Source

pub fn has_symbols(&self) -> bool

Determines whether this object exposes a public symbol table.

Source

pub fn symbols(&self) -> BreakpadSymbolIterator<'data>

Returns an iterator over symbols in the public symbol table.

Source

pub fn symbol_map(&self) -> SymbolMap<'data>

Returns an ordered map of symbols in the symbol table.

Source

pub fn has_debug_info(&self) -> bool

Determines whether this object contains debug information.

Source

pub fn debug_session( &self, ) -> Result<BreakpadDebugSession<'data>, BreakpadError>

Constructs a debugging session.

A debugging session loads certain information from the object file and creates caches for efficient access to various records in the debug information. Since this can be quite a costly process, try to reuse the debugging session as long as possible.

Constructing this session will also work if the object does not contain debugging information, in which case the session will be a no-op. This can be checked via has_debug_info.

Source

pub fn has_unwind_info(&self) -> bool

Determines whether this object contains stack unwinding information.

Source

pub fn has_sources(&self) -> bool

Determines whether this object contains embedded source.

Source

pub fn is_malformed(&self) -> bool

Determines whether this object is malformed and was only partially parsed

Source

pub fn info_records(&self) -> BreakpadInfoRecords<'data>

Returns an iterator over info records.

Source

pub fn file_records(&self) -> BreakpadFileRecords<'data>

Returns an iterator over file records.

Source

pub fn file_map(&self) -> BreakpadFileMap<'data>

Returns a map for file name lookups by id.

Source

pub fn public_records(&self) -> BreakpadPublicRecords<'data>

Returns an iterator over public symbol records.

Source

pub fn func_records(&self) -> BreakpadFuncRecords<'data>

Returns an iterator over function records.

Source

pub fn stack_records(&self) -> BreakpadStackRecords<'data>

Returns an iterator over stack frame records.

Source

pub fn data(&self) -> &'data [u8]

Returns the raw data of the Breakpad file.

Trait Implementations§

Source§

impl<'slf, 'data: 'slf> AsSelf<'slf> for BreakpadObject<'data>

Source§

type Ref = BreakpadObject<'slf>

The Self type with 'slf lifetimes, returned by as_self.
Source§

fn as_self(&'slf self) -> &'slf Self::Ref

Returns a reference to self with downcasted lifetime.
Source§

impl Debug for BreakpadObject<'_>

Source§

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

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

impl<'data: 'object, 'object> ObjectLike<'data, 'object> for BreakpadObject<'data>

Source§

type Error = BreakpadError

Errors thrown when reading information from this object.
Source§

type Session = BreakpadDebugSession<'data>

A session that allows optimized access to debugging information.
Source§

type SymbolIterator = BreakpadSymbolIterator<'data>

The iterator over the symbols in the public symbol table.
Source§

fn file_format(&self) -> FileFormat

The container format of this file.
Source§

fn code_id(&self) -> Option<CodeId>

The code identifier of this object. Read more
Source§

fn debug_id(&self) -> DebugId

The debug information identifier of this object.
Source§

fn arch(&self) -> Arch

The CPU architecture of this object.
Source§

fn kind(&self) -> ObjectKind

The kind of this object.
Source§

fn load_address(&self) -> u64

The address at which the image prefers to be loaded into memory.
Source§

fn has_symbols(&self) -> bool

Determines whether this object exposes a public symbol table.
Source§

fn symbols(&self) -> Self::SymbolIterator

Returns an iterator over symbols in the public symbol table.
Source§

fn symbol_map(&self) -> SymbolMap<'data>

Returns an ordered map of symbols in the symbol table.
Source§

fn has_debug_info(&self) -> bool

Determines whether this object contains debug information.
Source§

fn debug_session(&self) -> Result<Self::Session, Self::Error>

Constructs a debugging session. Read more
Source§

fn has_unwind_info(&self) -> bool

Determines whether this object contains stack unwinding information.
Source§

fn has_sources(&self) -> bool

Determines whether this object contains embedded sources.
Source§

fn is_malformed(&self) -> bool

Determines whether this object is malformed and was only partially parsed

Auto Trait Implementations§

§

impl<'data> Freeze for BreakpadObject<'data>

§

impl<'data> RefUnwindSafe for BreakpadObject<'data>

§

impl<'data> Send for BreakpadObject<'data>

§

impl<'data> Sync for BreakpadObject<'data>

§

impl<'data> Unpin for BreakpadObject<'data>

§

impl<'data> UnwindSafe for BreakpadObject<'data>

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<I, T> ExtractContext<I, ()> for T

Source§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<I> RecreateContext<I> for I

Source§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.