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,
)
| 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. |
no test coverage detected