aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2019-10-09 22:47:28 +0000
committerFrederic Riss <friss@apple.com>2019-10-09 22:47:28 +0000
commit98f2620cc61f2142bc5f71d18116a6ce1f80eb68 (patch)
tree979df2e9e6349d9c0636fd50530e691aa9db09a3
parentb528b0045ad06a142de93e4ffc9e3c27735e2122 (diff)
downloadlldb-98f2620cc61f2142bc5f71d18116a6ce1f80eb68.tar.gz
TestIndirectSymbols: Modernize the Makefile
This old test used a completely hand-rolled Makefile. Modernize so that it's able to cross-compile. And XFAIL the test as it fails on embedded targets... git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@374256 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile46
-rw-r--r--packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py4
2 files changed, 14 insertions, 36 deletions
diff --git a/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile b/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile
index 5bea8dc4a..929ed58f7 100644
--- a/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile
@@ -1,38 +1,16 @@
-include Makefile.rules
-
-LIB_PREFIX := lib
-
-ifeq "$(OS)" "Darwin"
- CFLAGS += -arch $(ARCH)
- DS := dsymutil
- LD_FLAGS := -dynamiclib
- LIB_INDIRECT := $(LIB_PREFIX)indirect.dylib
- LIB_REEXPORT := $(LIB_PREFIX)reexport.dylib
- EXEC_PATH := "@executable_path"
- EXEC_PATH_INDIRECT := -install_name $(EXEC_PATH)/$(LIB_INDIRECT)
- EXEC_PATH_REEXPORT := -install_name $(EXEC_PATH)/$(LIB_REEXPORT)
-endif
-
-all: a.out $(LIB_INDIRECT) $(LIB_REEXPORT)
+C_SOURCES := main.c
+LD_EXTRAS := -L. -lindirect -lreexport
-a.out: main.o $(LIB_INDIRECT) $(LIB_REEXPORT)
- $(CC) $(CFLAGS) -o a.out main.o -L. $(LIB_INDIRECT) $(LIB_REEXPORT)
+.PHONY: build-libindirect build-libreepxoprt
+all: build-libindirect build-libreepxoprt a.out
-main.o: $(SRCDIR)/main.c
- $(CC) $(CFLAGS) -c $(SRCDIR)/main.c
-
-$(LIB_INDIRECT): indirect.o
- $(CC) $(CFLAGS) $(LD_FLAGS) $(EXEC_PATH_INDIRECT) -o $(LIB_INDIRECT) indirect.o
- if [ "$(OS)" = "Darwin" ]; then dsymutil $(LIB_INDIRECT); fi
-
-indirect.o: $(SRCDIR)/indirect.c
- $(CC) $(CFLAGS) -c $(SRCDIR)/indirect.c
+include Makefile.rules
-$(LIB_REEXPORT): reexport.o $(LIB_INDIRECT)
- $(CC) $(CFLAGS) $(LD_FLAGS) $(EXEC_PATH_REEXPORT) -o $(LIB_REEXPORT) reexport.o -L. -lindirect -Wl,-alias_list,$(SRCDIR)/alias.list
- if [ "$(OS)" = "Darwin" ]; then dsymutil $(LIB_REEXPORT); fi
+build-libindirect: indirect.c
+ $(MAKE) -f $(MAKEFILE_RULES) \
+ DYLIB_C_SOURCES=indirect.c DYLIB_NAME=indirect DYLIB_ONLY=YES
-reexport.o: $(SRCDIR)/reexport.c
- $(CC) $(CFLAGS) -c $(SRCDIR)/reexport.c
-clean::
- rm -rf $(wildcard *.o *~ *.dylib *.so a.out *.dSYM)
+build-libreepxoprt: reexport.c
+ $(MAKE) -f $(MAKEFILE_RULES) \
+ DYLIB_C_SOURCES=reexport.c DYLIB_NAME=reexport DYLIB_ONLY=YES \
+ LD_EXTRAS="-L. -lindirect -Wl,-alias_list,$(SRCDIR)/alias.list"
diff --git a/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py b/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
index 4aa0681f8..e529db11a 100644
--- a/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
+++ b/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
@@ -20,6 +20,7 @@ class TestIndirectFunctions(TestBase):
self.main_source = "main.c"
@skipUnlessDarwin
+ @expectedFailureAll(oslist=no_match(["macosx"]), bugnumber="rdar://55952764")
@add_test_categories(['pyapi'])
def test_with_python_api(self):
"""Test stepping and setting breakpoints in indirect and re-exported symbols."""
@@ -61,8 +62,7 @@ class TestIndirectFunctions(TestBase):
# indirect function.
thread.StepInto()
curr_function = thread.GetFrameAtIndex(0).GetFunctionName()
- self.assertTrue(
- curr_function == "call_through_indirect_hidden",
+ self.assertEqual(curr_function, "call_through_indirect_hidden",
"Stepped into indirect symbols.")
# Now set a breakpoint using the indirect symbol name, and make sure we