[Lldb-commits] [PATCH] D21648: Make sure to reset to correct platform after TestImageListMultiArchitecture

Francis Ricci via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 23 13:38:38 PDT 2016


fjricci updated this revision to Diff 61717.
fjricci added a comment.
This revision is now accepted and ready to land.

Disconnect from existing platform connection to prevent extra hanging connections

This is good practice on all debug servers, and required for debug servers which
can't handle more than one simultaneous platform mode connection.


http://reviews.llvm.org/D21648

Files:
  packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py

Index: packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
+++ packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
@@ -23,6 +23,10 @@
     @no_debug_info_test
     def test_image_list_shows_multiple_architectures(self):
         """Test that image list properly shows the correct architecture for a set of different architecture object files."""
+        # Don't leave residual open platform connections
+        if lldb.remote_platform:
+            lldb.remote_platform.DisconnectRemote()
+
         images = {
             "hello-freebsd-10.0-x86_64-clang-3.3": re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"),
             "hello-freebsd-10.0-x86_64-gcc-4.7.3": re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"),
@@ -39,5 +43,11 @@
 
             self.runCmd("file {}".format(file_name))
             self.match("image list -t -A", [expected_triple_and_arch_regex])
-        # Revert to the host platform after all of this is done
-        self.runCmd("platform select host")
+
+        # Revert to the original platform after all of this is done
+        if lldb.remote_platform:
+            platform_connect_options = lldb.SBPlatformConnectOptions(configuration.lldb_platform_url)
+            err = lldb.remote_platform.ConnectRemote(platform_connect_options)
+            self.assertTrue(err.Success())
+        else:
+            self.runCmd("platform select host")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21648.61717.patch
Type: text/x-patch
Size: 1641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160623/e4444dd6/attachment.bin>


More information about the lldb-commits mailing list