[Lldb-commits] [lldb] r352072 - Add decorator support for the DWARF version produced by the compiler
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Thu Jan 24 10:24:15 PST 2019
Author: adrian
Date: Thu Jan 24 10:24:14 2019
New Revision: 352072
URL: http://llvm.org/viewvc/llvm-project?rev=352072&view=rev
Log:
Add decorator support for the DWARF version produced by the compiler
and mark up some tests failing in
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/
Modified:
lldb/trunk/packages/Python/lldbsuite/test/decorators.py
lldb/trunk/packages/Python/lldbsuite/test/expression_command/radar_43822994/TestScopedEnumType.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
lldb/trunk/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=352072&r1=352071&r2=352072&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Thu Jan 24 10:24:14 2019
@@ -162,7 +162,7 @@ def _decorateTest(mode,
debug_info=None,
swig_version=None, py_version=None,
macos_version=None,
- remote=None):
+ remote=None, dwarf_version=None):
def fn(self):
skip_for_os = _match_decorator_property(
lldbplatform.translate(oslist), self.getPlatform())
@@ -197,6 +197,9 @@ def _decorateTest(mode,
macos_version[0],
macos_version[1],
platform.mac_ver()[0])))
+ skip_for_dwarf_version = (
+ dwarf_version is None) or _check_expected_version(
+ dwarf_version[0], dwarf_version[1], self.getDwarfVersion())
# For the test to be skipped, all specified (e.g. not None) parameters must be True.
# An unspecified parameter means "any", so those are marked skip by default. And we skip
@@ -210,7 +213,8 @@ def _decorateTest(mode,
(swig_version, skip_for_swig_version, "swig version"),
(py_version, skip_for_py_version, "python version"),
(macos_version, skip_for_macos_version, "macOS version"),
- (remote, skip_for_remote, "platform locality (remote/local)")]
+ (remote, skip_for_remote, "platform locality (remote/local)"),
+ (dwarf_version, skip_for_dwarf_version, "dwarf version")]
reasons = []
final_skip_result = True
for this_condition in conditions:
@@ -254,7 +258,7 @@ def expectedFailureAll(bugnumber=None,
debug_info=None,
swig_version=None, py_version=None,
macos_version=None,
- remote=None):
+ remote=None, dwarf_version=None):
return _decorateTest(DecorateMode.Xfail,
bugnumber=bugnumber,
oslist=oslist, hostoslist=hostoslist,
@@ -263,7 +267,7 @@ def expectedFailureAll(bugnumber=None,
debug_info=debug_info,
swig_version=swig_version, py_version=py_version,
macos_version=None,
- remote=remote)
+ remote=remote,dwarf_version=dwarf_version)
# provide a function to skip on defined oslist, compiler version, and archs
@@ -279,7 +283,7 @@ def skipIf(bugnumber=None,
debug_info=None,
swig_version=None, py_version=None,
macos_version=None,
- remote=None):
+ remote=None, dwarf_version=None):
return _decorateTest(DecorateMode.Skip,
bugnumber=bugnumber,
oslist=oslist, hostoslist=hostoslist,
@@ -288,7 +292,7 @@ def skipIf(bugnumber=None,
debug_info=debug_info,
swig_version=swig_version, py_version=py_version,
macos_version=macos_version,
- remote=remote)
+ remote=remote, dwarf_version=dwarf_version)
def _skip_for_android(reason, api_levels, archs):
Modified: lldb/trunk/packages/Python/lldbsuite/test/expression_command/radar_43822994/TestScopedEnumType.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/radar_43822994/TestScopedEnumType.py?rev=352072&r1=352071&r2=352072&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/radar_43822994/TestScopedEnumType.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/radar_43822994/TestScopedEnumType.py Thu Jan 24 10:24:14 2019
@@ -11,6 +11,7 @@ class ScopedEnumType(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ @skipIf(dwarf_version=['<', '4'])
def test(self):
self.build()
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py?rev=352072&r1=352071&r2=352072&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py Thu Jan 24 10:24:14 2019
@@ -16,6 +16,7 @@ class TestTailCallFrameSBAPI(TestBase):
NO_DEBUG_INFO_TESTCASE = True
@skipIf(compiler="clang", compiler_version=['<', '8.0'])
+ @skipIf(dwarf_version=['<', '4'])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr26265")
def test_tail_call_frame_sbapi(self):
self.build()
Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py?rev=352072&r1=352071&r2=352072&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py Thu Jan 24 10:24:14 2019
@@ -16,6 +16,7 @@ class CPP11EnumTypesTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
+ @skipIf(dwarf_version=['<', '4'])
def test_int8_t(self):
"""Test C++11 enumeration class types as int8_t types."""
self.build(
@@ -24,6 +25,7 @@ class CPP11EnumTypesTestCase(TestBase):
self.image_lookup_for_enum_type()
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
+ @skipIf(dwarf_version=['<', '4'])
def test_int16_t(self):
"""Test C++11 enumeration class types as int16_t types."""
self.build(
@@ -32,6 +34,7 @@ class CPP11EnumTypesTestCase(TestBase):
self.image_lookup_for_enum_type()
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
+ @skipIf(dwarf_version=['<', '4'])
def test_int32_t(self):
"""Test C++11 enumeration class types as int32_t types."""
self.build(
@@ -40,6 +43,7 @@ class CPP11EnumTypesTestCase(TestBase):
self.image_lookup_for_enum_type()
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
+ @skipIf(dwarf_version=['<', '4'])
def test_int64_t(self):
"""Test C++11 enumeration class types as int64_t types."""
self.build(
@@ -48,6 +52,7 @@ class CPP11EnumTypesTestCase(TestBase):
self.image_lookup_for_enum_type()
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
+ @skipIf(dwarf_version=['<', '4'])
def test_uint8_t(self):
"""Test C++11 enumeration class types as uint8_t types."""
self.build(
@@ -56,6 +61,7 @@ class CPP11EnumTypesTestCase(TestBase):
self.image_lookup_for_enum_type()
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
+ @skipIf(dwarf_version=['<', '4'])
def test_uint16_t(self):
"""Test C++11 enumeration class types as uint16_t types."""
self.build(
@@ -64,6 +70,7 @@ class CPP11EnumTypesTestCase(TestBase):
self.image_lookup_for_enum_type()
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
+ @skipIf(dwarf_version=['<', '4'])
def test_uint32_t(self):
"""Test C++11 enumeration class types as uint32_t types."""
self.build(
@@ -72,6 +79,7 @@ class CPP11EnumTypesTestCase(TestBase):
self.image_lookup_for_enum_type()
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
+ @skipIf(dwarf_version=['<', '4'])
def test_uint64_t(self):
"""Test C++11 enumeration class types as uint64_t types."""
self.build(
Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py?rev=352072&r1=352071&r2=352072&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py Thu Jan 24 10:24:14 2019
@@ -113,6 +113,7 @@ class TemplateArgsTestCase(TestBase):
# Gcc does not generate the necessary DWARF attribute for enum template
# parameters.
@expectedFailureAll(bugnumber="llvm.org/pr28354", compiler="gcc")
+ @skipIf(dwarf_version=['<', '4'])
def test_enum_args(self):
frame = self.prepareProcess()
Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py?rev=352072&r1=352071&r2=352072&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py Thu Jan 24 10:24:14 2019
@@ -25,6 +25,7 @@ class TestObjCIvarsInBlocks(TestBase):
@skipUnlessDarwin
@add_test_categories(['pyapi'])
+ @skipIf(dwarf_version=['<', '4'])
@expectedFailureAll(
archs=["i[3-6]86"],
bugnumber="This test requires the 2.0 runtime, so it will fail on i386")
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=352072&r1=352071&r2=352072&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Jan 24 10:24:14 2019
@@ -1309,6 +1309,19 @@ class Base(unittest2.TestCase):
version = m.group(1)
return version
+ def getDwarfVersion(self):
+ """ Returns the dwarf version generated by clang or 'unknown'. """
+ if 'clang' not in self.getCompiler():
+ return 'unknown'
+ driver_output = check_output(
+ [self.getCompiler()] + '-g -c -x c - -o - -###'.split(),
+ stderr=STDOUT)
+ for line in driver_output.split(os.linesep):
+ m = re.search('dwarf-version=([0-9])', line)
+ if m:
+ return m.group(1)
+ return 'unknown'
+
def platformIsDarwin(self):
"""Returns true if the OS triple for the selected platform is any valid apple OS"""
return lldbplatformutil.platformIsDarwin()
More information about the lldb-commits
mailing list