Looks up `pc`, an absolute program counter address, to see if it corresponds to any loaded code within this [`ModuleRegistry`]. Returns `None` if nothing is found, and otherwise returns the corresponding [`LoadedCode`] as well as a relative pc from the start of the code's text section if found.
(&self, pc: usize)
| 157 | /// corresponding [`LoadedCode`] as well as a relative pc from the start of |
| 158 | /// the code's text section if found. |
| 159 | fn loaded_code_by_pc(&self, pc: usize) -> Option<(&LoadedCode, usize)> { |
| 160 | let (_, code) = self |
| 161 | .loaded_code |
| 162 | .range(..=StoreCodePC::from_raw(pc)) |
| 163 | .next_back()?; |
| 164 | let offset = StoreCodePC::offset_of(code.code.text_range(), pc)?; |
| 165 | Some((code, offset)) |
| 166 | } |
| 167 | |
| 168 | /// Consults this [`ModuleRegistry`] to see if `pc` corrseponds to any |
| 169 | /// previously-registered block of code. |
no test coverage detected