[Lldb-commits] [lldb] [LLDB-DAP] Send Progress update message over DAP (PR #123837)

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 22 12:47:47 PST 2025


================
@@ -0,0 +1,49 @@
+"""
+Test lldb-dap output events
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+import os
+import time
+
+import lldbdap_testcase
+
+
+class TestDAP_progress(lldbdap_testcase.DAPTestCaseBase):
+    @skipIfWindows
+    def test_output(self):
+        program = self.getBuildArtifact("a.out")
+        self.build_and_launch(program)
+        progress_emitter = os.path.join(os.getcwd(), "Progress_emitter.py")
+        print(f"Progress emitter path: {progress_emitter}")
+        source = "main.cpp"
+        # Set breakpoint in the thread function so we can step the threads
+        breakpoint_ids = self.set_source_breakpoints(
+            source, [line_number(source, "// break here")]
+        )
+        self.continue_to_breakpoints(breakpoint_ids)
+        self.dap_server.request_evaluate(
+            f"`command script import {progress_emitter}", context="repl"
+        )
+        self.dap_server.request_evaluate(
+            "`test-progress --total 3 --seconds 1", context="repl"
+        )
+
+        self.dap_server.wait_for_event("progressEnd", 15)
+        # Expect at least a start, an update, and end event
+        # However because the progress is an RAII object and we can't guaruntee
----------------
Jlalond wrote:

I did, but I believe because we'll free that memory when the python object is destroyed we can't depend on the deterministic behavior of the RAII object.

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


More information about the lldb-commits mailing list