Struct minidump::MinidumpContext
source · [−]pub struct MinidumpContext {
pub raw: MinidumpRawContext,
pub valid: MinidumpContextValidity,
}
Expand description
CPU context such as register states.
MinidumpContext carries a CPU-specific MDRawContext structure, which contains CPU context such as register states. Each thread has its own context, and the exception record, if present, also has its own context. Note that if the exception record is present, the context it refers to is probably what the user wants to use for the exception thread, instead of that thread’s own context. The exception thread’s context (as opposed to the exception record’s context) will contain context for the exception handler (which performs minidump generation), and not the context that caused the exception (which is probably what the user wants).
Fields
raw: MinidumpRawContext
The raw CPU register state.
valid: MinidumpContextValidity
Which registers are valid in raw
.
Implementations
sourceimpl MinidumpContext
impl MinidumpContext
sourcepub fn from_raw(raw: MinidumpRawContext) -> MinidumpContext
pub fn from_raw(raw: MinidumpRawContext) -> MinidumpContext
Return a MinidumpContext given a MinidumpRawContext
.
sourcepub fn read(
bytes: &[u8],
endian: Endian,
system_info: &MinidumpSystemInfo,
_misc: Option<&MinidumpMiscInfo>
) -> Result<MinidumpContext, ContextError>
pub fn read(
bytes: &[u8],
endian: Endian,
system_info: &MinidumpSystemInfo,
_misc: Option<&MinidumpMiscInfo>
) -> Result<MinidumpContext, ContextError>
Read a MinidumpContext
from bytes
.
pub fn get_instruction_pointer(&self) -> u64
pub fn get_stack_pointer(&self) -> u64
pub fn get_register_always(&self, reg: &str) -> u64
pub fn get_register(&self, reg: &str) -> Option<u64>
pub fn format_register(&self, reg: &str) -> String
pub fn general_purpose_registers(&self) -> &'static [&'static str]
pub fn registers(&self) -> impl Iterator<Item = (&'static str, u64)> + '_
pub fn valid_registers(&self) -> impl Iterator<Item = (&'static str, u64)> + '_
Trait Implementations
sourceimpl Clone for MinidumpContext
impl Clone for MinidumpContext
sourcefn clone(&self) -> MinidumpContext
fn clone(&self) -> MinidumpContext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for MinidumpContext
impl Send for MinidumpContext
impl Sync for MinidumpContext
impl Unpin for MinidumpContext
impl UnwindSafe for MinidumpContext
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more