[Lldb-commits] [lldb] r363772 - Stabilize TestGdbRemoteLibrariesSvr4Support

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 19 01:41:14 PDT 2019


Author: labath
Date: Wed Jun 19 01:41:13 2019
New Revision: 363772

URL: http://llvm.org/viewvc/llvm-project?rev=363772&view=rev
Log:
Stabilize TestGdbRemoteLibrariesSvr4Support

on some systems this test fails because the two methods it uses to
cross-reference the data don't match in the case of the vdso module. The
"read from /proc/%pid/maps" method returns "[vdso]", while the method
which reads it from the linker rendezvous structures returns
"linux-vdso.so.1". Neither of the two names match any actual file.

This restricts the test to only consider the libraries that we ourselves
have added to the test, minimizing the impact of system dependencies
that we cannot control.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py?rev=363772&r1=363771&r2=363772&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py Wed Jun 19 01:41:13 2019
@@ -20,6 +20,9 @@ class TestGdbRemoteLibrariesSvr4Support(
         self.prep_debug_monitor_and_inferior(inferior_env=env)
         self.continue_process_and_wait_for_stop()
 
+    def get_expected_libs(self):
+        return ["libsvr4lib_a.so", 'libsvr4lib_b".so']
+
     def has_libraries_svr4_support(self):
         self.add_qSupported_packets()
         context = self.expect_gdbremote_sequence()
@@ -80,7 +83,8 @@ class TestGdbRemoteLibrariesSvr4Support(
         xml_root = self.get_libraries_svr4_xml()
         for child in xml_root:
             name = child.attrib.get("name")
-            if not name:
+            base_name = os.path.basename(name)
+            if os.path.basename(name) not in self.get_expected_libs():
                 continue
             load_addr = int(child.attrib.get("l_addr"), 16)
             self.reset_test_sequence()
@@ -98,8 +102,7 @@ class TestGdbRemoteLibrariesSvr4Support(
         for child in xml_root:
             name = child.attrib.get("name")
             libraries_svr4_names.append(os.path.realpath(name))
-        expected_libs = ["libsvr4lib_a.so", 'libsvr4lib_b".so']
-        for lib in expected_libs:
+        for lib in self.get_expected_libs():
             self.assertIn(self.getBuildDir() + "/" + lib, libraries_svr4_names)
 
     @llgs_test




More information about the lldb-commits mailing list