use {
ratatui::text::Span,
std::{collections::BTreeMap, path::PathBuf},
};
pub struct DebugSession {
pub txs: Vec<DebugTx>,
pub src_roots: Vec<PathBuf>,
pub path_rewrites: Vec<(PathBuf, PathBuf)>,
pub cwd: Option<PathBuf>,
pub programs: BTreeMap<String, ProgramDisasm>,
}
pub struct ProgramDisasm {
pub insns: Vec<StaticInsn>,
pub pc_to_idx: BTreeMap<u64, usize>,
pub has_dwarf: bool,
}
pub struct StaticInsn {
pub pc: u64,
pub disasm_spans: Vec<Span<'static>>,
pub func_label: Option<String>,
}
pub struct DebugTx {
pub test_name: String,
pub tx_seq: u32,
pub total_cu: u64,
pub nodes: Vec<DebugNode>,
}
pub struct DebugNode {
pub program_label: String,
pub program_id: String,
pub steps: Vec<DebugStep>,
}
#[derive(Clone)]
pub struct DebugStep {
pub pc: u64,
pub regs: [u64; 12],
pub insn: [u8; 8],
pub disasm: String,
pub disasm_spans: Vec<Span<'static>>,
pub func: String,
pub call_depth: usize,
pub cu_cost: u64,
pub cu_cumulative: u64,
pub syscall: Option<String>,
pub src_loc: Option<SrcLoc>,
}
#[derive(Clone, Debug)]
pub struct SrcLoc {
pub file: PathBuf,
pub line: u32,
}