[Lldb-commits] [lldb] [lldb-dap] Add: show return value on step out (PR #106907)

Adrian Vogelsgesang via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 12 20:37:15 PST 2025


================
@@ -663,6 +663,41 @@ def do_test_indexedVariables(self, enableSyntheticChildDebugging: bool):
         ]["variables"]
         self.verify_variables(verify_children, children)
 
+    def test_return_variables(self):
+        """
+        Test the stepping out of a function with return value show the variable correctly.
+        """
+        program = self.getBuildArtifact("a.out")
+        self.build_and_launch(program)
+
+        verify_locals = {
+            "(Return Value)": {"equals": {"type": "int", "value": "300"}},
+            "argc": {},
+            "argv": {},
+            "pt": {},
+            "x": {},
+            "return_result": {"equals": {"type": "int"}},
+        }
+
+        function_name = "test_return_variable"
+        breakpoint_ids = self.set_function_breakpoints([function_name])
+
+        self.assertEqual(len(breakpoint_ids), 1)
+        self.continue_to_breakpoints(breakpoint_ids)
+
+        threads = self.dap_server.get_threads()
+        for thread in threads:
+            if thread.get("reason") == "breakpoint":
+                # We have a thread that
----------------
vogelsgesang wrote:

incomplete sentence

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


More information about the lldb-commits mailing list