Index: test/lang/c/shared_lib/TestSharedLib.py =================================================================== --- test/lang/c/shared_lib/TestSharedLib.py +++ test/lang/c/shared_lib/TestSharedLib.py @@ -40,12 +40,6 @@ # Find the line number to break inside main(). self.source = 'main.c' self.line = line_number(self.source, '// Set breakpoint 0 here.') - if sys.platform.startswith("freebsd") or sys.platform.startswith("linux"): - if "LD_LIBRARY_PATH" in os.environ: - self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.environ["LD_LIBRARY_PATH"] + ":" + os.getcwd()) - else: - self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd()) - self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath)) self.shlib_names = ["foo"] def common_setup(self): @@ -59,8 +53,14 @@ # Break inside the foo function which takes a bar_ptr argument. lldbutil.run_break_set_by_file_and_line (self, self.source, self.line, num_expected_locations=1, loc_exact=True) - # Register our shared libraries for remote targets so they get automatically uploaded - environment = self.registerSharedLibrariesWithTarget(target, self.shlib_names) + if sys.platform.startswith("freebsd") or sys.platform.startswith("linux"): + if self.dylibPath in os.environ: + environment = [self.dylibPath + "=" + os.environ[self.dylibPath] + ":" + os.getcwd()] + else: + environment = [self.dylibPath + "=" + os.getcwd()] + else: + # Register our shared libraries for remote targets so they get automatically uploaded + environment = self.registerSharedLibrariesWithTarget(target, self.shlib_names) # Now launch the process, and do not stop at entry point. process = target.LaunchSimple (None, environment, self.get_process_working_directory()) Index: test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py =================================================================== --- test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py +++ test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py @@ -40,12 +40,6 @@ # Find the line number to break inside main(). self.source = 'main.c' self.line = line_number(self.source, '// Set breakpoint 0 here.') - if sys.platform.startswith("freebsd") or sys.platform.startswith("linux"): - if "LD_LIBRARY_PATH" in os.environ: - self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.environ["LD_LIBRARY_PATH"] + ":" + os.getcwd()) - else: - self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd()) - self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath)) self.shlib_names = ["foo"] def common_setup(self): @@ -59,8 +53,14 @@ # Break inside the foo function which takes a bar_ptr argument. lldbutil.run_break_set_by_file_and_line (self, self.source, self.line, num_expected_locations=1, loc_exact=True) - # Register our shared libraries for remote targets so they get automatically uploaded - environment = self.registerSharedLibrariesWithTarget(target, self.shlib_names) + if sys.platform.startswith("freebsd") or sys.platform.startswith("linux"): + if self.dylibPath in os.environ: + environment = [self.dylibPath + "=" + os.environ[self.dylibPath] + ":" + os.getcwd()] + else: + environment = [self.dylibPath + "=" + os.getcwd()] + else: + # Register our shared libraries for remote targets so they get automatically uploaded + environment = self.registerSharedLibrariesWithTarget(target, self.shlib_names) # Now launch the process, and do not stop at entry point. process = target.LaunchSimple (None, environment, self.get_process_working_directory()) Index: test/lldbtest.py =================================================================== --- test/lldbtest.py +++ test/lldbtest.py @@ -1196,6 +1196,10 @@ module = builder_module() return module.getCompiler() + def getCompilerBinary(self): + """Returns the compiler binary the test suite is running with.""" + return self.getCompiler().split()[0] + def getCompilerVersion(self): """ Returns a string that represents the compiler version. Supports: llvm, clang. @@ -1203,7 +1207,7 @@ from lldbutil import which version = 'unknown' - compiler = self.getCompiler() + compiler = self.getCompilerBinary() version_output = system([[which(compiler), "-v"]])[1] for line in version_output.split(os.linesep): m = re.search('version ([0-9\.]+)', line)