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

Method register_debug_image

crates/wasmtime/src/runtime/code_memory.rs:598–612  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

596
597 #[cfg(feature = "debug-builtins")]
598 fn register_debug_image(&mut self) -> Result<()> {
599 if !self.has_native_debug_info {
600 return Ok(());
601 }
602
603 // TODO-DebugInfo: we're copying the whole image here, which is pretty wasteful.
604 // Use the existing memory by teaching code here about relocations in DWARF sections
605 // and anything else necessary that is done in "create_gdbjit_image" right now.
606 let image = self.mmap().to_vec();
607 let text: &[u8] = self.text();
608 let bytes = crate::native_debug::create_gdbjit_image(image, (text.as_ptr(), text.len()))?;
609 let reg = crate::runtime::vm::GdbJitImageRegistration::register(bytes);
610 self.debug_registration = Some(reg);
611 Ok(())
612 }
613
614 /// Looks up the given offset within this module's text section and returns
615 /// the trap code associated with that instruction, if there is one.

Callers 1

publishMethod · 0.80

Calls 7

OkFunction · 0.85
create_gdbjit_imageFunction · 0.85
to_vecMethod · 0.45
mmapMethod · 0.45
textMethod · 0.45
as_ptrMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected