Struct minidump::MinidumpException
source · 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>
impl<'a> MinidumpException<'a>
sourcepub fn context(
&self,
system_info: &MinidumpSystemInfo,
misc: Option<&MinidumpMiscInfo>
) -> Option<Cow<'a, MinidumpContext>>
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).
sourcepub fn get_crash_address(&self, os: Os, cpu: Cpu) -> u64
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).
sourcepub fn get_crash_reason(&self, os: Os, cpu: Cpu) -> CrashReason
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.
sourcepub fn get_crashing_thread_id(&self) -> u32
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).
sourcepub fn print<T: Write>(
&self,
f: &mut T,
system: Option<&MinidumpSystemInfo>,
misc: Option<&MinidumpMiscInfo>
) -> Result<()>
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>
impl<'a> Debug for MinidumpException<'a>
source§impl<'a> MinidumpStream<'a> for MinidumpException<'a>
impl<'a> MinidumpStream<'a> for MinidumpException<'a>
source§const STREAM_TYPE: u32 = 6u32
const STREAM_TYPE: u32 = 6u32
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.