[Lldb-commits] [PATCH] D78801: [LLDB] Add class ProcessWasm for WebAssembly debugging
Paolo Severini via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 28 17:50:24 PDT 2020
paolosev added a comment.
In D78801#2009103 <https://reviews.llvm.org/D78801#2009103>, @clayborg wrote:
> Thanks for the explanations if everything WASM related. I now understand much better what you have.
> > Read Wasm memory.
> > IN : $qWasmMem:frame_index;addr;len
> > OUT: $xx..xx
> frame index seems weird in a memory read packet. Seems like the module ID should be passed instead of the frame index.
> Reading memory could be handled with memory identifiers, or segments. Currently the packets for m and M only have an address, but someone out there must support reading from CODE and DATA address segments in the DSP world. I have an email out to Ted Woodward to see what they do for Qualcomm's hexagon DSPs. I'll let you know what I find. Maybe each WASM module can identify N segments it needs and each module would have its own unique segments. Are module ID's just 1 based indexes?
True, for qWasmMem (and actually also for qWasmGlobal) it would be sufficient to pass the moduleId, but qWasmLocal and qWasmStackValue really need a frame index, and it is very easy for the runtime to find the module from a frame index, that's why I was passing only frame indices for uniformity. Easy to change :)
For reading memory, yes, I came up with ad hoc mechanism that works for Wasm, but if I could reuse existing mechanisms already used by other architectures and supported by Wasm, obviously it would be better.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the lldb-commits