#[repr(C)]
pub struct CrashContext { pub context: ucontext_t, pub float_state: fpregset_t, pub siginfo: signalfd_siginfo, pub pid: pid_t, pub tid: pid_t, }
Expand description

The full context for a Linux/Android crash

Fields§

§context: ucontext_t

Crashing thread context.

Note that we use [crate::ucontext_t] instead of libc::ucontext_t as libc’s differs between glibc and musl https://github.com/rust-lang/libc/pull/1646 even though the ucontext_t received from a signal will be the same regardless of the libc implementation used as it is only arch specific and not libc specific

Note that we hide ucontext_t::uc_link as it is a pointer and thus can’t be accessed in a process other than the one the CrashContext was created in. This is a just a self-reference so is not useful in practice.

Note that the same applies to [mcontext_t::fpregs], but since that points to floating point registers and is interesting to read in another process, those registers available as Self::float_state, except on the arm architecture since they aren’t part of mcontext_t at all.

§float_state: fpregset_t

State of floating point registers.

This isn’t part of the user ABI for Linux arm

§siginfo: signalfd_siginfo

The signal info for the crash

§pid: pid_t

The id of the crashing process

§tid: pid_t

The id of the crashing thread

Implementations§

source§

impl CrashContext

source

pub fn as_bytes(&self) -> &[u8]

source

pub fn from_bytes(bytes: &[u8]) -> Option<Self>

Trait Implementations§

source§

impl Clone for CrashContext

source§

fn clone(&self) -> CrashContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Send for CrashContext

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.