[Lldb-commits] [lldb] [lldb-dap] Report exit status message in lldb-dap, same as lldb cli (PR #89405)

via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 22 09:42:56 PDT 2024


================
@@ -104,3 +115,49 @@ def test_empty_escape_prefix(self):
             "Help can be invoked",
             command_escape_prefix="",
         )
+
+    @skipIfWindows
+    @skipIfRemote
+    def test_exit_status_message_sigterm(self):
+        source = "main.cpp"
+        program = self.getBuildArtifact("a.out")
+        self.build_and_launch(program, commandEscapePrefix="")
+        breakpoint1_line = line_number(source, "// breakpoint 1")
+        breakpoint_ids = self.set_source_breakpoints(source, [breakpoint1_line])
+        self.continue_to_breakpoints(breakpoint_ids)
+
+        # Kill lldb-server process.
+        process_name = (
+            "debugserver" if platform.platform() == "MacOS" else "lldb-server"
+        )
+        process = get_subprocess(process_name)
+        process.terminate()
+        process.wait(timeout=5)
+
+        # Get the console output
+        console_output = self.collect_console(1.0)
----------------
jeffreytan81 wrote:

I am not big fan of adding timeout in test for synchronization. It can always cause race condition in super busy machine. 

Instead, I would suggest wait for process to exit and get all the output which should guarantee to have all the output ready. This way also tests that exit/terminated events are sent after this exit message. 

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


More information about the lldb-commits mailing list