Looking for this year's edition? Please visit WASM I/0 2025

Session

Look who's talking!

Detail illustration WASM I/O Detail illustration WASM I/O
Nisanthan Nanthakumar
blend-mode

WebAssembly Debugging Demystified

Nisanthan Nanthakumar - Sentry

Slides

WebAssembly is a low-level, binary format for web applications that is designed to be fast and efficient. It allows developers to write code in languages other than JavaScript, and then compile that code to run on the web. As with any software, debugging is an important part of the development process for WebAssembly applications. Debugging helps identify and fix issues in the code, ensuring that the application performs as expected and meets the desired requirements.

Outline

  • Explain the DWARF debug file format and how to generate it.
  • Using browser developer tools: Most modern web browsers come with a set of developer tools that you can use to debug WebAssembly applications. These tools allow you to inspect the code, set breakpoints, and evaluate expressions.
    • Use debuggers and profilers: Debuggers and profilers are specialized tools that can help you identify and fix issues in your WebAssembly code. Debuggers allow you to step through your code line by line and set breakpoints, while profilers can help you identify performance bottlenecks in your code.
    • Use memory analyzers: Memory analyzers can help you identify and fix memory issues in your WebAssembly code. These tools allow you to monitor the memory usage of your application and identify any leaks or other issues that may be causing problems. Ex: Memory Inspector in Chrome
  • Use logging and monitoring tools: Logging and monitoring tools can be useful for debugging WebAssembly applications in production environments. These tools allow you to track the behavior of your application and identify any issues that may arise.
  • Capturing errors in production
    • Use Sentry’s SDK to capture errors.
    • Sentry has build a tool wasm-split that can split a .wasm file into a debug information file and a final stripped .wasm file without debug information. Uploading the .debug.wasm file lets Sentry process native crashes and provide symbolicated stack traces of production errors.

View all sessions