Return virtual frames corresponding to a physical frame, from outermost to innermost.
(registry: &ModuleRegistry, pc: usize)
| 673 | /// Return virtual frames corresponding to a physical frame, from |
| 674 | /// outermost to innermost. |
| 675 | fn decode(registry: &ModuleRegistry, pc: usize) -> (&StoreCode, Vec<VirtualFrame>) { |
| 676 | let (store_code, pc) = registry |
| 677 | .store_code_by_pc(pc) |
| 678 | .expect("Wasm frame PC does not correspond to a module"); |
| 679 | let table = store_code.code_memory().frame_table().unwrap(); |
| 680 | let pc = u32::try_from(pc).expect("PC offset too large"); |
| 681 | let program_points = table.find_program_point(pc, FrameInstPos::Post) |
| 682 | .expect("There must be a program point record in every frame when debug instrumentation is enabled"); |
| 683 | |
| 684 | ( |
| 685 | store_code, |
| 686 | program_points |
| 687 | .map(|(wasm_pc, frame_descriptor, stack_shape)| VirtualFrame { |
| 688 | wasm_pc, |
| 689 | frame_descriptor, |
| 690 | stack_shape, |
| 691 | }) |
| 692 | .collect(), |
| 693 | ) |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | /// Data computed when we visit a given frame. |
no test coverage detected