use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct Ucontext {
pub arch: String,
pub registers: HashMap<String, String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub raw: Option<String>,
}
#[cfg(test)]
impl Ucontext {
pub fn test_instance(_seed: u64) -> Self {
Self {
arch: "x86_64".to_string(),
registers: HashMap::from([
("rip".to_string(), "0x00007f7e11d3a2b0".to_string()),
("rsp".to_string(), "0x00007f7e11d3a2b0".to_string()),
("rbp".to_string(), "0x00007f7e11d3a2b0".to_string()),
("rax".to_string(), "0x00007f7e11d3a2b0".to_string()),
("rbx".to_string(), "0x00007f7e11d3a2b0".to_string()),
("rcx".to_string(), "0x00007f7e11d3a2b0".to_string()),
]),
raw: Some("ucontext_t { uc_flags: 7, uc_link: 0x0, uc_stack: stack_t { ss_sp: 0x713fa26f1000, ss_flags: 0, ss_size: 65536 } }".to_string()),
}
}
}