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

Method func_offset

crates/wasmtime/src/runtime/trap.rs:630–633  ·  view source on GitHub ↗

Returns the offset from the original wasm module's function to this frame's program counter. The offset here is the offset from the beginning of the defining function of this frame (within the wasm module) to the instruction this frame points to. Note that `None` may be returned if the original module was not compiled with mapping information to yield this information. This is controlled by the

(&self)

Source from the content-addressed store, hash-verified

628 /// [`Config::generate_address_map`](crate::Config::generate_address_map)
629 /// configuration option.
630 pub fn func_offset(&self) -> Option<usize> {
631 let instr_offset = self.instr?.file_offset()?;
632 Some((instr_offset - self.func_start.file_offset()?) as usize)
633 }
634
635 /// Returns the debug symbols found, if any, for this function frame.
636 ///

Callers 1

_serializeMethod · 0.45

Calls 1

file_offsetMethod · 0.80

Tested by

no test coverage detected