//! Example of enabling debuginfo for wasm code which allows interactive1//! debugging of the wasm code. When using recent versions of LLDB2//! you can debug this executable and set breakpoints in wasm code and look at3//! the rust source code as input.45// To execute this example you'll need to run two commands:6//7// cargo build -p example-fib-debug-wasm --target wasm32-unknown-unknown8// cargo run --example fib-debug910use wasmtime::*;1112fn main() -> Result<()> {13// Load our previously compiled wasm file (built previously with Cargo) and14// also ensure that we generate debuginfo so this executable can be15// debugged in GDB.16let engine = Engine::new(17Config::new()18.debug_info(true)19.cranelift_opt_level(OptLevel::None),20)?;21let mut store = Store::new(&engine, ());22let module = Module::from_file(&engine, "target/wasm32-unknown-unknown/debug/fib.wasm")?;23let instance = Instance::new(&mut store, &module, &[])?;2425// Invoke `fib` export26let fib = instance.get_typed_func::<i32, i32>(&mut store, "fib")?;27println!("fib(6) = {}", fib.call(&mut store, 6)?);28Ok(())29}303132