(wasm: &[u8])
| 106 | } |
| 107 | |
| 108 | fn annotate_wat(wasm: &[u8]) -> Result<AnnotatedWat> { |
| 109 | let printer = wasmprinter::Config::new(); |
| 110 | let mut storage = String::new(); |
| 111 | let chunks = printer |
| 112 | .offsets_and_lines(wasm, &mut storage) |
| 113 | .to_wasmtime_result()? |
| 114 | .map(|(offset, wat)| AnnotatedWatChunk { |
| 115 | wasm_offset: offset.map(|o| WasmOffset(u32::try_from(o).unwrap())), |
| 116 | wat: wat.to_string(), |
| 117 | }) |
| 118 | .collect(); |
| 119 | Ok(AnnotatedWat { chunks }) |
| 120 | } |
| 121 | |
| 122 | #[derive(Serialize, Debug)] |
| 123 | struct AnnotatedAsm { |
no test coverage detected