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

Method wasm_call_stack

crates/gdbstub-component/src/target.rs:353–371  ·  view source on GitHub ↗
(&self, _tid: Tid, callback: &mut dyn FnMut(u64))

Source from the content-addressed store, hash-verified

351
352impl<'a> Wasm for Debugger<'a> {
353 fn wasm_call_stack(&self, _tid: Tid, callback: &mut dyn FnMut(u64)) -> Result<(), Self::Error> {
354 let debuggee = self.debuggee;
355 for (i, f) in self.frame_cache.iter().enumerate() {
356 // For non-innermost frames, report the return address
357 // (the instruction after the call) rather than the call
358 // instruction's PC. This matches the standard debugger
359 // convention and is needed for LLDB's `finish` command
360 // to set a breakpoint at the right address.
361 let pc = if i > 0 {
362 self.addr_space
363 .frame_to_return_addr(f, debuggee)
364 .unwrap_or_else(|| self.addr_space.frame_to_pc(f, debuggee))
365 } else {
366 self.addr_space.frame_to_pc(f, debuggee)
367 };
368 callback(pc.as_raw());
369 }
370 Ok(())
371 }
372
373 fn read_wasm_local(
374 &self,

Callers

nothing calls this directly

Calls 6

OkFunction · 0.85
frame_to_return_addrMethod · 0.80
frame_to_pcMethod · 0.80
callbackFunction · 0.50
iterMethod · 0.45
as_rawMethod · 0.45

Tested by

no test coverage detected