Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Debugging: avoid re-patching code on single-step update when state doesn't change. (#12638)

Chris Fallin284255277214
diff --git a/crates/wasmtime/src/runtime/debug.rs b/crates/wasmtime/src/runtime/debug.rs
index 4ac487e9a1..e1c5fad1bf 100644
--- a/crates/wasmtime/src/runtime/debug.rs
+++ b/crates/wasmtime/src/runtime/debug.rs
@@ -1088,6 +1088,11 @@ impl<'a> BreakpointEdit<'a> {
"single_step({enabled}) with breakpoint set {:?}",
self.state.breakpoints
);
+ if self.state.single_step == enabled {
+ // No change to current state; don't go through the effort of re-patching and
+ // re-publishing code.
+ return Ok(());
+ }
let modules = self.registry.all_modules().cloned().collect::<Vec<_>>();
for module in modules {
let mem = Self::get_code_memory(self.registry, &mut self.dirty_modules, &module)?;