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

Method find_program_point

crates/environ/src/frame_table.rs:178–194  ·  view source on GitHub ↗

Get frames for the program point at the PC upper-bounded by a given search PC (offset in text section).

(
        &self,
        search_pc: u32,
        search_pos: FrameInstPos,
    )

Source from the content-addressed store, hash-verified

176 /// Get frames for the program point at the PC upper-bounded by a
177 /// given search PC (offset in text section).
178 pub fn find_program_point(
179 &self,
180 search_pc: u32,
181 search_pos: FrameInstPos,
182 ) -> Option<impl Iterator<Item = (ModulePC, FrameTableDescriptorIndex, FrameStackShape)>> {
183 let key = FrameInstPos::encode(search_pc, search_pos);
184 let index = match self
185 .progpoint_pcs
186 .binary_search_by_key(&key, |entry| entry.get(LittleEndian))
187 {
188 Ok(idx) => idx,
189 Err(idx) if idx > 0 => idx - 1,
190 Err(_) => return None,
191 };
192
193 Some(self.program_point_frame_iter(index))
194 }
195
196 /// Get all program point records with iterators over
197 /// corresponding frames for each.

Callers 2

decodeMethod · 0.80
gc_refs_in_frameFunction · 0.80

Calls 3

binary_search_by_keyMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected