1# Debugging WebAssembly
2
3The following steps describe a common way to debug a WebAssembly module in
4Wasmtime:
5
61. Compile your WebAssembly with debug info enabled, usually `-g`; for
7   example:
8
9    ```sh
10    clang foo.c -g -o foo.wasm
11    ```
12
132. Run Wasmtime with the debug info enabled; this is `-g` from the CLI and
14   `Config::debug_info(true)` in an embedding (e.g. see [debugging in a Rust
15   embedding](./examples-rust-debugging.md))
16
173. Use a supported debugger:
18
19    ```sh
20    lldb -- wasmtime run -g foo.wasm
21    ```
22    ```sh
23    gdb --args wasmtime run -g foo.wasm
24    ```
25