[Lldb-commits] [lldb] [lldb] Update dwim-print to support limited variable expression paths (PR #117452)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 27 01:41:35 PST 2024


================
@@ -154,5 +163,25 @@ def test_preserves_persistent_variables(self):
     def test_missing_type(self):
         """The expected output of po opaque is its address (no error)"""
         self.build()
-        lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.c"))
+        lldbutil.run_to_source_breakpoint(
+            self, "break here", lldb.SBFileSpec("main.cpp")
+        )
         self.expect("dwim-print -O -- opaque", substrs=["0x"])
+
+    def test_variable_expression_path(self):
+        """Test dwim-print supports certain variable expression paths."""
+        self.build()
+        lldbutil.run_to_source_breakpoint(
+            self, "break here", lldb.SBFileSpec("main.cpp")
+        )
+        self.runCmd("settings set auto-one-line-summaries false")
+        self._expect_cmd("dwim-print w.s", "frame variable")
+        self._expect_cmd("dwim-print wp->s", "expression")
----------------
Michael137 wrote:

Should we also add cases for `*`/`[]`/`&`? Or are those tested elsewhere?

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


More information about the lldb-commits mailing list