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

Method patch_new_module

crates/wasmtime/src/runtime/debug.rs:1028–1039  ·  view source on GitHub ↗

Internal helper to patch a new module for single-stepping. When a module is newly registered in a `Store`, we need to patch all breakpoints into the copy for this `Store` if single-stepping is currently enabled.

(&self, code: &mut StoreCode, module: &Module)

Source from the content-addressed store, hash-verified

1026 /// `Store`, we need to patch all breakpoints into the copy for
1027 /// this `Store` if single-stepping is currently enabled.
1028 pub(crate) fn patch_new_module(&self, code: &mut StoreCode, module: &Module) -> Result<()> {
1029 // Apply single-step state if single-stepping is enabled. Note
1030 // that no other individual breakpoints will exist yet (as
1031 // this is a newly registered module).
1032 if self.single_step {
1033 let mem = code.code_memory_mut().unwrap();
1034 mem.unpublish()?;
1035 BreakpointEdit::apply_single_step(mem, module, true, |_key| false)?;
1036 mem.publish()?;
1037 }
1038 Ok(())
1039 }
1040}
1041
1042impl<'a> BreakpointEdit<'a> {

Callers 1

updateMethod · 0.80

Calls 5

OkFunction · 0.85
code_memory_mutMethod · 0.80
unpublishMethod · 0.80
publishMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected