]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Add core backtracegen check and regen ppc32 backtrace testfiles.
authorMark Wielaard <mark@klomp.org>
Tue, 25 Apr 2017 10:41:58 +0000 (12:41 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 2 May 2017 13:25:02 +0000 (15:25 +0200)
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 <mark@klomp.org>
tests/ChangeLog
tests/backtrace-subr.sh
tests/backtrace.ppc.core.bz2
tests/backtrace.ppc.exec.bz2
tests/run-backtrace-core-ppc.sh

index 32dc48c85f0801afce8681c7404028cb90cc865b..73485458a3b1481632d694c5b9449c98759ee1de 100644 (file)
@@ -1,3 +1,10 @@
+2017-04-25  Mark Wielaard  <mark@klomp.org>
+
+       * 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  <mark@klomp.org>
 
        * backtrace.c: Remove option to allow unknown symbols in the trace.
index e746dc1968e6825be5e1402d37849df0bf2171e7..a303e32c8c2ef3dc6fc69675ac3a6db7f0ae0cab 100644 (file)
@@ -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.
index f20cd9f33c231448990a43fea5453267dea2e7e4..3a025d2839a78ab0e956e81e2c445d1c557642ab 100644 (file)
Binary files a/tests/backtrace.ppc.core.bz2 and b/tests/backtrace.ppc.core.bz2 differ
index 057c25a6b89c98967b97e153453ef93277526714..333c6be963d5dcd4f676dfca5ee871cb8e80db1c 100644 (file)
Binary files a/tests/backtrace.ppc.exec.bz2 and b/tests/backtrace.ppc.exec.bz2 differ
index 65c927956974a4c4d4c4112eed4210f80df74512..555ac3522586553d35e3cc7e7941b4e8fdc6bc7c 100755 (executable)
 
 . $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