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

Method apply_single_step

crates/wasmtime/src/runtime/debug.rs:1149–1167  ·  view source on GitHub ↗
(
        mem: &mut CodeMemory,
        module: &Module,
        enabled: bool,
        key_enabled: F,
    )

Source from the content-addressed store, hash-verified

1147 }
1148
1149 fn apply_single_step<F: Fn(&BreakpointKey) -> bool>(
1150 mem: &mut CodeMemory,
1151 module: &Module,
1152 enabled: bool,
1153 key_enabled: F,
1154 ) -> Result<()> {
1155 let table = module
1156 .frame_table()
1157 .expect("Frame table must be present when guest-debug is enabled");
1158 for (wasm_pc, patch) in table.breakpoint_patches() {
1159 let key = BreakpointKey::from_raw(&module, wasm_pc);
1160 let this_enabled = enabled || key_enabled(&key);
1161 log::trace!(
1162 "single_step: enabled {enabled} key {key:?} -> this_enabled {this_enabled}"
1163 );
1164 Self::patch(core::iter::once(patch), mem, this_enabled);
1165 }
1166 Ok(())
1167 }
1168
1169 /// Turn on or off single-step mode.
1170 ///

Callers

nothing calls this directly

Calls 4

OkFunction · 0.85
expectMethod · 0.45
frame_tableMethod · 0.45
breakpoint_patchesMethod · 0.45

Tested by

no test coverage detected