31 lines
872 B
Rust
31 lines
872 B
Rust
|
|
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<usize>,
|
||
|
|
pub function: Option<String>,
|
||
|
|
pub range: Option<SourceRange>,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||
|
|
pub struct ExecutionInspection {
|
||
|
|
pub vm_steps: u64,
|
||
|
|
pub awaiting: bool,
|
||
|
|
pub call_depth: usize,
|
||
|
|
pub frames: Vec<StackFrame>,
|
||
|
|
pub frames_truncated: bool,
|
||
|
|
}
|