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

Method program_point_frame_iter

crates/environ/src/frame_table.rs:218–241  ·  view source on GitHub ↗
(
        &self,
        index: usize,
    )

Source from the content-addressed store, hash-verified

216 }
217
218 fn program_point_frame_iter(
219 &self,
220 index: usize,
221 ) -> impl Iterator<Item = (ModulePC, FrameTableDescriptorIndex, FrameStackShape)> {
222 let offset =
223 usize::try_from(self.progpoint_descriptor_offsets[index].get(LittleEndian)).unwrap();
224 let mut data = &self.progpoint_descriptor_data[offset..];
225
226 core::iter::from_fn(move || {
227 if data.len() < 3 {
228 return None;
229 }
230 let wasm_pc_raw = data[0].get(LittleEndian);
231 let frame_descriptor = FrameTableDescriptorIndex(data[1].get(LittleEndian));
232 let stack_shape = FrameStackShape(data[2].get(LittleEndian));
233 data = &data[3..];
234 let not_last = wasm_pc_raw & 0x8000_0000 != 0;
235 let wasm_pc = ModulePC::new(wasm_pc_raw & 0x7fff_ffff);
236 if !not_last {
237 data = &[];
238 }
239 Some((wasm_pc, frame_descriptor, stack_shape))
240 })
241 }
242
243 /// For a given breakpoint index, return the patch offset in text,
244 /// the patch data, and the original data.

Callers 2

find_program_pointMethod · 0.80
into_program_pointsMethod · 0.80

Calls 6

FrameStackShapeClass · 0.85
newFunction · 0.50
unwrapMethod · 0.45
getMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected