[Lldb-commits] [lldb] [lldb-dap] Create an empty target when the attach program is a process name (PR #233684)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 20 08:49:35 PDT 2026


================
@@ -124,6 +124,31 @@ def test_attach_command_process_failures(self):
             "attachCommands failed to attach to a process", response_error.format
         )
 
+    @skipIfNetBSD  # Hangs on NetBSD as well
+    @skipIfWasm  # the test releases the inferior with an expression
+    def test_program_is_process_name(self):
+        """
+        Tests that "attachCommands" attach when "program" is a process name,
+        which is not a file lldb can create a target from.
+        """
+        program = self.getBuildArtifact("a.out")
+        session = self.build_and_create_session()
+
+        process_event = session.attach(
+            AttachArgs(
+                program="no-such-process-name",
----------------
ashgti wrote:

If we have `"program"` and createTarget fails should we return an error instead? Around https://github.com/llvm/llvm-project/blob/main/lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp#L74-L78

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


More information about the lldb-commits mailing list