Skip to content
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

source debugging of compiled wasm #18

Closed
ferologics opened this issue Feb 15, 2023 · 4 comments
Closed

source debugging of compiled wasm #18

ferologics opened this issue Feb 15, 2023 · 4 comments

Comments

@ferologics
Copy link

is there any support for debugging source code compiled to wasm in sight? (i.e. Rust code)

@RReverser
Copy link
Member

It's already been working for a while for C / C++: https://developer.chrome.com/blog/wasm-debugging-2020/

As for other languages, it's up to respective toolchains to correctly emit debugging information. Rust support in particular - assuming you're talking about the Web via wasm-bindgen - is tracked on their own repo at rustwasm/wasm-bindgen#2389.

@ferologics
Copy link
Author

@RReverser thx, the use case I have in mind is for non-web Rust, no wasm-bindgen, just FFI pointers, compiled with cargo build --target wasm32-unknown-unknown, interpreted by wasm3. I'd like to debug this wasm in runtime like regular Rust code, put a breakpoint, step through, etc., but am not sure how/if that should work in such setup.

@RReverser
Copy link
Member

RReverser commented Feb 15, 2023

Then it's up to wasm3 to implement debugging, although knowing the author's situation (he's a Ukrainian who lost his home to Russian bombarding), I don't know if he'll have time / priority to work on it soon.

Rust itself emits debug symbols correctly though, and some runtimes like wasmtime already make use of it: https://docs.wasmtime.dev/examples-debugging.html

Either way, this is not really an issue / discussion for the standards repo, since it's up to specific runtimes to implement the necessary functionality now.

@ferologics
Copy link
Author

okay, thanks a lot for your response, unfortunately I can't use wasmtime due to JIT compilation, so wasm3 is the only option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants