Debian Codegraph @

third_party/rust/crash-context/src/mac.rs

raw
1 pub mod guard;
2 pub mod ipc;
3 pub mod resource;
4
5 use mach2::mach_types as mt;
6
7 /// Information on the exception that caused the crash
8 #[derive(Copy, Clone, Debug)]
9 pub struct ExceptionInfo {
10 /// The exception kind
11 pub kind: u32,
12 /// The exception code
13 pub code: u64,
14 /// Optional subcode with different meanings depending on the exception type
15 /// * `EXC_BAD_ACCESS` - The address that caused the exception
16 /// * `EXC_GUARD` - The unique guard identifier that was guarding a resource
17 /// * `EXC_RESOURCE` - Additional details depending on the resource type
18 pub subcode: Option<u64>,
19 }
20
21 /// Full Macos crash context
22 #[derive(Debug)]
23 pub struct CrashContext {
24 /// The process which crashed
25 pub task: mt::task_t,
26 /// The thread in the process that crashed
27 pub thread: mt::thread_t,
28 /// The thread that handled the exception. This may be useful to ignore.
29 pub handler_thread: mt::thread_t,
30 /// Optional exception information
31 pub exception: Option<ExceptionInfo>,
32 }