Struct minidump::format::CONTEXT_ARM64
source · pub struct CONTEXT_ARM64 {
pub context_flags: u32,
pub cpsr: u32,
pub iregs: [u64; 31],
pub sp: u64,
pub pc: u64,
pub float_regs: [u128; 32],
pub fpcr: u32,
pub fpsr: u32,
pub bcr: [u32; 8],
pub bvr: [u64; 8],
pub wcr: [u32; 2],
pub wvr: [u64; 2],
}
Expand description
A (microsoft-style) aarch64 (arm64) CPU context
This matches the layout of how Windows defines this type. Breakpad defines it in an equivalent but more-quirky way that relies more on packing.
For general purpose registers:
- microsoft: make iregs have 31 values and have sp and pc as explicit fields.
- breakpad make iregs have 33 values, no explicit fields.
For float registers:
- microsoft: inline the fields for float_regs, fpcr, fpsr.
- breakpad: wrap them in a struct.
Why we went with these definitions:
-
ARM64 actually defines x0..x30 register names, but sp and pc aren’t “x31” and “x32”. Breakpad is effectively punning them as such, and that’s kinda weird?
-
Microsft’s inlining of the float registers eliminates any need for padding on all platforms (note how there’s always an even number of u32’s before a u64, and an even number of u64’s before a u128!)
NOTE: if you ever decide to try to make this repr(C) and get really clever, note that microsoft aligns this to 16 (and as of this writing, rust does not consistently aling u128 as such).
Fields§
§context_flags: u32
§cpsr: u32
§iregs: [u64; 31]
[x0, x1, ..., x28, fp, lr]
. See Arm64RegisterNumbers.
sp: u64
§pc: u64
§float_regs: [u128; 32]
float/NEON registers [d0, d1, ..., d31]
fpcr: u32
FPU control register.
fpsr: u32
FPU status register.
bcr: [u32; 8]
§bvr: [u64; 8]
§wcr: [u32; 2]
§wvr: [u64; 2]
Trait Implementations§
source§impl Clone for CONTEXT_ARM64
impl Clone for CONTEXT_ARM64
source§fn clone(&self) -> CONTEXT_ARM64
fn clone(&self) -> CONTEXT_ARM64
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CpuContext for CONTEXT_ARM64
impl CpuContext for CONTEXT_ARM64
source§fn memoize_register(&self, reg: &str) -> Option<&'static str>
fn memoize_register(&self, reg: &str) -> Option<&'static str>
source§fn register_is_valid(&self, reg: &str, valid: &MinidumpContextValidity) -> bool
fn register_is_valid(&self, reg: &str, valid: &MinidumpContextValidity) -> bool
source§fn get_register_always(&self, reg: &str) -> u64
fn get_register_always(&self, reg: &str) -> u64
source§fn set_register(&mut self, reg: &str, val: Self::Register) -> Option<()>
fn set_register(&mut self, reg: &str, val: Self::Register) -> Option<()>
source§fn stack_pointer_register_name(&self) -> &'static str
fn stack_pointer_register_name(&self) -> &'static str
source§fn instruction_pointer_register_name(&self) -> &'static str
fn instruction_pointer_register_name(&self) -> &'static str
source§fn get_register(
&self,
reg: &str,
valid: &MinidumpContextValidity
) -> Option<Self::Register>
fn get_register( &self, reg: &str, valid: &MinidumpContextValidity ) -> Option<Self::Register>
source§fn format_register(&self, reg: &str) -> String
fn format_register(&self, reg: &str) -> String
reg
formatted to its natural width.