Skip to content

Commit 80b6b70

Browse files
committed
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. llvm-svn: 363772
1 parent 39263ac commit 80b6b70

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def setup_test(self):
2020
self.prep_debug_monitor_and_inferior(inferior_env=env)
2121
self.continue_process_and_wait_for_stop()
2222

23+
def get_expected_libs(self):
24+
return ["libsvr4lib_a.so", 'libsvr4lib_b".so']
25+
2326
def has_libraries_svr4_support(self):
2427
self.add_qSupported_packets()
2528
context = self.expect_gdbremote_sequence()
@@ -80,7 +83,8 @@ def libraries_svr4_has_correct_load_addr(self):
8083
xml_root = self.get_libraries_svr4_xml()
8184
for child in xml_root:
8285
name = child.attrib.get("name")
83-
if not name:
86+
base_name = os.path.basename(name)
87+
if os.path.basename(name) not in self.get_expected_libs():
8488
continue
8589
load_addr = int(child.attrib.get("l_addr"), 16)
8690
self.reset_test_sequence()
@@ -98,8 +102,7 @@ def libraries_svr4_libs_present(self):
98102
for child in xml_root:
99103
name = child.attrib.get("name")
100104
libraries_svr4_names.append(os.path.realpath(name))
101-
expected_libs = ["libsvr4lib_a.so", 'libsvr4lib_b".so']
102-
for lib in expected_libs:
105+
for lib in self.get_expected_libs():
103106
self.assertIn(self.getBuildDir() + "/" + lib, libraries_svr4_names)
104107

105108
@llgs_test

0 commit comments

Comments
 (0)