[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

Paolo Severini via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 2 10:51:29 PST 2024


paolosevMSFT wrote:

> Seems like support for reading Wasm local and global variables is available in your code, but I don't understand how can one effectively read these variables from the lldb command line. Maybe adding commands to access these can be useful ?

The idea for this patch was only to support source-level debugging of code compiled to Wasm.
I do agree that it might also be useful to add better low-level Wasm debugging functionalities, like the ability of examining Wasm locals, globals, but this is beyond the scope of this initial patch and can certainly be added later.
It should already be possible to examine the value of Wasm memories and to show Wasm disassembly code.



> When using `read register` I can only see `pc` and nothing else though. I'm not sure assimilating Wasm variables to registers is the good way to go anyway, because the number of Wasm variables is not fixed in advance, and subject to the context of execution (with local variables). This is not the case at all for classic CPU registers, and I'm not sure the generic code managing registers in lldb will support that. 

We are using registers here just a nice technique, devised by @xujuntwt95329, to minimize Wasm-specific changes to LLDB Core classes. The idea was not really to make these registers available to the user, even though even this can certainly be improved in the future.

https://github.com/llvm/llvm-project/pull/77949


More information about the lldb-commits mailing list