summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
Diffstat (limited to 'man')
-rw-r--r--man/wasm-interp.162
-rw-r--r--man/wasm-objdump.141
-rw-r--r--man/wasm2c.150
-rw-r--r--man/wasm2wat.159
-rw-r--r--man/wat-desugar.154
-rw-r--r--man/wat2wasm.163
6 files changed, 329 insertions, 0 deletions
diff --git a/man/wasm-interp.1 b/man/wasm-interp.1
new file mode 100644
index 00000000..ed5067f7
--- /dev/null
+++ b/man/wasm-interp.1
@@ -0,0 +1,62 @@
+.Dd $Mdocdate$
+.Dt WABT 1
+.Os
+.Sh NAME
+.Nm wasm-interp
+.Nd decode and run a WebAssembly binary file
+.Sh SYNOPSIS
+.Nm wasm-interp
+.Op options
+.Ar filename
+.Sh DESCRIPTION
+.Nm
+decodes and runs a WebAssembly binary file using a stack-based interpreter.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl v , Fl Fl verbose
+Use multiple times for more info
+.It Fl Fl help
+Print a help message
+.It Fl Fl enable-exceptions
+Experimental exception handling
+.It Fl Fl disable-mutable-globals
+Import/export mutable globals
+.It Fl Fl enable-saturating-float-to-int
+Saturating float-to-int operators
+.It Fl Fl enable-sign-extension
+Sign-extension operators
+.It Fl Fl enable-simd
+SIMD support
+.It Fl Fl enable-threads
+Threading support
+.It Fl V , Fl Fl value-stack-size=SIZE
+Size in elements of the value stack
+.It Fl C , Fl Fl call-stack-size=SIZE
+Size in elements of the call stack
+.It Fl t , Fl Fl trace
+Trace execution
+.It Fl Fl run-all-exports
+Run all the exported functions, in order. Useful for testing
+.It Fl Fl host-print
+Include an importable function named "host.print" for printing to stdout
+.El
+.Sh EXAMPLES
+ # parse binary file test.wasm, and type-check it
+ $ wasm-interp test.wasm
+.sp
+ # parse test.wasm and run all its exported functions
+ $ wasm-interp test.wasm --run-all-exports
+.sp
+ # parse test.wasm, run the exported functions and trace the output
+ $ wasm-interp test.wasm --run-all-exports --trace
+.sp
+ # parse test.wasm and run all its exported functions, setting the
+ # value stack size to 100 elements
+ $ wasm-interp test.wasm -V 100 --run-all-exports
+.Sh SEE ALSO
+wat2wasm(1), wasm2wat(1), wasm-objdump(1), wat-desugar(1), wasm2c(1)
+.Sh BUGS
+If you find a bug, please report it at
+.br
+<\fBhttps://github.com/WebAssembly/wabt/issues/\fP>.
diff --git a/man/wasm-objdump.1 b/man/wasm-objdump.1
new file mode 100644
index 00000000..4d47f765
--- /dev/null
+++ b/man/wasm-objdump.1
@@ -0,0 +1,41 @@
+.Dd $Mdocdate$
+.Dt WABT 1
+.Os
+.Sh NAME
+.Nm wasm-objdump
+.Nd print information about a wasm binary
+.Sh SYNOPSIS
+.Nm wasm-objdump
+.Op options
+.Ar filename
+.Sh DESCRIPTION
+.Nm
+prints information about a wasm binary, similiar to objdump.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl Fl headers
+Print headers
+.It Fl j , Fl Fl section=SECTION
+Select just one section
+.It Fl s , Fl Fl full-contents
+Print raw section contents
+.It Fl d , Fl Fl disassemble
+Disassemble function bodies
+.It Fl Fl debug
+Print extra debug information
+.It Fl x , Fl Fl details
+Show section details
+.It Fl r , Fl Fl reloc
+Show relocations inline with disassembly
+.It Fl Fl help
+Print a help message
+.El
+.Sh EXAMPLES
+ $ wasm-objdump test.wasm
+.Sh SEE ALSO
+wat2wasm(1), wasm2wat(1), wasm-interp(1), wat-desugar(1), wasm2c(1)
+.Sh BUGS
+If you find a bug, please report it at
+.br
+<\fBhttps://github.com/WebAssembly/wabt/issues/\fP>.
diff --git a/man/wasm2c.1 b/man/wasm2c.1
new file mode 100644
index 00000000..18c1a9a3
--- /dev/null
+++ b/man/wasm2c.1
@@ -0,0 +1,50 @@
+.Dd $Mdocdate$
+.Dt WABT 1
+.Os
+.Sh NAME
+.Nm wasm2c
+.Nd convert a WebAssembly binary file to a C source and header
+.Sh SYNOPSIS
+.Nm wasm2c
+.Op options
+.Ar filename
+.Sh DESCRIPTION
+.Nm
+takes a WebAssembly module and produces an equivalent C source and header.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl v , Fl Fl verbose
+Use multiple times for more info
+.It Fl Fl help
+Print a help message
+.It Fl o , Fl Fl output=FILENAME
+Output file for the generated C source file, by default use stdout
+.It Fl Fl enable-exceptions
+Experimental exception handling
+.It Fl Fl disable-mutable-globals
+Import/export mutable globals
+.It Fl Fl enable-saturating-float-to-int
+Saturating float-to-int operators
+.It Fl Fl enable-sign-extension
+Sign-extension operators
+.It Fl Fl enable-simd
+SIMD support
+.It Fl Fl enable-threads
+Threading support
+.It Fl Fl no-debug-names
+Ignore debug names in the binary file
+.El
+.Sh EXAMPLES
+ # parse binary file test.wasm and write test.c and test.h
+ $ wasm2c test.wasm -o test.c
+.sp
+ # parse test.wasm, write test.c and test.h, but ignore the debug names,
+ # if any
+ $ wasm2c test.wasm --no-debug-names -o test.c
+.Sh SEE ALSO
+wat2wasm(1), wasm2wat(1), wasm-objdump(1), wasm-interp(1), wat-desugar(1)
+.Sh BUGS
+If you find a bug, please report it at
+.br
+<\fBhttps://github.com/WebAssembly/wabt/issues/\fP>.
diff --git a/man/wasm2wat.1 b/man/wasm2wat.1
new file mode 100644
index 00000000..d8159bfc
--- /dev/null
+++ b/man/wasm2wat.1
@@ -0,0 +1,59 @@
+.Dd $Mdocdate$
+.Dt WABT 1
+.Os
+.Sh NAME
+.Nm wasm2wat
+.Nd translate from the binary format to the text format
+.Sh SYNOPSIS
+.Nm wasm2wat
+.Op options
+.Ar filename
+.Sh DESCRIPTION
+.Nm
+does the inverse of wat2wasm, translate from the binary format back to the text format (also known as a .wat).
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl v , Fl Fl verbose
+Use multiple times for more info
+.It Fl Fl help
+Print a help message
+.It Fl o , Fl Fl output=FILENAME
+Output file for the generated wast file, by default use stdout
+.It Fl f , Fl Fl fold-exprs
+Write folded expressions where possible
+.It Fl Fl enable-exceptions
+Experimental exception handling
+.It Fl Fl disable-mutable-globals
+Import/export mutable globals
+.It Fl Fl enable-saturating-float-to-int
+Saturating float-to-int operators
+.It Fl Fl enable-sign-extension
+Sign-extension operators
+.It Fl Fl enable-simd
+SIMD support
+.It Fl Fl enable-threads
+Threading support
+.It Fl Fl inline-exports
+Write all exports inline
+.It Fl Fl inline-imports
+Write all imports inline
+.It Fl Fl no-debug-names
+Ignore debug names in the binary file
+.It Fl Fl generate-names
+Give auto-generated names to non-named functions, types, etc.
+.It Fl Fl no-check
+Don't check for invalid modules
+.El
+.Sh EXAMPLES
+ # parse binary file test.wasm and write text file test.wast
+ $ wasm2wat test.wasm -o test.wat
+.sp
+ # parse test.wasm, write test.wat, but ignore the debug names, if any
+ $ wasm2wat test.wasm --no-debug-names -o test.wat
+.Sh SEE ALSO
+wat2wasm(1), wasm-objdump(1), wasm-interp(1), wat-desugar(1), wasm2c(1)
+.Sh BUGS
+If you find a bug, please report it at
+.br
+<\fBhttps://github.com/WebAssembly/wabt/issues/\fP>.
diff --git a/man/wat-desugar.1 b/man/wat-desugar.1
new file mode 100644
index 00000000..e7422556
--- /dev/null
+++ b/man/wat-desugar.1
@@ -0,0 +1,54 @@
+.Dd $Mdocdate$
+.Dt WABT 1
+.Os
+.Sh NAME
+.Nm wat-desugar
+.Nd parse .wat text form and print "canonical" flat format
+.Sh SYNOPSIS
+.Nm wat-desugar
+.Op options
+.Ar filename
+.Sh DESCRIPTION
+.Nm
+parses .wat text form as supported by the spec interpreter (s-expressions, flat syntax, or mixed) and prints "canonical" flat format.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl Fl help
+Print a help message
+.It Fl o , Fl Fl output=FILE
+Output file for the formatted file
+.It Fl Fl debug-parser
+Turn on debugging the parser of wat files
+.It Fl f , Fl Fl fold-exprs
+Write folded expressions where possible
+.It Fl Fl enable-exceptions
+Experimental exception handling
+.It Fl Fl disable-mutable-globals
+Import/export mutable globals
+.It Fl Fl enable-saturating-float-to-int
+Saturating float-to-int operators
+.It Fl Fl enable-sign-extension
+Sign-extension operators
+.It Fl Fl enable-simd
+SIMD support
+.It Fl Fl enable-threads
+Threading support
+.It Fl Fl generate-names
+Give auto-generated names to non-named functions, types, etc.
+.El
+.Sh EXAMPLES
+ # write output to stdout
+ $ wat-desugar test.wat
+.sp
+ # write output to test2.wat
+ $ wat-desugar test.wat -o test2.wat
+.sp
+ # generate names for indexed variables
+ $ wat-desugar --generate-names test.wat
+.Sh SEE ALSO
+wat2wasm(1), wasm2wat(1), wasm-objdump(1), wasm-interp(1), wasm2c(1)
+.Sh BUGS
+If you find a bug, please report it at
+.br
+<\fBhttps://github.com/WebAssembly/wabt/issues/\fP>.
diff --git a/man/wat2wasm.1 b/man/wat2wasm.1
new file mode 100644
index 00000000..39ea3657
--- /dev/null
+++ b/man/wat2wasm.1
@@ -0,0 +1,63 @@
+.Dd $Mdocdate$
+.Dt WABT 1
+.Os
+.Sh NAME
+.Nm wat2wasm
+.Nd translate from WebAssembly text format to the WebAssembly binary format
+.Sh SYNOPSIS
+.Nm wat2wasm
+.Op options
+.Ar filename
+.Sh DESCRIPTION
+.Nm
+translates from WebAssembly text format to the WebAssembly binary format.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl v , Fl Fl verbose
+Use multiple times for more info
+.It Fl Fl help
+Print a help message
+.It Fl Fl debug-parser
+Turn on debugging the parser of wat files
+.It Fl d , Fl Fl dump-module
+Print a hexdump of the module to stdout
+.It Fl Fl enable-exceptions
+Experimental exception handling
+.It Fl Fl disable-mutable-globals
+Import/export mutable globals
+.It Fl Fl enable-saturating-float-to-int
+Saturating float-to-int operators
+.It Fl Fl enable-sign-extension
+Sign-extension operators
+.It Fl Fl enable-simd
+SIMD support
+.It Fl Fl enable-threads
+Threading support
+.It Fl o , Fl Fl output=FILE
+output wasm binary file
+.It Fl r , Fl Fl relocatable
+Create a relocatable wasm binary (suitable for linking with e.g. lld)
+.It Fl Fl no-canonicalize-leb128s
+Write all LEB128 sizes as 5-bytes instead of their minimal size
+.It Fl Fl debug-names
+Write debug names to the generated binary file
+.It Fl Fl no-check
+Don't check for invalid modules
+.El
+.Sh EXAMPLES
+ # parse and typecheck test.wat
+ $ wat2wasm test.wat
+.sp
+ # parse test.wat and write to binary file test.wasm
+ $ wat2wasm test.wat -o test.wasm
+.sp
+ # parse spec-test.wast, and write verbose output to stdout (including
+ # the meaning of every byte)
+ $ wat2wasm spec-test.wast -v
+.Sh SEE ALSO
+wasm2wat(1), wasm-objdump(1), wasm-interp(1), wat-desugar(1), wasm2c(1)
+.Sh BUGS
+If you find a bug, please report it at
+.br
+<\fBhttps://github.com/WebAssembly/wabt/issues/\fP>.