Index: packages/Python/lldbsuite/test/decorators.py =================================================================== --- packages/Python/lldbsuite/test/decorators.py +++ packages/Python/lldbsuite/test/decorators.py @@ -11,6 +11,7 @@ import sys import tempfile import subprocess +import distutils.spawn # Third-party modules import six @@ -810,3 +811,18 @@ except subprocess.CalledProcessError: return "%s is not supported on this system." % feature return skipTestIfFn(is_feature_enabled) + +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