Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

jat001/rust-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-wasm

Debugging

  1. Install wasm-bindgen-cli and Chrome extension C/C++ DevTools Support (DWARF) (only compatible with Chrome Canary and Dev version, MSEdge is not supported).

  2. Build

    cargo build --target wasm32-unknown-unknown
    wasm-bindgen --keep-debug --web --out-dir pkg target/wasm32-unknown-unknown/debug/rust_wasm.wasm

    wasm-pack is not used because it does not support --keep-debug option. See rustwasm/wasm-pack#1351.

  3. Serve

    python3 -m http.server

    Or use any other http server you like.

  4. Open http://localhost:8000

  5. Open Chrome DevTools and go to Sources tab.

    You should see top -> file:// -> ${workspaceFolder}/src -> lib.rs under Page pane.

  6. VSCode is also supported. Use VSCode Insiders version and install WebAssembly DWARF Debugging extension.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks