Trait minidump::CpuContext [−][src]
pub trait CpuContext {
type Register: LowerHex;
fn get_register_always(&self, reg: &str) -> Self::Register;
fn set_register(&mut self, reg: &str, val: Self::Register) -> Option<()>;
fn memoize_register(&self, reg: &str) -> Option<&'static str>;
fn stack_pointer_register_name(&self) -> &'static str;
fn instruction_pointer_register_name(&self) -> &'static str;
fn register_is_valid(
&self,
reg: &str,
valid: &MinidumpContextValidity
) -> bool { ... }
fn get_register(
&self,
reg: &str,
valid: &MinidumpContextValidity
) -> Option<Self::Register> { ... }
fn format_register(&self, reg: &str) -> String { ... }
}
Expand description
Generic over the specifics of a CPU context.
Associated Types
Required methods
fn get_register_always(&self, reg: &str) -> Self::Register
fn get_register_always(&self, reg: &str) -> Self::Register
Get a register value regardless of whether it is valid.
Set a register value, if that register name it exists.
Returns None if the register name isn’t supported.
fn memoize_register(&self, reg: &str) -> Option<&'static str>
fn memoize_register(&self, reg: &str) -> Option<&'static str>
Gets a static version of the given register name, if possible.
fn stack_pointer_register_name(&self) -> &'static str
fn stack_pointer_register_name(&self) -> &'static str
Gets the name of the stack pointer register (for use with get_register/set_register).
fn instruction_pointer_register_name(&self) -> &'static str
fn instruction_pointer_register_name(&self) -> &'static str
Gets the name of the instruction pointer register (for use with get_register/set_register).
Provided methods
fn register_is_valid(&self, reg: &str, valid: &MinidumpContextValidity) -> bool
fn register_is_valid(&self, reg: &str, valid: &MinidumpContextValidity) -> bool
Gets whether the given register is valid
This is exposed so that the context can map aliases. For instance “sp” and “x30” are aliases in ARM64.
fn get_register(
&self,
reg: &str,
valid: &MinidumpContextValidity
) -> Option<Self::Register>
fn get_register(
&self,
reg: &str,
valid: &MinidumpContextValidity
) -> Option<Self::Register>
Get a register value if it is valid.
Get the value of the register named reg
from this CPU context
if valid
indicates that it has a valid value, otherwise return
None
.
fn format_register(&self, reg: &str) -> String
fn format_register(&self, reg: &str) -> String
Return a String containing the value of reg
formatted to its natural width.