[Lldb-commits] [lldb] 69a0af3 - [lldb-dap] Don't make stopOnAttach the default in attach tests
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue May 6 18:19:46 PDT 2025
Author: Jonas Devlieghere
Date: 2025-05-06T18:19:37-07:00
New Revision: 69a0af35a5860156836e9e295ecef9de3474db11
URL: https://github.com/llvm/llvm-project/commit/69a0af35a5860156836e9e295ecef9de3474db11
DIFF: https://github.com/llvm/llvm-project/commit/69a0af35a5860156836e9e295ecef9de3474db11.diff
LOG: [lldb-dap] Don't make stopOnAttach the default in attach tests
Make stopOnAttach=False the default again and explicitly pass
stopOnAttach=True where the tests relies on that. I changed the default
in the launch sequence PR (#138219) because that was implicitly the
assumption (the tests never send the configurationDone request).
Added:
Modified:
lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
Removed:
################################################################################
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index e10342b72f4f0..e0ce92256fac0 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -592,7 +592,7 @@ def request_attach(
attachCommands=None,
terminateCommands=None,
coreFile=None,
- stopOnAttach=True,
+ stopOnAttach=False,
postRunCommands=None,
sourceMap=None,
gdbRemotePort=None,
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
index 958c7268c0c72..e4be91744fddc 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
@@ -340,7 +340,7 @@ def attach(
exitCommands=None,
attachCommands=None,
coreFile=None,
- stopOnAttach=True,
+ stopOnAttach=False,
disconnectAutomatically=True,
terminateCommands=None,
postRunCommands=None,
diff --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
index 741c011a3d692..e0ec87bd9a8d8 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
@@ -53,7 +53,7 @@ def test_by_pid(self):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
- self.attach(pid=self.process.pid)
+ self.attach(pid=self.process.pid, stopOnAttach=True)
self.set_and_hit_breakpoint(continueToExit=True)
@skipIfNetBSD # Hangs on NetBSD as well
@@ -71,7 +71,7 @@ def test_by_name(self):
popen = self.spawnSubprocess(program, [pid_file_path])
lldbutil.wait_for_file_on_target(self, pid_file_path)
- self.attach(program=program)
+ self.attach(program=program, stopOnAttach=True)
self.set_and_hit_breakpoint(continueToExit=True)
@skipUnlessDarwin
@@ -91,7 +91,7 @@ def test_by_name_waitFor(self):
),
)
self.spawn_thread.start()
- self.attach(program=program, waitFor=True)
+ self.attach(program=program, stopOnAttach=True, waitFor=True)
self.set_and_hit_breakpoint(continueToExit=True)
@skipIfNetBSD # Hangs on NetBSD as well
@@ -133,6 +133,7 @@ def test_commands(self):
terminateCommands = ["expr 4+2"]
self.attach(
program=program,
+ stopOnAttach=True,
attachCommands=attachCommands,
initCommands=initCommands,
preRunCommands=preRunCommands,
@@ -201,6 +202,7 @@ def test_terminate_commands(self):
terminateCommands = ["expr 4+2"]
self.attach(
program=program,
+ stopOnAttach=True,
attachCommands=attachCommands,
terminateCommands=terminateCommands,
disconnectAutomatically=False,
diff --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
index 7250e67ebcd8c..12fba1133b95b 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
@@ -79,7 +79,9 @@ def test_by_port(self):
port, " Failed to read the port number from debug server pipe"
)
- self.attach(program=program, gdbRemotePort=port, sourceInitFile=True)
+ self.attach(
+ program=program, stopOnAttach=True, gdbRemotePort=port, sourceInitFile=True
+ )
self.set_and_hit_breakpoint(continueToExit=True)
self.process.terminate()
@@ -101,6 +103,7 @@ def test_by_port_and_pid(self):
response = self.attach(
program=program,
pid=pid,
+ stopOnAttach=True,
gdbRemotePort=port,
sourceInitFile=True,
expectFailure=True,
@@ -120,7 +123,11 @@ def test_by_invalid_port(self):
port = 0
response = self.attach(
- program=program, gdbRemotePort=port, sourceInitFile=True, expectFailure=True
+ program=program,
+ stopOnAttach=True,
+ gdbRemotePort=port,
+ sourceInitFile=True,
+ expectFailure=True,
)
if not (response and response["success"]):
self.assertFalse(
@@ -144,7 +151,11 @@ def test_by_illegal_port(self):
)
response = self.attach(
- program=program, gdbRemotePort=port, sourceInitFile=True, expectFailure=True
+ program=program,
+ stopOnAttach=True,
+ gdbRemotePort=port,
+ sourceInitFile=True,
+ expectFailure=True,
)
if not (response and response["success"]):
self.assertFalse(
More information about the lldb-commits
mailing list