Skip to content

haraldreingruber-dedalus/rust-wasm-dwarf-debugging

Repository files navigation

Rust+WebAssembly debugging demo

This example is based on the official Rust+Wasm Hello World example: https://rustwasm.github.io/docs/book/game-of-life/hello-world.html

TLDR

The main topics for enabling DWARF debugging are:

  • Configure wasm-pack to not strip DWARF debug info via the Cargo.toml
[package.metadata.wasm-pack.profile.dev.wasm-bindgen]
dwarf-debug-info = true

Prerequisites

Build and run demo with DWARF debug symbols

Run the demo app:

wasm-pack build --dev
cd www
npm run start

Open Chrome DevTools

  • Go to "Sources" tab

  • Open "file://<your repo path>/src/lib.rs"

  • Set a breakpoint in line 12

    alert("Hello, wasm-debug-dwarf!");

  • Reload the page and verify the DevTools debugger breaks as expected.

  • 🚀 Congrats, you are ready to debug Rust+WebAssembly in the browser!

About

This is a hello-world example, demostrating the Rust-WebAssembly-DWARF debugging workflow.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy