crashrustler/lib.rs
1//! CrashRustler: macOS crash report capture and analysis.
2//!
3//! This crate provides a Rust equivalent of CrashWrangler's `CrashReport` Objective-C class,
4//! capturing all the state needed to represent a macOS crash report including process
5//! information, exception details, thread backtraces, binary image mappings, and crash
6//! analysis metadata.
7//!
8//! # Key Types
9//!
10//! - [`CrashRustler`] — The main crash report struct holding all crash state.
11//! - [`ExceptionType`] — Mach exception types (e.g., `EXC_BAD_ACCESS`).
12//! - [`CpuType`] — CPU architecture constants (x86, ARM, PowerPC).
13//! - [`BinaryImage`] — A loaded binary image in the crashed process.
14//!
15//! # Example
16//!
17//! ```
18//! use crashrustler::{CrashRustler, CpuType};
19//!
20//! let mut cr = CrashRustler::default();
21//! cr.cpu_type = CpuType::ARM64;
22//! cr.is_64_bit = true;
23//! cr.exception_type = 1; // EXC_BAD_ACCESS
24//! cr.signal = 11; // SIGSEGV
25//!
26//! assert_eq!(cr.exception_type_description(), "EXC_BAD_ACCESS");
27//! assert_eq!(cr.signal_name(), "SIGSEGV");
28//! assert_eq!(cr.short_arch_name(), "arm64");
29//! ```
30
31mod accessors;
32mod analysis;
33mod backtrace;
34mod crash_rustler;
35pub mod exploitability;
36mod formatting;
37mod init;
38mod memory;
39mod types;
40pub mod unwind;
41
42pub use crash_rustler::CrashRustler;
43pub use types::*;
44
45#[cfg(test)]
46mod test_helpers;
47
48#[cfg(all(test, target_arch = "aarch64"))]
49mod dummy;