---
title: "Debug File Formats"
description: "Learn about platform-specific file formats and the debug information they contain."
url: https://docs.sentry.io/platforms/native/guides/wasm/data-management/debug-files/file-formats/
---

# Debug File Formats for WebAssembly

Sentry differentiates four kinds of debug information:

* **Debug Information:** Provides function names, paths to source files, line numbers, and inline frames. The process of resolving this information from instruction addresses is called "symbolication". This information is relatively large compared to the executable and usually put into a separate file. In Sentry, these files are designated as *debug companions* and show the `debug` tag.

* **Symbol Tables:** If debug information is not available for a certain library, Sentry can use symbol tables as a fallback to retrieve function names. Symbol tables are usually included in both the executable and debug companion files. However, they do not contain sufficient information to resolve inline functions or file names and line numbers. The `symtab` tag indicates symbol tables.

* **Source Code:** Conventionally, source code is not part of regular debug information files. Sentry CLI can bundle source code of your application and upload it to display source context in stack traces in Sentry. These bundles show up with the `sources` tag.

* **Unwind Information:** Enables Sentry to extract stack traces from Minidumps and other binary crash formats of optimized builds. This process is referred to as "stack unwinding" or "stack walking". Since this is also required when throwing exceptions in C++, this information is often included in the executable or library. If an uploaded file contains this information, it shows the `unwind` tag. Note that on some platforms no actual unwinding takes place. For instance, WebAssembly currently does not have the equivalent of minidumps which means we do not require that type of information in such cases.

Compilers place the above debug information in different files passed on the target platform, architecture, build flags or optimization level. Consequently, Sentry might not need all of the above information to process crash reports. Still, it is always a good idea to provide all available debug information.

`sentry-cli` can be used to list properties of supported debug files and validate their contents. See [*Debug Information Files in sentry-cli*](https://docs.sentry.io/cli/dif.md) for more information.

## [WASM](https://docs.sentry.io/platforms/native/guides/wasm/data-management/debug-files/file-formats.md#wasm)

For WebAssembly, we support [DWARF in WASM containers](https://yurydelendik.github.io/webassembly-dwarf/). Note that we do not support source maps, which are also a format used for WASM debugging, but have shortcomings that make them impractical for a crash reporting tool like Sentry.

Since WASM does not specify debug/build IDs yet, we provide a separate tool to add build IDs and split files called [wasm-split](https://github.com/getsentry/symbolicator/blob/master/crates/wasm-split) to help you create a debug companion file ready for uploading to Sentry while removing all debug information from the release binary.

### [Keeping DWARF in Your Build](https://docs.sentry.io/platforms/native/guides/wasm/data-management/debug-files/file-formats.md#keeping-dwarf-in-your-build)

In a traditional Unix-style toolchain, `-g` at compile time is enough: the linker combines the DWARF sections from the object files into its output. WASM toolchains add a step after compilation that decides what ships, so debug information can sit in the intermediate artifacts and still be missing from the module you upload.

#### [Emscripten](https://docs.sentry.io/platforms/native/guides/wasm/data-management/debug-files/file-formats.md#emscripten)

`emcc` takes the usual clang flags to emit DWARF into object files, but strips most of it at link time unless a debug flag is passed there as well:

```bash
# Compile: DWARF lands in the object files
emcc -g -c app.c -o app.o

# Link: without -g here, emcc strips it back out
emcc -g app.o -o app.wasm
```

A single `emcc` call that compiles and links at once covers both phases.

#### [Rust and wasm-bindgen](https://docs.sentry.io/platforms/native/guides/wasm/data-management/debug-files/file-formats.md#rust-and-wasm-bindgen)

`rustc` and `wasm-ld` produce a module with DWARF in its `.debug_*` sections, but `wasm-bindgen` runs after linking and drops most of it while rewriting the module for JavaScript interop. Keep it explicitly:

```toml
# Cargo.toml
[profile.release]
debug = 2

[package.metadata.wasm-pack.profile.release.wasm-bindgen]
dwarf-debug-info = true
```

If you invoke `wasm-bindgen` yourself instead of going through `wasm-pack`, pass `--keep-debug` instead.

#### [Verifying the Output](https://docs.sentry.io/platforms/native/guides/wasm/data-management/debug-files/file-formats.md#verifying-the-output)

Check the companion before uploading it. The output should list a `debug` tag:

```bash
wasm-split app.wasm -d app.debug.wasm --strip
sentry-cli debug-files check app.debug.wasm
```

See [Checking Debug Information Files](https://docs.sentry.io/cli/dif.md#checking-files) for the full output format.

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
