use serde::{Deserialize, Serialize}; use crate::SourceRange; #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum StackFrameKind { Current, Caller, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct StackFrame { pub kind: StackFrameKind, /// Current instruction or caller's saved return address. pub instruction_pointer: usize, /// Instruction mapped to source (the call instruction for a caller). pub source_instruction_pointer: Option, pub function: Option, pub range: Option, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ExecutionInspection { pub vm_steps: u64, pub awaiting: bool, pub call_depth: usize, pub frames: Vec, pub frames_truncated: bool, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct SourceBreakpoint { /// Zero-based line in the exact installed source. Empty addresses mean unverified. pub line: usize, pub instruction_pointers: Vec, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum DebugStopReason { Breakpoint, Step, Budget, Awaiting, Completed, Failed, Removed, } #[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct DebuggerSnapshot { pub breakpoints: Vec, pub stop_reason: Option, }