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

Function add_debuggee

crates/debugger/src/host.rs:18–30  ·  view source on GitHub ↗

Register a debuggee in a resource table.

(
    table: &mut ResourceTable,
    debuggee: crate::Debuggee<T>,
)

Source from the content-addressed store, hash-verified

16
17/// Register a debuggee in a resource table.
18pub fn add_debuggee<T: Send + 'static>(
19 table: &mut ResourceTable,
20 debuggee: crate::Debuggee<T>,
21) -> Result<Resource<Debuggee>> {
22 let engine = debuggee.engine().clone();
23 let interrupt_pending = debuggee.interrupt_pending().clone();
24 let inner: Option<Box<dyn OpaqueDebugger + Send + 'static>> = Some(Box::new(debuggee));
25 Ok(table.push(Debuggee {
26 inner,
27 engine,
28 interrupt_pending,
29 })?)
30}
31
32impl bindings::DebugMainImports for ResourceTable {
33 async fn print_debugger_info(&mut self, message: String) -> wasmtime::Result<()> {

Callers 1

invoke_debuggerMethod · 0.85

Calls 6

OkFunction · 0.85
interrupt_pendingMethod · 0.80
newFunction · 0.50
cloneMethod · 0.45
engineMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected