[Lldb-commits] [lldb] [lldb] Implement WebAssembly debugging (PR #77949)

Paolo Severini via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 22 07:04:52 PST 2024


================
@@ -1450,6 +1450,14 @@ class Process : public std::enable_shared_from_this<Process>,
   /// platforms where there is a difference (only Arm Thumb at this time).
   lldb::addr_t FixAnyAddress(lldb::addr_t pc);
 
+  /// Some targets might use bits in a code address to represent additional
+  /// information; for example WebAssembly targets have a different memory space
+  /// per module and have a different address space per memory and code.
+  virtual lldb::addr_t FixMemoryAddress(lldb::addr_t address,
----------------
paolosevMSFT wrote:

I thought to add a new function because `Process::FixCodeAddress`, `Process::FixDataAddress`, `Process::FixAnyAddress` by default forward the call to `ABI::FixCodeAddress`, `ABI::FixDataAddress`, `ABI::FixAnyAddress`, which are implemented by plugin-specific ABIs like `ABISysV_arm`, `ABIMacOSX_arm`. But here we are not really dealing with a different ABI, it is more a custom representation of Wasm memory addresses used between the debugger and the Wasm engine.

If you prefer, we could reuse `Process::FixAnyAddress`, making it virtual and overriding it in `ProcessWasm`.

https://github.com/llvm/llvm-project/pull/77949


More information about the lldb-commits mailing list