Hi. I've seen this topic mentioned here before, and am hoping someone can help me better understand the reason for the behavior.
The symptom is that when I am running a Wasm program in a debugger (I've tried both GDB and LLDB), I am unable to inspect the value of local variables. The names are visible, but the value shows as "optimized out" or "not available". I've verified that the module I am using has been compiled in debug mode, and that wasmtime is configured for "debug_info".
I found a related bug report from a few months ago (https://github.com/bytecodealliance/wasmtime/issues/3884), which seems to say that it did indeed work once.
The context for my question is that I writing some documentation to explain a possible development workflow for creating server-side Wasm modules, and one of the subjects I'd like to touch on is debugging. My readers are going to be surprised that local variable values are unavailable, and I'd like to explain why at a very high level (even if only to give an assurance that it will be fixed soon).
Thanks!
Pete
In general the LLDB/GDB DWARF debugging support from Wasmtime is quite experimental and hasn't really seen much development since it was first added. There are likely bugs with it and you're probably running into such a bug here. It would be good to categorize these test cases perhaps but otherwise I wouldn't rely on the current support too much since it likely needs improvement to be more robust.
Completely reasonable answer. Thank you so much; I'll convey that message.
Last updated: Nov 22 2024 at 16:03 UTC