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

Method parent

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

Get a handle to the next frame up the activation (the one that called this frame), if any.

(&self, mut store: impl AsContextMut)

Source from the content-addressed store, hash-verified

457 /// Get a handle to the next frame up the activation (the one that
458 /// called this frame), if any.
459 pub fn parent(&self, mut store: impl AsContextMut) -> Result<Option<FrameHandle>> {
460 let mut store = store.as_context_mut();
461 if !self.is_valid(&mut store) {
462 crate::error::bail!("Frame handle is no longer valid.");
463 }
464
465 let mut parent = self.clone();
466 parent.virtual_frame_idx += 1;
467
468 while !parent.cursor.done() {
469 let (cache, registry) = store
470 .0
471 .as_store_opaque()
472 .frame_data_cache_mut_and_registry();
473 let frames = cache.lookup_or_compute(registry, parent.cursor.frame());
474 if parent.virtual_frame_idx < frames.len() {
475 return Ok(Some(parent));
476 }
477 parent.virtual_frame_idx = 0;
478 // SAFETY: activation is valid because we checked validity
479 // wrt execution version at the top of this function, and
480 // we have not returned since.
481 unsafe {
482 parent.cursor.advance(store.0.as_store_opaque().unwinder());
483 }
484 }
485
486 Ok(None)
487 }
488
489 fn frame_data<'a>(&self, store: &'a mut StoreOpaque) -> Result<&'a FrameData> {
490 if !self.is_valid_impl(store) {

Callers 15

publishFunction · 0.45
run_testFunction · 0.45
stack_values_two_framesFunction · 0.45
stack_values_exceptionsFunction · 0.45
stack_values_dead_gc_refFunction · 0.45
gc_access_during_callFunction · 0.45
pulley_provenance_testFunction · 0.45
create_new_configFunction · 0.45
update_dataMethod · 0.45
acquire_task_fs_lockFunction · 0.45
basic_debuggerFunction · 0.45

Calls 12

OkFunction · 0.85
as_store_opaqueMethod · 0.80
lookup_or_computeMethod · 0.80
frameMethod · 0.80
advanceMethod · 0.80
as_context_mutMethod · 0.45
is_validMethod · 0.45
cloneMethod · 0.45
doneMethod · 0.45
lenMethod · 0.45
unwinderMethod · 0.45

Tested by

no test coverage detected