-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasm: support source maps for the unknown target #56660
Comments
There was brief support for them when the unknown target used binaryen as the linker, but with the switch to LLD the support was lost. However as far as I know the long term goal is to have proper debuginfo support (via a web version of DWARF) for WebAssembly. I'm pretty sure source maps were just a short term solution. |
Are source maps part of WebAssembly standard? If not, then I think we should not add them for |
Not yet. Current state of things:
I made a brief attempt to use wasm-dwarf on a My current script (creating a second modified @set NAME=rust_wasm_sample
cargo build --target=wasm32-unknown-unknown
wasm-dwarf ^
target/wasm32-unknown-unknown/debug/%NAME%.wasm ^
-p /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/=file://C:/Users/%USERNAME%/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/ ^
-p /cargo/registry/=file://C:/Users/%USERNAME%/.cargo/registry/ ^
-p src/liballoc/=file://C:/Users/%USERNAME%/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/liballoc/ ^
-p src/libcore/=file://C:/Users/%USERNAME%/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libcore/ ^
-p src/libstd/=file://C:/Users/%USERNAME%/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libstd/ ^
-p src/libpanic_abort/=file://C:/Users/%USERNAME%/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src/libpanic_abort/ ^
-p src/=../../../src/ ^
-w target/wasm32-unknown-unknown/debug/%NAME%_dbg.wasm ^
-o target/wasm32-unknown-unknown/debug/%NAME%_dbg.wasm.map ^
-m %NAME%_dbg.wasm.map |
I'm going to close this because tooling for wasm is generally moving towards DWARF nowadays which is supported by rustc. There's some tools in the ecosystem (I think) to convert DWARF to source maps, which should be used if source maps are desired. |
Quoting #46765, which was closed and locked inexplicably:
The text was updated successfully, but these errors were encountered: