jankratochvil created this revision.
Herald added subscribers: eraman, aprantl.
Many ERRORs are correct because for many *_dwz testcases DWZ cannot be applied.
Otherwise their tests would be duplicating their *_dwarf counterparts.
Using for regression comparison of *_dwz against *_dwarf:
rm -rf RESULT-dwz ;mv lldb-test-traces RESULT-dwz ;mv log RESULT-dwz.log
sed -e '1,/^Issue Details$/d' <RESULT-dwz.log >RESULT-dwz.issues;for type in
dwz dwarf;do for t in $(grep -v '^ERROR: ' RESULT-dwz.issues|sed -n 's/^.*:
\(test_[^ ]*_\)dwz .*$/\1/p'|sort -u);do sed -n "s/\(: ${t}\)$type /\1 /p"
RESULT-dwz.issues;done|sort >RESULT-dwz.$type;done;diff -U-1
RESULT-dwz.{dwarf,dwz}|less
All DWZ patches are also applied in: git clone -b dwz
git://git.jankratochvil.net/lldb
https://reviews.llvm.org/D40475
Files:
packages/Python/lldbsuite/test/lldbinline.py
packages/Python/lldbsuite/test/lldbtest.py
packages/Python/lldbsuite/test/make/Makefile.rules
packages/Python/lldbsuite/test/plugins/builder_base.py
packages/Python/lldbsuite/test/test_categories.py
Index: packages/Python/lldbsuite/test/test_categories.py
===================================================================
--- packages/Python/lldbsuite/test/test_categories.py
+++ packages/Python/lldbsuite/test/test_categories.py
@@ -7,6 +7,8 @@
# System modules
import sys
+import os
+import distutils.spawn
# Third-party modules
@@ -38,6 +40,12 @@
'watchpoint': 'Watchpoint-related tests',
}
+if (os.access("/usr/lib/rpm/sepdebugcrcfix", os.X_OK)
+ and distutils.spawn.find_executable("eu-strip") is not None
+ and distutils.spawn.find_executable("dwz") is not None):
+ debug_info_categories.append('dwz')
+ all_categories['dwz'] = 'Tests using the DWARF type units (-fdebug-types-section)';
+
def unique_string_match(yourentry, list):
candidate = None
@@ -61,6 +69,8 @@
if platform not in ["linux", "freebsd", "darwin", "macosx", "ios", "watchos", "tvos", "bridgeos"]:
return False
return gmodules.is_compiler_clang_with_gmodules(compiler_path)
+ elif category == "dwz":
+ return platform in ["linux"]
return True
Index: packages/Python/lldbsuite/test/plugins/builder_base.py
===================================================================
--- packages/Python/lldbsuite/test/plugins/builder_base.py
+++ packages/Python/lldbsuite/test/plugins/builder_base.py
@@ -192,6 +192,24 @@
# True signifies that we can handle building with gmodules.
return True
+def buildDwz(
+ sender=None,
+ architecture=None,
+ compiler=None,
+ dictionary=None,
+ clean=True):
+ """Build the binaries with type units (type in a .debug_types section)."""
+ commands = []
+ if clean:
+ commands.append([getMake(), "clean", getCmdLine(dictionary)])
+ # dwz has a bug being unable to process non-separated debug info.
+ commands.append([getMake(), "MAKE_DSYM=NO", "DWZ=YES",
+ getArchSpec(architecture), getCCSpec(compiler),
+ getCmdLine(dictionary)])
+
+ runBuildCommands(commands, sender=sender)
+ # True signifies that we can handle building dwo.
+ return True
def cleanup(sender=None, dictionary=None):
"""Perform a platform-specific cleanup after the test."""
Index: packages/Python/lldbsuite/test/make/Makefile.rules
===================================================================
--- packages/Python/lldbsuite/test/make/Makefile.rules
+++ packages/Python/lldbsuite/test/make/Makefile.rules
@@ -18,6 +18,7 @@
# LD_EXTRAS :=
# SPLIT_DEBUG_SYMBOLS := YES
# CROSS_COMPILE :=
+# DWZ := YES
#
# And test/functionalities/archives/Makefile:
# MAKE_DSYM := NO
@@ -313,6 +314,19 @@
LDFLAGS += -pie
endif
+#----------------------------------------------------------------------
+# Make the dSYM file from the executable if $(DWZ) = "YES"
+#----------------------------------------------------------------------
+ifeq "$(DWZ)" "YES"
+ dwz_strip = \
+ eu-strip --remove-comment -f "$(1).debug" "$(1)" \
+ && cp "$(1).debug" "$(1).debug.dup" \
+ && dwz -m "$(1).debug.dwz" "$(1).debug" "$(1).debug.dup" \
+ && /usr/lib/rpm/sepdebugcrcfix . "$(1)"
+else
+ dwz_strip =
+endif
+
#----------------------------------------------------------------------
# Windows specific options
#----------------------------------------------------------------------
@@ -514,12 +528,14 @@
ifeq "$(DYLIB_ONLY)" ""
$(EXE) : $(OBJECTS) $(ARCHIVE_NAME) $(DYLIB_FILENAME)
$(LD) $(OBJECTS) $(ARCHIVE_NAME) -L. -l$(DYLIB_NAME) $(LDFLAGS) -o "$(EXE)"
+ $(call dwz_strip,$(EXE))
else
EXE = $(DYLIB_FILENAME)
endif
else
$(EXE) : $(OBJECTS) $(ARCHIVE_NAME)
$(LD) $(OBJECTS) $(LDFLAGS) $(ARCHIVE_NAME) -o "$(EXE)"
+ $(call dwz_strip,$(EXE))
endif
#----------------------------------------------------------------------
@@ -554,6 +570,7 @@
$(OBJCOPY) --only-keep-debug "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME).debug"
$(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DYLIB_FILENAME).debug" "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME)"
endif
+ $(call dwz_strip,$(DYLIB_FILENAME))
endif
#----------------------------------------------------------------------
@@ -639,6 +656,7 @@
ifneq "$(DYLIB_NAME)" ""
$(RM) -r $(DYLIB_FILENAME).dSYM
$(RM) $(DYLIB_OBJECTS) $(DYLIB_PREREQS) $(DYLIB_PREREQS:.d=.d.tmp) $(DYLIB_DWOS) $(DYLIB_FILENAME) $(DYLIB_FILENAME).debug
+ $(RM) $(DYLIB_FILENAME).debug.dup $(DYLIB_FILENAME).debug.dwz
endif
ifneq "$(PCH_OUTPUT)" ""
$(RM) $(PCH_OUTPUT)
@@ -654,7 +672,7 @@
$(RM) $(DYLIB_NAME).lib $(DYLIB_NAME).exp
endif
else
- $(RM) "$(EXE)"
+ $(RM) "$(EXE)" "$(EXE).debug" "$(EXE).debug.dup" "$(EXE).debug.dwz"
endif
#----------------------------------------------------------------------
Index: packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -1570,6 +1570,22 @@
clean):
raise Exception("Don't know how to build binary with gmodules")
+ def buildDwz(
+ self,
+ architecture=None,
+ compiler=None,
+ dictionary=None,
+ clean=True):
+ """Platform specific way to build binaries with dwz optimizer."""
+ module = builder_module()
+ if not module.buildDwz(
+ self,
+ architecture,
+ compiler,
+ dictionary,
+ clean):
+ raise Exception("Don't know how to build binary with DWZ")
+
def buildGo(self):
"""Build the default go binary.
"""
@@ -1755,6 +1771,16 @@
gmodules_test_method.__name__ = gmodules_method_name
newattrs[gmodules_method_name] = gmodules_test_method
+ if "dwz" in supported_categories:
+ @decorators.add_test_categories(["dwz"])
+ @wraps(attrvalue)
+ def dwz_test_method(self, attrvalue=attrvalue):
+ self.debug_info = "dwz"
+ return attrvalue(self)
+ dwz_method_name = attrname + "_dwz"
+ dwz_test_method.__name__ = dwz_method_name
+ newattrs[dwz_method_name] = dwz_test_method
+
else:
newattrs[attrname] = attrvalue
return super(
@@ -2265,6 +2291,9 @@
elif self.debug_info == "gmodules":
return self.buildGModules(
architecture, compiler, dictionary, clean)
+ elif self.debug_info == "dwz":
+ return self.buildDwz(
+ architecture, compiler, dictionary, clean)
else:
self.fail("Can't build for debug info: %s" % self.debug_info)
Index: packages/Python/lldbsuite/test/lldbinline.py
===================================================================
--- packages/Python/lldbsuite/test/lldbinline.py
+++ packages/Python/lldbsuite/test/lldbinline.py
@@ -159,6 +159,12 @@
self.buildGModules()
self.do_test()
+ def __test_with_dwz(self):
+ self.using_dsym = False
+ self.BuildMakefile()
+ self.buildDwz()
+ self.do_test()
+
def execute_user_command(self, __command):
exec(__command, globals(), locals())
@@ -241,6 +247,10 @@
"gmodules", target_platform, configuration.compiler):
test.test_with_gmodules = ApplyDecoratorsToFunction(
test._InlineTest__test_with_gmodules, decorators)
+ if test_categories.is_supported_on_platform(
+ "dwz", target_platform, configuration.compiler):
+ test.test_with_dwz = ApplyDecoratorsToFunction(
+ test._InlineTest__test_with_dwz, decorators)
# Add the test case to the globals, and hide InlineTest
__globals.update({test_name: test})
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits