[Lldb-commits] [PATCH] D78801: [LLDB] Add class WasmProcess for WebAssembly debugging

Paolo Severini via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 4 05:18:23 PDT 2020


paolosev updated this revision to Diff 261780.
paolosev retitled this revision from "[LLDB] Add class ProcessWasm for WebAssembly debugging" to "[LLDB] Add class WasmProcess for WebAssembly debugging".
paolosev edited the summary of this revision.
paolosev added a comment.

This patch is a work in progress where I am refactoring the code, as suggested, to remove almost all dependencies on Wasm from the LLDB core that were present in the previous patch. In particular:

- The logic to evaluate a DWARF expression is now separated from the DWARF expression data. There is a new kind of plugin, `DWARFEvaluator`, that can be used to define platform-specific evaluators. Base class `DWARFEvaluator` contains all the evaluation code extracted from class `DWARFExpression`.
- Plugin class `WasmDWARFEvaluation` takes care of evaluating WASM-specific codes like `DW_OP_WASM_location`.

- Process-plugin class `WasmProcess` provides functions to access the Wasm engine state through a GDB-remote connection. Now WasmProcess contains all the logic to send  Wasm-specific queries to the GDB stub; there are no more changes to existing classes like GDBRemoteClientConnection.
- Like before, class `UnwindWasm` handles stack unwinding by requesting the call stack from the Wasm engine.

In this way, the patch does not impose (almost) any  knowledge of WebAssembly on the LLDB core, besides the logic to register Wasm-specific plugin classes. The only exception still left is in class `Value` where in this patch there is still a dependency on WasmProcess that I need to remove.

Please, let me know if this is a step in the right direction, in your opinion. 
(I realize that this patch has become annoyingly large, but of course once we understand what could be a good solution I will split it in more manageable pieces).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78801/new/

https://reviews.llvm.org/D78801

Files:
  lldb/include/lldb/Core/PluginManager.h
  lldb/include/lldb/Expression/DWARFEvaluator.h
  lldb/include/lldb/Expression/DWARFExpression.h
  lldb/include/lldb/lldb-forward.h
  lldb/include/lldb/lldb-private-interfaces.h
  lldb/source/Core/PluginManager.cpp
  lldb/source/Core/Value.cpp
  lldb/source/Expression/CMakeLists.txt
  lldb/source/Expression/DWARFEvaluator.cpp
  lldb/source/Expression/DWARFExpression.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Plugins/CMakeLists.txt
  lldb/source/Plugins/DWARFEvaluator/CMakeLists.txt
  lldb/source/Plugins/DWARFEvaluator/wasm/CMakeLists.txt
  lldb/source/Plugins/DWARFEvaluator/wasm/WasmDWARFEvaluator.cpp
  lldb/source/Plugins/DWARFEvaluator/wasm/WasmDWARFEvaluator.h
  lldb/source/Plugins/Plugins.def.in
  lldb/source/Plugins/Process/CMakeLists.txt
  lldb/source/Plugins/Process/wasm/CMakeLists.txt
  lldb/source/Plugins/Process/wasm/UnwindWasm.cpp
  lldb/source/Plugins/Process/wasm/UnwindWasm.h
  lldb/source/Plugins/Process/wasm/WasmProcess.cpp
  lldb/source/Plugins/Process/wasm/WasmProcess.h
  lldb/source/Target/Thread.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78801.261780.patch
Type: text/x-patch
Size: 168431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200504/a10af318/attachment-0001.bin>


More information about the lldb-commits mailing list