Index: packages/Python/lldbsuite/test/functionalities/load_unload/Makefile =================================================================== --- packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -19,7 +19,6 @@ hidden_lib_d: - mkdir -p hidden $(MAKE) VPATH=$(SRCDIR)/hidden -I $(SRCDIR)/hidden -C hidden -f $(SRCDIR)/hidden/Makefile clean:: @@ -27,5 +26,4 @@ $(MAKE) -f $(SRCDIR)/b.mk clean $(MAKE) -f $(SRCDIR)/c.mk clean $(MAKE) -f $(SRCDIR)/d.mk clean - mkdir -p hidden $(MAKE) -I $(SRCDIR)/hidden -C hidden -f $(SRCDIR)/hidden/Makefile clean Index: packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py =================================================================== --- packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py +++ packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py @@ -22,6 +22,7 @@ def setUp(self): # Call super's setUp(). TestBase.setUp(self) + lldbutil.mkdir_p(self.getBuildArtifact("hidden")) # Find the line number to break for main.cpp. self.line = line_number( 'main.cpp', @@ -239,15 +240,14 @@ self.runCmd("run", RUN_SUCCEEDED) + ctx = self.platformContext + dylibName = ctx.shlib_prefix + 'loadunload_a.' + ctx.shlib_extension + localDylibPath = self.getBuildArtifact(dylibName) if lldb.remote_platform: - shlib_dir = lldb.remote_platform.GetWorkingDirectory() - else: - shlib_dir = self.mydir - - if self.platformIsDarwin(): - dylibName = self.getBuildArtifact('libloadunload_a.dylib') + wd = lldb.remote_platform.GetWorkingDirectory() + remoteDylibPath = lldbutil.join_remote_paths(wd, dylibName) else: - dylibName = self.getBuildArtifact('libloadunload_a.so') + remoteDylibPath = localDylibPath # Make sure that a_function does not exist at this point. self.expect( @@ -259,13 +259,10 @@ # Use lldb 'process load' to load the dylib. self.expect( - "process load %s --install=%s" % - (dylibName, dylibName), - "%s loaded correctly" % - dylibName, + "process load %s --install=%s" % (localDylibPath, remoteDylibPath), + "%s loaded correctly" % dylibName, patterns=[ - 'Loading "%s".*ok' % - dylibName, + 'Loading "%s".*ok' % localDylibPath, 'Image [0-9]+ loaded']) # Search for and match the "Image ([0-9]+) loaded" pattern. Index: packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile =================================================================== --- packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile +++ packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile @@ -9,7 +9,6 @@ a.out: lib_One lib_Two lib_%: - mkdir -p $* $(MAKE) VPATH=$(SRCDIR)/$* -I $(SRCDIR) -f $(SRCDIR)/$*.mk clean:: Index: packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py =================================================================== --- packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py +++ packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py @@ -16,6 +16,11 @@ mydir = TestBase.compute_mydir(__file__) NO_DEBUG_INFO_TESTCASE = True + def setUp(self): + TestBase.setUp(self) + lldbutil.mkdir_p(self.getBuildArtifact("One")) + lldbutil.mkdir_p(self.getBuildArtifact("Two")) + def test_conflicting_symbols(self): self.build() exe = self.getBuildArtifact("a.out") Index: packages/Python/lldbsuite/test/lldbutil.py =================================================================== --- packages/Python/lldbsuite/test/lldbutil.py +++ packages/Python/lldbsuite/test/lldbutil.py @@ -9,6 +9,7 @@ # System modules import collections +import errno import os import re import sys @@ -44,6 +45,14 @@ return exe_file return None +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as e: + if e.errno != errno.EEXIST: + raise + if not os.path.isdir(path): + raise OSError(errno.ENOTDIR, "%s is not a directory"%path) # =================================================== # Disassembly for an SBFunction or an SBSymbol object # =================================================== Index: packages/Python/lldbsuite/test/make/Makefile.rules =================================================================== --- packages/Python/lldbsuite/test/make/Makefile.rules +++ packages/Python/lldbsuite/test/make/Makefile.rules @@ -28,8 +28,8 @@ # Uncomment line below for debugging shell commands # SHELL = /bin/sh -x -SRCDIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))/ -THIS_FILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/ +SRCDIR := $(shell dirname $(firstword $(MAKEFILE_LIST)))/ +THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/ LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../ Index: packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py =================================================================== --- packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py +++ packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py @@ -82,17 +82,22 @@ exe = self.getBuildArtifact("a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) - outfile = self.getBuildArtifact("output.txt") - self.runCmd("process launch -- %s %s" %(outfile, args_in)) + local_outfile = self.getBuildArtifact("output.txt") + if lldb.remote_platform: + remote_outfile = "output.txt" # Relative to platform's PWD + else: + remote_outfile = local_outfile + + self.runCmd("process launch -- %s %s" %(remote_outfile, args_in)) if lldb.remote_platform: - src_file_spec = lldb.SBFileSpec(outfile, False) - dst_file_spec = lldb.SBFileSpec(outfile, True) + src_file_spec = lldb.SBFileSpec(remote_outfile, False) + dst_file_spec = lldb.SBFileSpec(local_outfile, True) lldb.remote_platform.Get(src_file_spec, dst_file_spec) - with open(outfile, 'r') as f: + with open(local_outfile, 'r') as f: output = f.read() - self.RemoveTempFile(outfile) + self.RemoveTempFile(local_outfile) self.assertEqual(output, args_out)