wasm-micro-runtime
wasm-micro-runtime copied to clipboard
How do you check the stack value when the WASM program is running the iwasm?
The WASM program doesn't like the normal X86 or arm program. It doesn't have the registers, so we can't get the stack memory address. I wonder how to check the stack memory info with lldb? Thank you very much!
Hi, the official lldb doesn't have the ability to get the operand stack values. In WAMR, we use a patch https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/build-scripts/lldb_wasm.patch to add some extended capabilities:
- process extended
DW_OP_WASM_location
opcode as defined here - add a custom gdb serial command
qWasmStackValue <frame index> <index>
to get theindex
slot of the specifiedframe