Skip to content

Inspect Method Preview

The inspect method allows you to examine the current state of the VM, providing visibility into the stack, registers, and loaded bytecode at any point during the execution cycle.

Using TypeScript

For TypeScript, you can use the inspect method to retrieve a snapshot of the VM's internal state. This is particularly useful for debugging or monitoring the VM's behavior during runtime to ensure your logic is executing as expected.

ts
const report = vm.inspect();
console.log(report);

Using Rust

In Rust, the inspect method provides a structured view of the VM's internals. It is designed to expose the current environment state, allowing for precise tracking of variable values and stack operations during the execution of your bytecode.

rust
let report = vm.inspect();
println!("{}", serde_json::to_string_pretty(&report).unwrap());

INFO

Capability Required: Observe

Released under the Apache-2.0 License.