Index: packages/Python/lldbsuite/test/decorators.py =================================================================== --- packages/Python/lldbsuite/test/decorators.py +++ packages/Python/lldbsuite/test/decorators.py @@ -10,6 +10,7 @@ import re import sys import tempfile +import distutils.spawn # Third-party modules import six @@ -771,3 +772,18 @@ fail_value = True # More likely to notice if something goes wrong have_xml = xml.GetValueForKey("value").GetBooleanValue(fail_value) return unittest2.skipIf(not have_xml, "requires xml support")(func) + +def skipUnlessDWZInstalled(func): + """Decorate the item to skip tests when no DWZ optimization tool is available. + /usr/lib/rpm/sepdebugcrcfix is not tested here but it may be needed + when build-ids cannot be used.""" + + def is_dwz_missing(self): + if distutils.spawn.find_executable("dwz") is None: + return "skipping because dwz is not found" + # dwz has a bug it can process only separate debug info files. + # Moreover dwz is compatible only with debug infos created by eu-strip. + if distutils.spawn.find_executable("eu-strip") is None: + return "skipping because eu-strip is not found" + return None + return skipTestIfFn(is_dwz_missing)(func) Index: packages/Python/lldbsuite/test/linux/buildidsymlink/Makefile =================================================================== --- /dev/null +++ packages/Python/lldbsuite/test/linux/buildidsymlink/Makefile @@ -0,0 +1,24 @@ +LEVEL = ../../make +C_SOURCES := main.c +LD_EXTRAS += -Wl,--build-id=sha1 + +all: .build-id + +.PHONY: .build-id +stripped.out stripped.debug stripped.debug.dwz: a.out + eu-strip --remove-comment -f stripped.debug -F stripped.debugx -o stripped.out $< + cp -p stripped.debug stripped.debug.dup + dwz -m stripped.debug.dwz stripped.debug stripped.debug.dup + +.build-id: stripped.debug + $(OBJCOPY) -j .note.gnu.build-id -O binary $< tmp + rm -rf .build-id + fn=`od -An -tx1