[Lldb-commits] [lldb] [lldb] Fix crash when evaluating expressions in Wasm targets (PR #192893)

via lldb-commits lldb-commits at lists.llvm.org
Sun Apr 19 21:31:26 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

<details>
<summary>Changes</summary>

LLDB crashes with "LLVM ERROR: Incompatible object format!" when evaluating expressions while debugging WebAssembly because ProcessWasm never disables JIT. RuntimeDyld only supports ELF, MachO, and COFF object formats, so attempting to JIT-compile an expression for a Wasm target produces the aforementioned fatal error.

This PR avoids the crash by calling `SetCanJIT(false)` in the `ProcessWasm` ctor. Simple expressions will still work via the IR interpreter, while expression requiring the JIT now show a proper error message instead of crashing.

Fixes #<!-- -->179915

---
Full diff: https://github.com/llvm/llvm-project/pull/192893.diff


1 Files Affected:

- (modified) lldb/source/Plugins/Process/wasm/ProcessWasm.cpp (+3) 


``````````diff
diff --git a/lldb/source/Plugins/Process/wasm/ProcessWasm.cpp b/lldb/source/Plugins/Process/wasm/ProcessWasm.cpp
index 02eb0da5632c6..b378a772b324f 100644
--- a/lldb/source/Plugins/Process/wasm/ProcessWasm.cpp
+++ b/lldb/source/Plugins/Process/wasm/ProcessWasm.cpp
@@ -28,6 +28,9 @@ ProcessWasm::ProcessWasm(lldb::TargetSP target_sp, ListenerSP listener_sp)
   // Wasm doesn't have any Unix-like signals as a platform concept, but pretend
   // like it does to appease LLDB.
   m_unix_signals_sp = UnixSignals::Create(target_sp->GetArchitecture());
+  // FIXME: LLVM's RuntimeDyld doesn't support the Wasm object format, so we
+  // can't JIT expressions for this target.
+  SetCanJIT(false);
 }
 
 void ProcessWasm::Initialize() {

``````````

</details>


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


More information about the lldb-commits mailing list