-
Notifications
You must be signed in to change notification settings - Fork 18
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
Be able to debug WASM modules #37
Comments
A probably related link, screencast of debugging with wasmtime. |
I'd be interested in hearing more about what you need to fully address this. As shown in the link @pepyakin posted, we support LLDB debugging on Linux and macOS in Wasmtime, which hopefully should go a long way to addressing this. Windows is trickier, but apparently feasible. Beyond just supporting more platforms, are there specific features or pieces of functionality you'd need for this to be usable? |
@tschneidereit sorry I missed your comment here, so very late reply ☹ the wasmtime work on debugging looks promising! though assume it is primarily working for loose WASM modules loaded & run through the wasmtime executable host? The use case we after is debugging WASM modules loaded by our own executable host that embeds a WASM runtime engine (like wasmtime), and ideally debugging using VS Code or other standalone IDE debuggers. Though I a CLI-based debugger interface like GDB/LLDB could also be a start. Have there been any more developments with wasmtime around debugging and would the debugging support that it has be able to be used in the context of wasmtime embedded into our own executable host (that also implements multiple of our own WASM FFI APIs). As for platforms, we work pretty evenly split between Windows, Linux and Mac OS. Though having an initial solution that works on Linux & Mac that would work for most of us |
@repi no worries at all! 🙂
If I understand the use case correctly, that should work perfectly well: Wasmtime debugging is not in any way tied to the By the same token, debugging in VS Code should work just the same as it would for debugging the host application.
How the Wasm/host context switch happens shouldn't make much of a difference, so the fact that you have your own FFI APIs shouldn't affect things much. (Also, I'd be amiss if I didn't mention the possibility of defining host APIs using witx, as described in this very nice post by @radu-matei.)
Windows should actually work by now. We haven't tested it too much, but debugging in VS Code using LLDB seems to work just fine. If you end up looking into this more, don't hesitate to reach out and let us know if you run into issues — or just generally how things are going, and what could be improved! |
@tschneidereit oh that is good news! both that debugging with LLDB of WASM modules should just work inside VSCode and for Windows. we'll try it out!
Interface types and WITX is one of the things we've been eyeing and are interested in trying out with wasmtime, haven't seen that specific article though so that is a good resource, thanks! We have a pretty extensive set of versioned private APIs right now that we define the FFI and Rust interfaces for using Rust + some proc macros that @Jake-Shadle created. A bit like wasm-bindgen macros with higher-level types in but where we generated both the FFI and the safe host and module Rust APIs for, it is a but custom for our use though but has been a good help.
Thanks, we are starting up looking into wasmtime and experimenting with it in more detail now again and was planning to reach out to you all soon when we have some more concrete topics and questions to discuss |
Our in-house wasmtime embedder now has the ability to enable debug information generation, which is a huge improvement over printf debugging 🎉 Right now, this enables us to run our app in a recent version of LLDB, and then allows us to:
Overall it's pretty nice that enabling debug info support was just a configuration toggle to enable, and people in the wasmtime's zulip have been pretty helpful explaining how to get variable inspection to work at all! We can consider this particular issue closed: while debugging support is not complete yet, we now have some debugging support, that is a very nice start and something we can build upon. |
We currently can't debug our WASM modules (that we run not in a browser), this will become a bigger and bigger issue going forward so we should investigate what are the paths for getting some type of debugging support either with
wasmer
orwasmtime
.We would want it to be super easy to debug the code for a small (or big) WASM module directly in VS Code as well as in other editors.
Related:
wasmer:
Add support for step debugging and Virtual Machine introspectionThe text was updated successfully, but these errors were encountered: