← 返回命令列表

Linux command

wasm2wat 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Convert to WAT

wasm2wat [input.wasm]

Output to file

wasm2wat [input.wasm] -o [output.wat]

Fold expressions

wasm2wat --fold-exprs [input.wasm]

Generate names

wasm2wat --generate-names [input.wasm]

说明

wasm2wat is a disassembler from the WABT (WebAssembly Binary Toolkit) that converts WebAssembly binary (.wasm) files into the human-readable WebAssembly Text Format (WAT). The WAT output uses S-expression syntax that represents the module structure, functions, types, imports, and exports in a readable form. The tool is essential for debugging and inspecting compiled WebAssembly modules, allowing developers to examine the actual instructions generated by compilers. Options like --fold-exprs produce more compact output by nesting expressions, and --generate-names assigns readable names to unnamed functions and variables. Output can be written to a file or printed to stdout for piping to other tools. The reverse operation (text to binary) is performed by the companion tool wat2wasm.

参数

-o _FILE_
Output file.
--fold-exprs
Fold expressions.
--generate-names
Generate names.
--inline-exports
Inline exports.
--help
Show help.

FAQ

What is the wasm2wat command used for?

wasm2wat is a disassembler from the WABT (WebAssembly Binary Toolkit) that converts WebAssembly binary (.wasm) files into the human-readable WebAssembly Text Format (WAT). The WAT output uses S-expression syntax that represents the module structure, functions, types, imports, and exports in a readable form. The tool is essential for debugging and inspecting compiled WebAssembly modules, allowing developers to examine the actual instructions generated by compilers. Options like --fold-exprs produce more compact output by nesting expressions, and --generate-names assigns readable names to unnamed functions and variables. Output can be written to a file or printed to stdout for piping to other tools. The reverse operation (text to binary) is performed by the companion tool wat2wasm.

How do I run a basic wasm2wat example?

Run `wasm2wat [input.wasm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _FILE_ do in wasm2wat?

Output file.