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

Method debug_global

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

Get access to a global within this instance's globals index space. This permits accessing globals whether they are exported or not. However, it is only available for purposes of debugging, and so is only permitted when `guest_debug` is enabled in the Engine's configuration. The intent of the Wasmtime API is to enforce the Wasm type system's encapsulation even in the host API, except where necessa

(
        &self,
        mut store: impl AsContextMut,
        global_index: u32,
    )

Source from the content-addressed store, hash-verified

190 /// `None` is returned if guest-debugging is not enabled in the
191 /// engine configuration for this Store.
192 pub fn debug_global(
193 &self,
194 mut store: impl AsContextMut,
195 global_index: u32,
196 ) -> Option<crate::Global> {
197 self.debug_export(
198 store.as_context_mut().0,
199 GlobalIndex::from_bits(global_index).into(),
200 )
201 .and_then(|s| s.into_global())
202 }
203
204 /// Get access to a memory (unshared only) within this instance's
205 /// memory index space.

Callers 2

private_entity_accessFunction · 0.80
instance_get_globalMethod · 0.80

Calls 3

debug_exportMethod · 0.80
into_globalMethod · 0.80
as_context_mutMethod · 0.45

Tested by

no test coverage detected