[libbacktrace] Add btest_dwz test-case

Add test-case to verify that libbacktrace can read debug info that was
compressed with dwz.

2019-01-17  Tom de Vries  <tdevries@suse.de>

	PR libbacktrace/82857
	* configure.ac (DWZ): Set with AC_CHECK_PROG.
	(HAVE_DWZ): Set with AM_CONDITIONAL.
	* configure: Regenerate.
	* Makefile.am (TESTS): Add btest_dwz.
	* Makefile.in: Regenerate.

From-SVN: r268032
This commit is contained in:
Tom de Vries 2019-01-17 13:42:30 +00:00 committed by Tom de Vries
parent 1c2a9a37c6
commit 10f48858e8
5 changed files with 106 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2019-01-17 Tom de Vries <tdevries@suse.de>
PR libbacktrace/82857
* configure.ac (DWZ): Set with AC_CHECK_PROG.
(HAVE_DWZ): Set with AM_CONDITIONAL.
* configure: Regenerate.
* Makefile.am (TESTS): Add btest_dwz.
* Makefile.in: Regenerate.
2019-01-17 Tom de Vries <tdevries@suse.de>
PR libbacktrace/82857

View File

@ -178,6 +178,20 @@ btest_alloc_LDADD = libbacktrace_alloc.la
check_PROGRAMS += btest_alloc
if HAVE_DWZ
%_dwz: %
rm -f $@ $@_common.debug
cp $< $@_1
cp $< $@_2
$(DWZ) -m $@_common.debug $@_1 $@_2
rm -f $@_2
mv $@_1 $@
TESTS += btest_dwz
endif HAVE_DWZ
stest_SOURCES = stest.c
stest_LDADD = libbacktrace.la

View File

@ -126,11 +126,12 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3)
@NATIVE_TRUE@ allocfail btest btest_alloc stest stest_alloc \
@NATIVE_TRUE@ ztest ztest_alloc edtest edtest_alloc
@NATIVE_TRUE@am__append_2 = allocfail.sh
@HAVE_ZLIB_TRUE@@NATIVE_TRUE@am__append_3 = -lz
@HAVE_DWZ_TRUE@@NATIVE_TRUE@am__append_3 = btest_dwz
@HAVE_ZLIB_TRUE@@NATIVE_TRUE@am__append_4 = -lz
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__append_5 = ttest ttest_alloc
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_6 = dtest
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_7 = ctestg ctesta \
@HAVE_ZLIB_TRUE@@NATIVE_TRUE@am__append_5 = -lz
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__append_6 = ttest ttest_alloc
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_7 = dtest
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_8 = ctestg ctesta \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctestg_alloc \
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta_alloc
subdir = .
@ -632,6 +633,7 @@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
DWZ = @DWZ@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@ -786,7 +788,8 @@ libbacktrace_la_LIBADD = \
$(ALLOC_FILE)
libbacktrace_la_DEPENDENCIES = $(libbacktrace_la_LIBADD)
TESTS = $(check_PROGRAMS) $(am__append_2) $(am__append_6)
TESTS = $(check_PROGRAMS) $(am__append_2) $(am__append_3) \
$(am__append_7)
@NATIVE_TRUE@check_LTLIBRARIES = libbacktrace_alloc.la \
@NATIVE_TRUE@ libbacktrace_noformat.la \
@NATIVE_TRUE@ libbacktrace_instrumented_alloc.la
@ -831,9 +834,9 @@ TESTS = $(check_PROGRAMS) $(am__append_2) $(am__append_6)
@NATIVE_TRUE@stest_alloc_LDADD = libbacktrace_alloc.la
@NATIVE_TRUE@ztest_SOURCES = ztest.c testlib.c
@NATIVE_TRUE@ztest_CFLAGS = -DSRCDIR=\"$(srcdir)\"
@NATIVE_TRUE@ztest_LDADD = libbacktrace.la $(am__append_3) \
@NATIVE_TRUE@ztest_LDADD = libbacktrace.la $(am__append_4) \
@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
@NATIVE_TRUE@ztest_alloc_LDADD = libbacktrace_alloc.la $(am__append_4) \
@NATIVE_TRUE@ztest_alloc_LDADD = libbacktrace_alloc.la $(am__append_5) \
@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
@NATIVE_TRUE@ztest_alloc_SOURCES = $(ztest_SOURCES)
@NATIVE_TRUE@ztest_alloc_CFLAGS = $(ztest_CFLAGS)
@ -1575,6 +1578,13 @@ allocfail.sh.log: allocfail.sh
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
btest_dwz.log: btest_dwz
@p='btest_dwz'; \
b='btest_dwz'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
dtest.log: dtest
@p='dtest'; \
b='dtest'; \
@ -1743,6 +1753,14 @@ uninstall-am:
@NATIVE_TRUE@allocfail.sh: allocfail
@HAVE_DWZ_TRUE@@NATIVE_TRUE@%_dwz: %
@HAVE_DWZ_TRUE@@NATIVE_TRUE@ rm -f $@ $@_common.debug
@HAVE_DWZ_TRUE@@NATIVE_TRUE@ cp $< $@_1
@HAVE_DWZ_TRUE@@NATIVE_TRUE@ cp $< $@_2
@HAVE_DWZ_TRUE@@NATIVE_TRUE@ $(DWZ) -m $@_common.debug $@_1 $@_2
@HAVE_DWZ_TRUE@@NATIVE_TRUE@ rm -f $@_2
@HAVE_DWZ_TRUE@@NATIVE_TRUE@ mv $@_1 $@
@NATIVE_TRUE@edtest2_build.c: gen_edtest2_build; @true
@NATIVE_TRUE@gen_edtest2_build: $(srcdir)/edtest2.c
@NATIVE_TRUE@ cat $(srcdir)/edtest2.c > tmp-edtest2_build.c

View File

@ -672,6 +672,9 @@ LD
FGREP
SED
LIBTOOL
HAVE_DWZ_FALSE
HAVE_DWZ_TRUE
DWZ
RANLIB
MAINT
MAINTAINER_MODE_FALSE
@ -5366,6 +5369,52 @@ case "$AWK" in
"") as_fn_error $? "can't build without awk" "$LINENO" 5 ;;
esac
# Extract the first word of "dwz", so it can be a program name with args.
set dummy dwz; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_DWZ+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DWZ"; then
ac_cv_prog_DWZ="$DWZ" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DWZ="dwz"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
DWZ=$ac_cv_prog_DWZ
if test -n "$DWZ"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DWZ" >&5
$as_echo "$DWZ" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$DWZ" != ""; then
HAVE_DWZ_TRUE=
HAVE_DWZ_FALSE='#'
else
HAVE_DWZ_TRUE='#'
HAVE_DWZ_FALSE=
fi
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@ -11440,7 +11489,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11443 "configure"
#line 11492 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11546,7 +11595,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11549 "configure"
#line 11598 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -13558,6 +13607,10 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_DWZ_TRUE}" && test -z "${HAVE_DWZ_FALSE}"; then
as_fn_error $? "conditional \"HAVE_DWZ\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_PTHREAD_TRUE}" && test -z "${HAVE_PTHREAD_FALSE}"; then
as_fn_error $? "conditional \"HAVE_PTHREAD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -78,6 +78,9 @@ case "$AWK" in
"") AC_MSG_ERROR([can't build without awk]) ;;
esac
AC_CHECK_PROG(DWZ, dwz, dwz)
AM_CONDITIONAL(HAVE_DWZ, test "$DWZ" != "")
LT_INIT
AM_PROG_LIBTOOL