Skip to content

Commit 69a0af3

Browse files
committed
[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).
1 parent 7fa721a commit 69a0af3

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def request_attach(
592592
attachCommands=None,
593593
terminateCommands=None,
594594
coreFile=None,
595-
stopOnAttach=True,
595+
stopOnAttach=False,
596596
postRunCommands=None,
597597
sourceMap=None,
598598
gdbRemotePort=None,

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def attach(
340340
exitCommands=None,
341341
attachCommands=None,
342342
coreFile=None,
343-
stopOnAttach=True,
343+
stopOnAttach=False,
344344
disconnectAutomatically=True,
345345
terminateCommands=None,
346346
postRunCommands=None,

lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_by_pid(self):
5353
stdout=subprocess.PIPE,
5454
stderr=subprocess.PIPE,
5555
)
56-
self.attach(pid=self.process.pid)
56+
self.attach(pid=self.process.pid, stopOnAttach=True)
5757
self.set_and_hit_breakpoint(continueToExit=True)
5858

5959
@skipIfNetBSD # Hangs on NetBSD as well
@@ -71,7 +71,7 @@ def test_by_name(self):
7171
popen = self.spawnSubprocess(program, [pid_file_path])
7272
lldbutil.wait_for_file_on_target(self, pid_file_path)
7373

74-
self.attach(program=program)
74+
self.attach(program=program, stopOnAttach=True)
7575
self.set_and_hit_breakpoint(continueToExit=True)
7676

7777
@skipUnlessDarwin
@@ -91,7 +91,7 @@ def test_by_name_waitFor(self):
9191
),
9292
)
9393
self.spawn_thread.start()
94-
self.attach(program=program, waitFor=True)
94+
self.attach(program=program, stopOnAttach=True, waitFor=True)
9595
self.set_and_hit_breakpoint(continueToExit=True)
9696

9797
@skipIfNetBSD # Hangs on NetBSD as well
@@ -133,6 +133,7 @@ def test_commands(self):
133133
terminateCommands = ["expr 4+2"]
134134
self.attach(
135135
program=program,
136+
stopOnAttach=True,
136137
attachCommands=attachCommands,
137138
initCommands=initCommands,
138139
preRunCommands=preRunCommands,
@@ -201,6 +202,7 @@ def test_terminate_commands(self):
201202
terminateCommands = ["expr 4+2"]
202203
self.attach(
203204
program=program,
205+
stopOnAttach=True,
204206
attachCommands=attachCommands,
205207
terminateCommands=terminateCommands,
206208
disconnectAutomatically=False,

lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ def test_by_port(self):
7979
port, " Failed to read the port number from debug server pipe"
8080
)
8181

82-
self.attach(program=program, gdbRemotePort=port, sourceInitFile=True)
82+
self.attach(
83+
program=program, stopOnAttach=True, gdbRemotePort=port, sourceInitFile=True
84+
)
8385
self.set_and_hit_breakpoint(continueToExit=True)
8486
self.process.terminate()
8587

@@ -101,6 +103,7 @@ def test_by_port_and_pid(self):
101103
response = self.attach(
102104
program=program,
103105
pid=pid,
106+
stopOnAttach=True,
104107
gdbRemotePort=port,
105108
sourceInitFile=True,
106109
expectFailure=True,
@@ -120,7 +123,11 @@ def test_by_invalid_port(self):
120123

121124
port = 0
122125
response = self.attach(
123-
program=program, gdbRemotePort=port, sourceInitFile=True, expectFailure=True
126+
program=program,
127+
stopOnAttach=True,
128+
gdbRemotePort=port,
129+
sourceInitFile=True,
130+
expectFailure=True,
124131
)
125132
if not (response and response["success"]):
126133
self.assertFalse(
@@ -144,7 +151,11 @@ def test_by_illegal_port(self):
144151
)
145152

146153
response = self.attach(
147-
program=program, gdbRemotePort=port, sourceInitFile=True, expectFailure=True
154+
program=program,
155+
stopOnAttach=True,
156+
gdbRemotePort=port,
157+
sourceInitFile=True,
158+
expectFailure=True,
148159
)
149160
if not (response and response["success"]):
150161
self.assertFalse(

0 commit comments

Comments
 (0)