From ef5d0b5e97ec8e6fa395d377b09aa7755e345b4f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:12:36 +0000 Subject: Vendor import of lldb trunk r321017: https://llvm.org/svn/llvm-project/lldb/trunk@321017 --- .../test/expression_command/anonymous-struct/Makefile | 7 ------- .../test/expression_command/call-function/Makefile | 7 ------- .../call-function/TestCallStdStringFunction.py | 15 ++++++++++----- .../test/expression_command/char/TestExprsChar.py | 5 ++++- .../lldbsuite/test/expression_command/fixits/Makefile | 7 ------- .../TestPersistObjCPointeeType.py | 4 +--- .../test/expression_command/po_verbosity/Makefile | 2 +- .../test/expression_command/po_verbosity/main.m | 2 +- .../test/expression_command/top-level/Makefile | 13 +++++++------ .../expression_command/top-level/TestTopLevelExprs.py | 17 ----------------- .../test/expression_command/top-level/dummy.cpp | 16 ++++++++++++---- .../test/expression_command/top-level/dummy.mk | 6 ++++++ 12 files changed, 42 insertions(+), 59 deletions(-) create mode 100644 packages/Python/lldbsuite/test/expression_command/top-level/dummy.mk (limited to 'packages/Python/lldbsuite/test/expression_command') diff --git a/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile index 7df664ac43e3d..8a7102e347af2 100644 --- a/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile +++ b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile @@ -2,11 +2,4 @@ LEVEL = ../../make CXX_SOURCES := main.cpp -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/Makefile b/packages/Python/lldbsuite/test/expression_command/call-function/Makefile index d4b82b3db2766..9d4f3b7f14124 100644 --- a/packages/Python/lldbsuite/test/expression_command/call-function/Makefile +++ b/packages/Python/lldbsuite/test/expression_command/call-function/Makefile @@ -2,13 +2,6 @@ LEVEL = ../../make CXX_SOURCES := main.cpp -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules clean:: diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py index 6645692f93ee6..16736f798528a 100644 --- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py +++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py @@ -26,9 +26,6 @@ class ExprCommandCallFunctionTestCase(TestBase): @expectedFailureAll( compiler="icc", bugnumber="llvm.org/pr14437, fails with ICC 13.1") - @expectedFailureAll( - oslist=['freebsd'], - bugnumber='llvm.org/pr17807 Fails on FreeBSD buildbot') @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765") def test_with(self): """Test calling std::String member function.""" @@ -47,5 +44,13 @@ class ExprCommandCallFunctionTestCase(TestBase): # Calling this function now succeeds, but we follow the typedef return type through to # const char *, and thus don't invoke the Summary formatter. - self.expect("print str.c_str()", - substrs=['Hello world']) + + # clang's libstdc++ on ios arm64 inlines std::string::c_str() always; + # skip this part of the test. + triple = self.dbg.GetSelectedPlatform().GetTriple() + do_cstr_test = True + if triple == "arm64-apple-ios" or triple == "arm64-apple-tvos" or triple == "armv7k-apple-watchos" or triple == "arm64-apple-bridgeos": + do_cstr_test = False + if do_cstr_test: + self.expect("print str.c_str()", + substrs=['Hello world']) diff --git a/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py b/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py index 74991999d926a..445979f5c701d 100644 --- a/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py +++ b/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py @@ -58,7 +58,10 @@ class ExprCharTestCase(TestBase): @expectedFailureAll( archs=[ "i[3-6]86", - "x86_64"], + "x86_64", + "arm64", + 'armv7', + 'armv7k'], bugnumber="llvm.org/pr23069, ") @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765") @expectedFailureAll(triple='mips*', bugnumber="llvm.org/pr23069") diff --git a/packages/Python/lldbsuite/test/expression_command/fixits/Makefile b/packages/Python/lldbsuite/test/expression_command/fixits/Makefile index 7df664ac43e3d..8a7102e347af2 100644 --- a/packages/Python/lldbsuite/test/expression_command/fixits/Makefile +++ b/packages/Python/lldbsuite/test/expression_command/fixits/Makefile @@ -2,11 +2,4 @@ LEVEL = ../../make CXX_SOURCES := main.cpp -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py b/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py index b99fb727e8a5d..e6c9d43adf04c 100644 --- a/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py +++ b/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py @@ -22,10 +22,8 @@ class PersistObjCPointeeType(TestBase): self.line = line_number('main.m', '// break here') @skipUnlessDarwin - @expectedFailureAll( - bugnumber='http://llvm.org/pr23504', - oslist=['macosx'], compiler='clang', compiler_version=['<', '7.0.0']) @skipIf(archs=["i386", "i686"]) + @skipIf(debug_info="gmodules", archs=['arm64', 'armv7', 'armv7k']) # compile error with gmodules for iOS def test_with(self): """Test that we can p *objcObject""" self.build() diff --git a/packages/Python/lldbsuite/test/expression_command/po_verbosity/Makefile b/packages/Python/lldbsuite/test/expression_command/po_verbosity/Makefile index 4464e2ee9f5cf..b6592745356d9 100644 --- a/packages/Python/lldbsuite/test/expression_command/po_verbosity/Makefile +++ b/packages/Python/lldbsuite/test/expression_command/po_verbosity/Makefile @@ -3,4 +3,4 @@ LEVEL = ../../make OBJC_SOURCES := main.m include $(LEVEL)/Makefile.rules -LDFLAGS += -framework Cocoa +LDFLAGS += -framework Foundation diff --git a/packages/Python/lldbsuite/test/expression_command/po_verbosity/main.m b/packages/Python/lldbsuite/test/expression_command/po_verbosity/main.m index 3dbb024b28096..9c79f850bf281 100644 --- a/packages/Python/lldbsuite/test/expression_command/po_verbosity/main.m +++ b/packages/Python/lldbsuite/test/expression_command/po_verbosity/main.m @@ -1,4 +1,4 @@ -#import +#import int main() { diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/Makefile b/packages/Python/lldbsuite/test/expression_command/top-level/Makefile index 7146f227b98ab..48eec5c5d2683 100644 --- a/packages/Python/lldbsuite/test/expression_command/top-level/Makefile +++ b/packages/Python/lldbsuite/test/expression_command/top-level/Makefile @@ -1,12 +1,13 @@ LEVEL = ../../make -default: a.out dummy - CXX_SOURCES := main.cpp test.cpp -dummy: dummy.cpp +include $(LEVEL)/Makefile.rules -clean:: - rm -rf dummy dummy.dSYM +a.out: dummy -include $(LEVEL)/Makefile.rules +dummy: + $(MAKE) -f dummy.mk + +clean:: + $(MAKE) -f dummy.mk clean diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py b/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py index 137c403988707..dfe95a1a9fa7a 100644 --- a/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py +++ b/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py @@ -57,23 +57,6 @@ class TopLevelExpressionsTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) @add_test_categories(['pyapi']) - @expectedFailureAndroid(api_levels=[21, 22], bugnumber="llvm.org/pr27787") - @expectedFailureAll( - oslist=["linux"], - archs=[ - "arm", - "aarch64"], - bugnumber="llvm.org/pr27787") - @expectedFailureAll( - bugnumber="llvm.org/pr28353", - oslist=["linux"], - archs=[ - "i386", - "x86_64"], - compiler="gcc", - compiler_version=[ - "<", - "4.9"]) @skipIf(debug_info="gmodules") # not relevant @skipIf(oslist=["windows"]) # Error in record layout on Windows def test_top_level_expressions(self): diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp b/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp index 31204b21d972a..fa49bd4bda7e3 100644 --- a/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp +++ b/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp @@ -1,7 +1,15 @@ #include -int main() -{ - printf("This is a dummy\n"); // Set breakpoint here - return 0; +// These are needed to make sure that the linker does not strip the parts of the +// C++ abi library that are necessary to execute the expressions in the +// debugger. It would be great if we did not need to do this, but the fact that +// LLDB cannot conjure up the abi library on demand is not relevant for testing +// top level expressions. +struct DummyA {}; +struct DummyB : public virtual DummyA {}; + +int main() { + DummyB b; + printf("This is a dummy\n"); // Set breakpoint here + return 0; } diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/dummy.mk b/packages/Python/lldbsuite/test/expression_command/top-level/dummy.mk new file mode 100644 index 0000000000000..af97678b2cf53 --- /dev/null +++ b/packages/Python/lldbsuite/test/expression_command/top-level/dummy.mk @@ -0,0 +1,6 @@ +LEVEL = ../../make + +CXX_SOURCES := dummy.cpp +EXE := dummy + +include $(LEVEL)/Makefile.rules -- cgit v1.2.3