(
&self,
store: &mut Store<Host>,
component: &wasmtime::component::Component,
linker: &mut wasmtime::component::Linker<Host>,
debuggee_host: Store<T>,
b
| 907 | /// debuggee wraps an arbitrary store type `T` and body closure. |
| 908 | #[cfg(feature = "debug")] |
| 909 | pub(crate) async fn invoke_debugger< |
| 910 | T: Send + 'static, |
| 911 | F: for<'a> FnOnce( |
| 912 | &'a mut Store<T>, |
| 913 | ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>> |
| 914 | + Send |
| 915 | + 'static, |
| 916 | >( |
| 917 | &self, |
| 918 | store: &mut Store<Host>, |
| 919 | component: &wasmtime::component::Component, |
| 920 | linker: &mut wasmtime::component::Linker<Host>, |
| 921 | debuggee_host: Store<T>, |
| 922 | body: F, |
| 923 | ) -> Result<()> { |
| 924 | let instance = linker.instantiate_async(&mut *store, component).await?; |
| 925 | let command = wasmtime_debugger::DebuggerComponent::new(&mut *store, &instance)?; |
| 926 | let debuggee = wasmtime_debugger::Debuggee::new(debuggee_host, body); |
| 927 | let debuggee = wasmtime_debugger::add_debuggee(store.data_mut().ctx().table, debuggee)?; |
| 928 | { |
| 929 | // Manually construct a borrow -- wasmtime-wit-bindgen |
| 930 | // generates code that consumes the `Resource<T>` for |
| 931 | // `call_debug()` below even though the WIT type is a |
| 932 | // `borrow<debuggee>`. |
| 933 | let borrowed = wasmtime::component::Resource::new_borrow(debuggee.rep()); |
| 934 | let args = self.compute_argv()?; |
| 935 | command |
| 936 | .bytecodealliance_wasmtime_debugger() |
| 937 | .call_debug(&mut *store, borrowed, &args) |
| 938 | .await?; |
| 939 | } |
| 940 | let mut debuggee = store.data_mut().ctx().table.delete(debuggee)?; |
| 941 | debuggee.finish().await?; |
| 942 | Ok(()) |
| 943 | } |
| 944 | |
| 945 | #[cfg(feature = "component-model")] |
| 946 | fn search_component_funcs( |
no test coverage detected