[Lldb-commits] [lldb] [lldb] Add lldb.summary and lldb.synthetic decorators (PR #195351)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon May 4 22:17:58 PDT 2026
================
@@ -0,0 +1,31 @@
+"""
+Test @lldb.summary and @lldb.synthetic decorators lead to automatic formatter
+registration, when using `command script import`.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestCase(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def test_summary(self):
+ self.build()
+ self.runCmd("command script import formatters.py")
+ _, _, thread, _ = lldbutil.run_to_source_breakpoint(
+ self, "break here", lldb.SBFileSpec("main.cpp")
+ )
+ frame = thread.selected_frame
+ p = frame.var("p")
+ self.assertEqual(p.summary, "(1, 2)")
+
+ def test_synthetic(self):
----------------
JDevlieghere wrote:
Maybe another test for `regex=True`?
https://github.com/llvm/llvm-project/pull/195351
More information about the lldb-commits
mailing list