[Lldb-commits] [lldb] r374256 - TestIndirectSymbols: Modernize the Makefile
Frederic Riss via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 9 15:47:28 PDT 2019
Author: friss
Date: Wed Oct 9 15:47:28 2019
New Revision: 374256
URL: http://llvm.org/viewvc/llvm-project?rev=374256&view=rev
Log:
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...
Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile
lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile?rev=374256&r1=374255&r2=374256&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile Wed Oct 9 15:47:28 2019
@@ -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
-
-$(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
+include Makefile.rules
-reexport.o: $(SRCDIR)/reexport.c
- $(CC) $(CFLAGS) -c $(SRCDIR)/reexport.c
-clean::
- rm -rf $(wildcard *.o *~ *.dylib *.so a.out *.dSYM)
+build-libindirect: indirect.c
+ $(MAKE) -f $(MAKEFILE_RULES) \
+ DYLIB_C_SOURCES=indirect.c DYLIB_NAME=indirect DYLIB_ONLY=YES
+
+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"
Modified: lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py?rev=374256&r1=374255&r2=374256&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py Wed Oct 9 15:47:28 2019
@@ -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
More information about the lldb-commits
mailing list