[Lldb-commits] [lldb] [lldb] Skip local variable declarations at start of Wasm function (PR #190093)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 2 01:45:22 PDT 2026


================
@@ -1355,6 +1355,25 @@ size_t Disassembler::AppendInstructions(Target &target, Address start,
 
   start = ResolveAddress(target, start);
 
+  // WebAssembly functions begin with local variable declarations that are part
+  // of the binary format but are not executable instructions. Skip past them
+  // so the disassembler doesn't try to decode non-instruction bytes.
+  if (m_arch.GetTriple().getArch() == llvm::Triple::wasm32 ||
+      m_arch.GetTriple().getArch() == llvm::Triple::wasm64) {
+    if (ModuleSP module_sp = start.GetModule()) {
+      SymbolContext sc;
+      module_sp->ResolveSymbolContextForAddress(start, eSymbolContextSymbol,
+                                                sc);
+      if (sc.symbol && sc.symbol->GetAddress() == start) {
----------------
DavidSpickett wrote:

Do we know that start will always be the very beginning of a function?

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


More information about the lldb-commits mailing list