13 releases

0.1.12 Mar 6, 2023
0.1.11 Feb 24, 2023
0.1.7 Jan 31, 2023
0.1.4 Dec 13, 2022
0.1.3 Nov 29, 2022

#372 in WebAssembly

Download history 28/week @ 2022-11-29 6/week @ 2022-12-06 30/week @ 2022-12-13 1/week @ 2022-12-20 1/week @ 2022-12-27 7/week @ 2023-01-10 10/week @ 2023-01-17 54/week @ 2023-01-24 46/week @ 2023-01-31 57/week @ 2023-02-07 52/week @ 2023-02-14 83/week @ 2023-02-21 24/week @ 2023-02-28 8/week @ 2023-03-07 1/week @ 2023-03-14

118 downloads per month

MIT license

180KB
4.5K SLoC

wasmgdb

Think gdb for WebAssembly

Install

cargo install wasmgdb

Usage

Use wasm-coredump-rewriter to transform your module and, once WebAssembly traps, collect the WebAssembly memory and analyze the coredump.

Analyze a coredump

wasmgdb source.wasm coredump.data

Commands

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 as .

x/<number> <hex-addr>

Examine the memory address at with length.

x/<number>s <hex-addr>

Examine the memory address at and prints as string of length.

find <expr>

Find the as bytes in memory.

Usage: find <start-addr>, <end-addr>, <expr> find <expr>

info types

List all defined types.

info locals

List local values (includes Wasm func arguments).

info symbol <funcidx>

Get informations about the function at the given index.

info imports

List WebAssembly module's imported functions from the host.

info functions

List all defined functions.

info globals

List globals.

info process

Information about the process.

Expr

  • Member access: <object>-><member>
  • Cast: (<type>) <hex-addr>
  • String: "<string>"

Dependencies

~18–25MB
~523K SLoC