Think gdb for WebAssembly
cargo install wasmgdb
Use wasm-coredump-rewriter to transform your module and, once WebAssembly traps, collect the WebAssembly memory and analyze the coredump.
wasmgdb <source.wasm> <coredump.data>
Display the stack trace.
Selects a stack frame and display informations.
Inspect the content of a variable.
Requires to select the frame with f
first.
Inspect the content of a variable after dereferencing it.
Requires to select the frame with f
first.
Print the variable as string.
Requires to select the frame with f
first.
Print the content of as .
Examine the memory address at with length.
Examine the memory address at and prints as string of length.
Find the as bytes in memory.
Usage:
find <start-addr>, <end-addr>, <expr>
find <expr>
List all defined types.
List local values (includes Wasm func arguments).
Get informations about the function at the given index.
List WebAssembly module's imported functions from the host.
List all defined functions.
List globals.
Information about the process.
- Member access:
<object>-><member>
- Cast:
(<type>) <hex-addr>
- String:
"<string>"