From: Mark Wielaard Date: Tue, 25 Apr 2017 10:41:58 +0000 (+0200) Subject: tests: Add core backtracegen check and regen ppc32 backtrace testfiles. X-Git-Tag: elfutils-0.169~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e6615076a8ad5fad5c70b4ea266042ed7c44d55;p=thirdparty%2Felfutils.git tests: Add core backtracegen check and regen ppc32 backtrace testfiles. Add a check to check_core to make sure the backtracegen function is found in the backtrace. This function is in the middle of the backtrace in the main executable and if not found it means the backtrace was incomplete or the frame was skipped (which could happen on a bad frame pointer only unwind). This showed that the ppc32 backtrace test files were missing DWARF CFI for the main executable. Regenerated them to include full CFI. Signed-off-by: Mark Wielaard --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 32dc48c85..73485458a 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,10 @@ +2017-04-25 Mark Wielaard + + * backtrace-subr.sh (check_backtracegen): New function. + (check_core): Add check_backtracegen call. + * backtrace.ppc.exec.bz2: Regenerated. + * backtrace.ppc.core.bz2: Likewise. + 2017-04-24 Mark Wielaard * backtrace.c: Remove option to allow unknown symbols in the trace. diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh index e746dc196..a303e32c8 100644 --- a/tests/backtrace-subr.sh +++ b/tests/backtrace-subr.sh @@ -40,6 +40,19 @@ check_gsignal() false } + +# Makes sure we saw the function that initiated the backtrace +# when the core was generated through the tests backtrace --gencore. +# This might disappear when frame pointer chasing gone bad. +check_backtracegen() +{ + if grep -w backtracegen $1; then + return + fi + echo >&2 $2: no backtracegen + false +} + # Verify the STDERR output does not contain unexpected errors. # In some cases we cannot reliably find out we got behind _start as some # operating system do not properly terminate CFI by undefined PC. @@ -105,6 +118,7 @@ check_core() cat backtrace.$arch.{bt,err} check_unsupported backtrace.$arch.err backtrace.$arch.core check_all backtrace.$arch.{bt,err} backtrace.$arch.core + check_backtracegen backtrace.$arch.bt backtrace.$arch.core } # Backtrace live process. diff --git a/tests/backtrace.ppc.core.bz2 b/tests/backtrace.ppc.core.bz2 index f20cd9f33..3a025d283 100644 Binary files a/tests/backtrace.ppc.core.bz2 and b/tests/backtrace.ppc.core.bz2 differ diff --git a/tests/backtrace.ppc.exec.bz2 b/tests/backtrace.ppc.exec.bz2 index 057c25a6b..333c6be96 100644 Binary files a/tests/backtrace.ppc.exec.bz2 and b/tests/backtrace.ppc.exec.bz2 differ diff --git a/tests/run-backtrace-core-ppc.sh b/tests/run-backtrace-core-ppc.sh index 65c927956..555ac3522 100755 --- a/tests/run-backtrace-core-ppc.sh +++ b/tests/run-backtrace-core-ppc.sh @@ -17,4 +17,13 @@ . $srcdir/backtrace-subr.sh +# executable generated by: +# +# gcc -D_GNU_SOURCE -I. -I.. -I../lib -m32 -pthread -static -g \ +# -o backtrace.ppc.exec backtrace-child.c +# +# core generated by: +# +# ./backtrace.ppc.exec --gencore + check_core ppc