gdb for WebAssembly
cargo install wasmgdb
Use [wasm-edit] to transform your module and, once WebAssembly traps, collect the WebAssembly memory and analyze the coredump.
wasmgdb <coredump> <source.wasm>
bt
Display the stack trace.
f <#>
Selects a stack frame and display informations.
p <expr>
Inspect the content of a variable.
Requires to select the frame with f
first.
p *<expr>
Inspect the content of a variable after dereferencing it.
Requires to select the frame with f
first.
p/s <expr>
Print the variable as string.
Requires to select the frame with f
first.
p (<type>) <expr>
Print the content of
x/<number> <hex-addr>
Examine the memory address at
x/<number>s <hex-addr>
Examine the memory address at
find
Find a string in memory.
Usage:
find <start-addr>, <end-addr>, "string"
find "string"
info types
List all defined types.
<object>-><member>
(<type>) <hex-addr>