[Lldb-commits] [lldb] 45f9795 - [lldb] [test] Terminate "process connect" connections via kill

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 4 03:29:16 PDT 2021


Author: Michał Górny
Date: 2021-10-04T12:29:06+02:00
New Revision: 45f9795085ee0fe6fd23129d80aad5a2ea5026a0

URL: https://github.com/llvm/llvm-project/commit/45f9795085ee0fe6fd23129d80aad5a2ea5026a0
DIFF: https://github.com/llvm/llvm-project/commit/45f9795085ee0fe6fd23129d80aad5a2ea5026a0.diff

LOG: [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

Added: 
    

Modified: 
    lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
    lldb/test/API/functionalities/gdb_remote_client/TestPty.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
index 6f99c939562b6..a62d8aece790b 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
@@ -18,7 +18,7 @@ def test_gdb_remote_sync(self):
             self.expect("gdb-remote " + self.server.get_connect_address(),
                         substrs=['Process', 'stopped'])
         finally:
-            self.dbg.GetSelectedPlatform().DisconnectRemote()
+            self.dbg.GetSelectedTarget().GetProcess().Kill()
 
     def test_gdb_remote_async(self):
         """Test the gdb-remote command in asynchronous mode"""
@@ -30,7 +30,9 @@ def test_gdb_remote_async(self):
             lldbutil.expect_state_changes(self, self.dbg.GetListener(),
                                           self.process(), [lldb.eStateStopped])
         finally:
-            self.dbg.GetSelectedPlatform().DisconnectRemote()
+            self.dbg.GetSelectedTarget().GetProcess().Kill()
+        lldbutil.expect_state_changes(self, self.dbg.GetListener(),
+                                      self.process(), [lldb.eStateExited])
 
     @skipIfWindows
     def test_process_connect_sync(self):
@@ -42,7 +44,7 @@ def test_process_connect_sync(self):
             self.expect("process connect " + self.server.get_connect_url(),
                         substrs=['Process', 'stopped'])
         finally:
-            self.dbg.GetSelectedPlatform().DisconnectRemote()
+            self.dbg.GetSelectedTarget().GetProcess().Kill()
 
     @skipIfWindows
     def test_process_connect_async(self):
@@ -57,4 +59,6 @@ def test_process_connect_async(self):
             lldbutil.expect_state_changes(self, self.dbg.GetListener(),
                                           self.process(), [lldb.eStateStopped])
         finally:
-            self.dbg.GetSelectedPlatform().DisconnectRemote()
+            self.dbg.GetSelectedTarget().GetProcess().Kill()
+        lldbutil.expect_state_changes(self, self.dbg.GetListener(),
+                                      self.process(), [lldb.eStateExited])

diff  --git a/lldb/test/API/functionalities/gdb_remote_client/TestPty.py b/lldb/test/API/functionalities/gdb_remote_client/TestPty.py
index 46078b7a0adb3..55935d901c665 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestPty.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestPty.py
@@ -18,7 +18,7 @@ def test_process_connect_sync(self):
             self.expect("process connect " + self.server.get_connect_url(),
                         substrs=['Process', 'stopped'])
         finally:
-            self.dbg.GetSelectedPlatform().DisconnectRemote()
+            self.dbg.GetSelectedTarget().GetProcess().Kill()
 
     def test_process_connect_async(self):
         """Test the process connect command in asynchronous mode"""
@@ -32,4 +32,6 @@ def test_process_connect_async(self):
             lldbutil.expect_state_changes(self, self.dbg.GetListener(),
                                           self.process(), [lldb.eStateStopped])
         finally:
-            self.dbg.GetSelectedPlatform().DisconnectRemote()
+            self.dbg.GetSelectedTarget().GetProcess().Kill()
+        lldbutil.expect_state_changes(self, self.dbg.GetListener(),
+                                      self.process(), [lldb.eStateExited])


        


More information about the lldb-commits mailing list