41 lines · python
1"""2Test that LLDB can launch a linux executable through the dynamic loader where3the main executable has an extra exported "_r_debug" symbol that used to mess4up shared library loading with DYLDRendezvous and the POSIX dynamic loader5plug-in. What used to happen is that any shared libraries other than the main6executable and the dynamic loader and VSDO would not get loaded. This test7checks to make sure that we still load libraries correctly when we have8multiple "_r_debug" symbols. See comments in the main.cpp source file for full9details on what the problem is.10"""11 12import lldb13import os14 15from lldbsuite.test import lldbutil16from lldbsuite.test.decorators import *17from lldbsuite.test.lldbtest import *18 19 20class TestDyldWithMultipleRDebug(TestBase):21 @skipIf(oslist=no_match(["linux"]))22 @no_debug_info_test23 def test(self):24 self.build()25 # Run to a breakpoint in main.cpp to ensure we can hit breakpoints26 # in the main executable. Setting breakpoints by file and line ensures27 # that the main executable was loaded correctly by the dynamic loader28 (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(29 self, "// Break here", lldb.SBFileSpec("main.cpp"), extra_images=["testlib"]30 )31 # Set breakpoints both on shared library function to ensure that32 # we hit a source breakpoint in the shared library which only will33 # happen if we load the shared library correctly in the dynamic34 # loader.35 lldbutil.continue_to_source_breakpoint(36 self,37 process,38 "// Library break here",39 lldb.SBFileSpec("library_file.cpp", False),40 )41