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

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 22 07:04:40 PDT 2024


================
@@ -104,3 +124,27 @@ def test_empty_escape_prefix(self):
             "Help can be invoked",
             command_escape_prefix="",
         )
+
+    @skipIfWindows
+    @skipIfRemote
+    def test_exit_status_message(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 = "lldb-server"
+        pid = get_subprocess_pid(process_name)
+        killProcess(pid, process_name)
+        # Get the console output
+        console_output = self.collect_console(1.0)
+
+        # Verify the exit status message is printed.
+        self.assertIn(
+            "exited with status = -1 (0xffffffff) debugserver died with signal SIGTERM",
+            console_output,
+            "Exit status does not contain message 'exited with status'"
+        )
----------------
walter-erquinigo wrote:

could you also add another test in which a successful exit (i.e. exit code = 0) is printed as well?

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


More information about the lldb-commits mailing list