summaryrefslogtreecommitdiffstats
path: root/tests/backtrace-subr.sh
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2017-04-25 12:41:58 +0200
committerMark Wielaard <[email protected]>2017-05-02 15:25:02 +0200
commit5e6615076a8ad5fad5c70b4ea266042ed7c44d55 (patch)
treee1ee5afd311e71f96f3a5c0f075ef788fec0c7d2 /tests/backtrace-subr.sh
parent727a90c38613b728d83a1e6c8aad3c6974047cc9 (diff)
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 <[email protected]>
Diffstat (limited to 'tests/backtrace-subr.sh')
-rw-r--r--tests/backtrace-subr.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
index e746dc19..a303e32c 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.