MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / dump

Function dump

cranelift/filetests/src/test_unwind.rs:78–104  ·  view source on GitHub ↗
(text: &mut W, mem: &[u8])

Source from the content-addressed store, hash-verified

76 use std::fmt::Write;
77
78 pub fn dump<W: Write>(text: &mut W, mem: &[u8]) {
79 let info = UnwindInfo::from_slice(mem);
80
81 writeln!(text, " version: {}", info.version).unwrap();
82 writeln!(text, " flags: {}", info.flags).unwrap();
83 writeln!(text, " prologue size: {}", info.prologue_size).unwrap();
84 writeln!(text, " frame register: {}", info.frame_register).unwrap();
85 writeln!(
86 text,
87 "frame register offset: {}",
88 info.frame_register_offset
89 )
90 .unwrap();
91 writeln!(text, " unwind codes: {}", info.unwind_codes.len()).unwrap();
92
93 for code in info.unwind_codes.iter().rev() {
94 writeln!(text).unwrap();
95 writeln!(text, " offset: {}", code.offset).unwrap();
96 writeln!(text, " op: {:?}", code.op).unwrap();
97 writeln!(text, " info: {}", code.info).unwrap();
98 match code.value {
99 UnwindValue::None => {}
100 UnwindValue::U16(v) => writeln!(text, " value: {v} (u16)").unwrap(),
101 UnwindValue::U32(v) => writeln!(text, " value: {v} (u32)").unwrap(),
102 };
103 }
104 }
105
106 #[derive(Debug)]
107 struct UnwindInfo {

Callers 1

runMethod · 0.85

Calls 5

from_sliceFunction · 0.85
dump_eh_frameFunction · 0.85
newFunction · 0.50
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected