[Lldb-commits] [PATCH] D72751: [LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging

Paolo Severini via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 23 18:23:16 PST 2020


paolosev updated this revision to Diff 240077.
paolosev added a comment.

Thanks for the explanation! I wasn't quite clear on "executable module" here, but after your comments I realized that `Target::SetExecutableModule()` should not probably be called also for Wasm modules.
The point is that `ObjectFileWasm::CalculateType()` should return `eTypeSharedLibrary`, not `eTypeExecutable`.
With this change the first issue is easily solved: we just need to call `Target::SetSectionLoadAddress()` once, in `ObjectFileWasm::SetLoadAddress()` because `Target::SetExecutableModule() -> Target::ClearModules() -> SectionLoadList::Clear()` is not called, and `DynamicLoaderWasmDYLD::DidAttach()` can be simplified to just call `ProcessGDBRemote::LoadModules()`.
Does this solution work for you? If so, we should look at the second point, the need to initialize `m_file_addr = m_file_offset = 0` for the "code" Section in order to make the DWARF symbols work...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72751

Files:
  lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestWasm.py
  lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/test_wasm.yaml
  lldb/source/API/SystemInitializerFull.cpp
  lldb/source/Plugins/DynamicLoader/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/wasm-DYLD/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp
  lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.h
  lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
  lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
  lldb/tools/lldb-test/SystemInitializerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72751.240077.patch
Type: text/x-patch
Size: 28124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200124/2147ad2d/attachment-0001.bin>


More information about the lldb-commits mailing list