[Lldb-commits] [lldb] Implement data formatters for LibStdC++ std::variant (PR #68012)

via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 2 17:41:17 PDT 2023


================
@@ -0,0 +1,72 @@
+"""
+Test lldb data formatter for LibStdC++ std::variant.
+"""
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+USE_LIBSTDCPP = "USE_LIBSTDCPP"
+
+
+class LibStdcxxVariantDataFormatterTestCase(TestBase):
+    @add_test_categories(["libstdcxx"])
+    def test_with_run_command(self):
+        """Test LibStdC++ std::variant data formatter works correctly."""
+        self.build(dictionary={USE_LIBSTDCPP: "1"})
+
+        (self.target, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(
+            self, "// break here", lldb.SBFileSpec("main.cpp", False)
+        )
+
+        lldbutil.continue_to_breakpoint(self.process, bkpt)
+        self.assertEqual(3 + 4, 7)
----------------
jeffreytan81 wrote:

lol, this is an old diff that I drafted several months ago so totally forgot why I added this in the first place :-)

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


More information about the lldb-commits mailing list