[Lldb-commits] [PATCH] D78978: [LLDB] Add support for WebAssembly debugging

Paolo Severini via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 27 18:20:53 PDT 2020

paolosev created this revision.
paolosev added reviewers: labath, clayborg.
paolosev added a project: LLDB.
Herald added subscribers: lldb-commits, sunfish, aheejin, jgravelle-google, sbc100, aprantl, mgorny, dschuff.
paolosev edited the summary of this revision.

This patch is a refactoring of  https://reviews.llvm.org/D78801. As suggested, I have created a separate patch to more easily compare the implementations.
Even here, the goal is to use the GDB-remote protocol to connect to a Wasm engine that implements a GDB-remote stub that offers the ability to access the engine runtime internal state.

Here I am removing the interface IWasmProcess and the new class WasmProcessGDBRemote and moving most of the Wasm logic in `ProcessGDBRemote`.
I am still adding the new Unwind class `UnwindWasm`, which now however is in core and not in plugins code.  Having a Unwind-derived class for Wasm unwinding seems to be the cleanest solution.

The advantage with this new design is that the required changes are smaller and isolated in a few places.
The drawback is that three 'core' classes (UnwindWasm, Value and DWARFExpression) have now a dependency on ProcessGDBRemote and/or ThreadGDBRemote. This could be avoided re-introducing a core interface like IWasmProcess. We could add a couple of virtual method  `bool IsWasmProcess()` and `IWasmProcess* AsWasmProcess()` to Process, which would be overridden by ProcessGDBRemote. Then these classes could just query this interface, removing direct dependencies on GDBRemote.

I am also adding a new `qSupported` flag named "wasm" that should tell LLDB whether the remote supports Wasm debugging.

  rG LLVM Github Monorepo



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78978.260509.patch
Type: text/x-patch
Size: 21537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200428/8071906a/attachment-0001.bin>

More information about the lldb-commits mailing list