summaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/macosx/find-dsym
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/macosx/find-dsym')
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py4
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile12
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py5
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c9
5 files changed, 23 insertions, 13 deletions
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile b/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile
index 7b321e3deae0a..313c83e990d56 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile
@@ -1,3 +1,5 @@
+SRCDIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/
+
CC ?= clang
ifeq "$(ARCH)" ""
@@ -7,7 +9,7 @@ endif
CFLAGS ?= -g -O0 -arch $(ARCH)
all: clean
- $(CC) $(CFLAGS) -dynamiclib -o com.apple.sbd bundle.c
+ $(CC) $(CFLAGS) -dynamiclib -o com.apple.sbd $(SRCDIR)/bundle.c
mkdir com.apple.sbd.xpc
mv com.apple.sbd com.apple.sbd.xpc/
mkdir -p com.apple.sbd.xpc.dSYM/Contents/Resources/DWARF
@@ -15,7 +17,7 @@ all: clean
rm -rf com.apple.sbd.dSYM
mkdir hide.app
tar cf - com.apple.sbd.xpc com.apple.sbd.xpc.dSYM | ( cd hide.app;tar xBpf -)
- $(CC) $(CFLAGS) -o find-bundle-with-dots-in-fn main.c
+ $(CC) $(CFLAGS) -o find-bundle-with-dots-in-fn $(SRCDIR)/main.c
clean:
rm -rf a.out a.out.dSYM hide.app com.apple.sbd com.apple.sbd.dSYM com.apple.sbd.xpc com.apple.sbd.xpc.dSYM find-bundle-with-dots-in-fn find-bundle-with-dots-in-fn.dSYM
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py b/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py
index 104e88752ec22..9a046cf0b294d 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py
@@ -37,8 +37,9 @@ class BundleWithDotInFilenameTestCase(TestBase):
def test_attach_and_check_dsyms(self):
"""Test attach to binary, see if the bundle dSYM is found"""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
self.build()
+ os.chdir(self.getBuildDir());
popen = self.spawnSubprocess(exe)
self.addTearDownHook(self.cleanupSubprocesses)
@@ -66,6 +67,7 @@ class BundleWithDotInFilenameTestCase(TestBase):
dsym_name = mod.GetSymbolFileSpec().GetFilename()
self.assertTrue (dsym_name == 'com.apple.sbd', "Check that we found the dSYM for the bundle that was loaded")
i=i+1
+ os.chdir(self.getSourceDir());
if __name__ == '__main__':
unittest.main()
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile
index 33b09502378c3..d52d6f1f0d37d 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile
@@ -1,3 +1,5 @@
+SRCDIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/
+
CC ?= clang
ifeq "$(ARCH)" ""
@@ -7,12 +9,12 @@ endif
CFLAGS ?= -g -O0 -arch $(ARCH)
all: clean
- $(CC) $(CFLAGS) -install_name $(PWD)/MyFramework.framework/Versions/A/MyFramework -dynamiclib -o MyFramework myframework.c
+ $(CC) $(CFLAGS) -install_name $(shell pwd)/MyFramework.framework/Versions/A/MyFramework -dynamiclib -o MyFramework $(SRCDIR)/myframework.c
mkdir -p MyFramework.framework/Versions/A/Headers
mkdir -p MyFramework.framework/Versions/A/Resources
cp MyFramework MyFramework.framework/Versions/A
- cp MyFramework.h MyFramework.framework/Versions/A/Headers
- cp Info.plist MyFramework.framework/Versions/A/Resources
+ cp $(SRCDIR)/MyFramework.h MyFramework.framework/Versions/A/Headers
+ cp $(SRCDIR)/Info.plist MyFramework.framework/Versions/A/Resources
( cd MyFramework.framework/Versions ; ln -s A Current )
( cd MyFramework.framework/ ; ln -s Versions/Current/Headers . )
( cd MyFramework.framework/ ; ln -s Versions/Current/MyFramework . )
@@ -21,8 +23,8 @@ all: clean
mkdir hide.app
rm -f MyFramework
tar cf - MyFramework.framework MyFramework.framework.dSYM | ( cd hide.app;tar xBpf -)
- $(CC) $(CFLAGS) -o deep-bundle main.c -F. -framework MyFramework
-
+ $(CC) $(CFLAGS) -o deep-bundle $(SRCDIR)/main.c -F. -framework MyFramework
+
clean:
rm -rf a.out a.out.dSYM deep-bundle deep-bundle.dSYM MyFramework.framework MyFramework.framework.dSYM MyFramework MyFramework.dSYM hide.app
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py
index 493c4b99d094b..d6123e39c3fef 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py
@@ -37,9 +37,9 @@ class DeepBundleTestCase(TestBase):
def test_attach_and_check_dsyms(self):
"""Test attach to binary, see if the framework dSYM is found"""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
self.build()
- popen = self.spawnSubprocess(exe)
+ popen = self.spawnSubprocess(exe, [self.getBuildDir()])
self.addTearDownHook(self.cleanupSubprocesses)
# Give the inferior time to start up, dlopen a bundle, remove the bundle it linked in
@@ -49,7 +49,6 @@ class DeepBundleTestCase(TestBase):
# binary & dSYM via target.exec-search-paths
settings_str = "settings set target.exec-search-paths " + self.get_process_working_directory() + "/hide.app"
self.runCmd(settings_str)
-
self.runCmd("process attach -p " + str(popen.pid))
target = self.dbg.GetSelectedTarget()
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c
index 19715216d6cfc..b5ef5cff74a39 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c
@@ -1,12 +1,17 @@
#include <MyFramework/MyFramework.h>
#include <unistd.h>
+#include <stdio.h>
#include <stdlib.h>
int setup_is_complete = 0;
-int main()
+int main(int argc, const char **argv)
{
- system ("/bin/rm -rf MyFramework MyFramework.framework MyFramework.framework.dSYM");
+ char command[8192];
+ sprintf (command,
+ "/bin/rm -rf %s/MyFramework %s/MyFramework.framework %s/MyFramework.framework.dSYM",
+ argv[1], argv[1], argv[1]);
+ system (command);
setup_is_complete = 1;