[Lldb-commits] [lldb] [lldb] Don't fail scripted frame construction on unknown architectures (PR #205692)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 24 16:04:24 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

<details>
<summary>Changes</summary>

ScriptedFrame.get_register_info() dispatched on a hardcoded list of architectures (x86_64/arm64/arm/hexagon) to pick a general-purpose register layout and raised ValueError for anything else. Because ScriptedFrame.__init__ calls get_register_info() eagerly, this made every scripted frame fail to construct on an unlisted architecture such as wasm32: the Python exception surfaced as "invalid script object", the frame provider produced an empty stack, and that tripped the "a valid thread has no frames" assert in StackFrameList::GetFrameAtIndex.

Without better error reporting, I don't think that's a good or welcoming default.

Such architectures have no predefined GPR layout here, so leave the register info empty instead of raising and let the frame construct.

Assisted-by: Claude

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


1 Files Affected:

- (modified) lldb/examples/python/templates/scripted_process.py (+5-1) 


``````````diff
diff --git a/lldb/examples/python/templates/scripted_process.py b/lldb/examples/python/templates/scripted_process.py
index af21c80e6896d..82e19d82357aa 100644
--- a/lldb/examples/python/templates/scripted_process.py
+++ b/lldb/examples/python/templates/scripted_process.py
@@ -533,7 +533,11 @@ def get_register_info(self):
                     self.register_info["sets"] = ["General Purpose Registers"]
                     self.register_info["registers"] = HEXAGON_GPR
                 else:
-                    raise ValueError("Unknown architecture", self.arch)
+                    # No predefined general-purpose register layout for this
+                    # architecture. Leave the register info empty rather than
+                    # failing to construct the scripted frame.
+                    self.register_info["sets"] = []
+                    self.register_info["registers"] = []
         return self.register_info
 
     @abstractmethod

``````````

</details>


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


More information about the lldb-commits mailing list