pub struct MinidumpException<'a> {
    pub raw: MINIDUMP_EXCEPTION_STREAM,
    pub thread_id: u32,
    /* private fields */
}
Expand description

Information about the exception that caused the minidump to be generated.

MinidumpException wraps MINIDUMP_EXCEPTION_STREAM, which contains information about the exception that caused the minidump to be generated, if the minidump was generated in an exception handler called as a result of an exception. It also provides access to a MinidumpContext object, which contains the CPU context for the exception thread at the time the exception occurred.

Fields§

§raw: MINIDUMP_EXCEPTION_STREAM

The raw exception information from the minidump stream.

§thread_id: u32

The thread that encountered this exception.

Implementations§

source§

impl<'a> MinidumpException<'a>

source

pub fn context( &self, system_info: &MinidumpSystemInfo, misc: Option<&MinidumpMiscInfo> ) -> Option<Cow<'a, MinidumpContext>>

Get the cpu context of the crashing (or otherwise minidump-requesting) thread.

CPU contexts are a platform-specific format, so SystemInfo is required to reliably parse them. We used to use heuristics to avoid this requirement, but this made us too brittle to otherwise-backwards-compatible additions to the format.

MiscInfo can contain additional details on the cpu context’s format, but is optional because those details can be safely ignored (at the cost of being unable to parse some very obscure cpu state).

source

pub fn get_crash_address(&self, os: Os, cpu: Cpu) -> u64

Get the address that “caused” the crash.

The meaning of this value depends on the kind of crash this was.

By default, it’s the instruction pointer at the time of the crash. However, if the crash was caused by an illegal memory access, the the address would be the memory address.

So for instance, if you crashed from dereferencing a null pointer, the crash_address will be 0 (or close to it, due to offsets).

source

pub fn get_crash_reason(&self, os: Os, cpu: Cpu) -> CrashReason

Get the crash reason for an exception.

The returned value reflects our best attempt to recover a “native” error for the crashing system based on the OS and things like raw error codes.

This is an imperfect process, because OSes may have overlapping error types (e.g. WinError and NTSTATUS overlap, so we have to pick one arbirarily).

The raw error codes can be extracted from MinidumpException::raw.

source

pub fn get_crashing_thread_id(&self) -> u32

The id of the thread that caused the crash (or otherwise requested the minidump, even if there wasn’t actually a crash).

source

pub fn print<T: Write>( &self, f: &mut T, system: Option<&MinidumpSystemInfo>, misc: Option<&MinidumpMiscInfo> ) -> Result<()>

Write a human-readable description of this MinidumpException to f.

This is very verbose, it is the format used by minidump_dump.

Trait Implementations§

source§

impl<'a> Debug for MinidumpException<'a>

source§

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

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

impl<'a> MinidumpStream<'a> for MinidumpException<'a>

source§

const STREAM_TYPE: u32 = 6u32

The stream type constant used in the md::MDRawDirectory entry. This is usually a MINIDUMP_STREAM_TYPE but it’s left as a u32 to allow external projects to add support for their own custom streams.
source§

fn read( bytes: &'a [u8], all: &'a [u8], endian: Endian, _system_info: Option<&MinidumpSystemInfo> ) -> Result<Self, Error>

Read this MinidumpStream type from bytes. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for MinidumpException<'a>

§

impl<'a> Send for MinidumpException<'a>

§

impl<'a> Sync for MinidumpException<'a>

§

impl<'a> Unpin for MinidumpException<'a>

§

impl<'a> UnwindSafe for MinidumpException<'a>

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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