Skip to content

Commit 45f9795

Browse files
committed
[lldb] [test] Terminate "process connect" connections via kill
Fix the termination of "process connect" (and "gdb-remote") to kill the process rather than attempting to disconnect the platform. The latter only results in an error since we did not use "platform connect", and apparently process-level connections (at least via gdb-remote) do not really support disconnecting. Differential Revision: https://reviews.llvm.org/D110996
1 parent 14bcd8b commit 45f9795

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_gdb_remote_sync(self):
1818
self.expect("gdb-remote " + self.server.get_connect_address(),
1919
substrs=['Process', 'stopped'])
2020
finally:
21-
self.dbg.GetSelectedPlatform().DisconnectRemote()
21+
self.dbg.GetSelectedTarget().GetProcess().Kill()
2222

2323
def test_gdb_remote_async(self):
2424
"""Test the gdb-remote command in asynchronous mode"""
@@ -30,7 +30,9 @@ def test_gdb_remote_async(self):
3030
lldbutil.expect_state_changes(self, self.dbg.GetListener(),
3131
self.process(), [lldb.eStateStopped])
3232
finally:
33-
self.dbg.GetSelectedPlatform().DisconnectRemote()
33+
self.dbg.GetSelectedTarget().GetProcess().Kill()
34+
lldbutil.expect_state_changes(self, self.dbg.GetListener(),
35+
self.process(), [lldb.eStateExited])
3436

3537
@skipIfWindows
3638
def test_process_connect_sync(self):
@@ -42,7 +44,7 @@ def test_process_connect_sync(self):
4244
self.expect("process connect " + self.server.get_connect_url(),
4345
substrs=['Process', 'stopped'])
4446
finally:
45-
self.dbg.GetSelectedPlatform().DisconnectRemote()
47+
self.dbg.GetSelectedTarget().GetProcess().Kill()
4648

4749
@skipIfWindows
4850
def test_process_connect_async(self):
@@ -57,4 +59,6 @@ def test_process_connect_async(self):
5759
lldbutil.expect_state_changes(self, self.dbg.GetListener(),
5860
self.process(), [lldb.eStateStopped])
5961
finally:
60-
self.dbg.GetSelectedPlatform().DisconnectRemote()
62+
self.dbg.GetSelectedTarget().GetProcess().Kill()
63+
lldbutil.expect_state_changes(self, self.dbg.GetListener(),
64+
self.process(), [lldb.eStateExited])

lldb/test/API/functionalities/gdb_remote_client/TestPty.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_process_connect_sync(self):
1818
self.expect("process connect " + self.server.get_connect_url(),
1919
substrs=['Process', 'stopped'])
2020
finally:
21-
self.dbg.GetSelectedPlatform().DisconnectRemote()
21+
self.dbg.GetSelectedTarget().GetProcess().Kill()
2222

2323
def test_process_connect_async(self):
2424
"""Test the process connect command in asynchronous mode"""
@@ -32,4 +32,6 @@ def test_process_connect_async(self):
3232
lldbutil.expect_state_changes(self, self.dbg.GetListener(),
3333
self.process(), [lldb.eStateStopped])
3434
finally:
35-
self.dbg.GetSelectedPlatform().DisconnectRemote()
35+
self.dbg.GetSelectedTarget().GetProcess().Kill()
36+
lldbutil.expect_state_changes(self, self.dbg.GetListener(),
37+
self.process(), [lldb.eStateExited])

0 commit comments

Comments
 (0)