Improve travis backtrace script
This commit is contained in:
parent
8fb640f1ff
commit
23a26bf08b
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
#
|
||||
# Find all possible core files under current directory. Attempt
|
||||
# to determine exe using file(1) and dump stack trace with gdb.
|
||||
@ -6,13 +6,18 @@
|
||||
say () { printf "\033[91m%s\033[39m\n" "$@" >&2; }
|
||||
die () { say "$@"; exit 1; }
|
||||
|
||||
find . -name *.core -o -name core | while read -r line; do
|
||||
d=$(dirname $line)
|
||||
f=$(basename $line)
|
||||
exe=$(file $line | sed "s/.*from '\([^ \t]*\).*'.*/\1/")
|
||||
( cd $d &&
|
||||
test -x $exe || die "Failed to find executable at $exe" &&
|
||||
say "Found corefile for $exe" &&
|
||||
gdb --batch --quiet -ex "thread apply all bt full" $exe $f
|
||||
)
|
||||
done
|
||||
|
||||
case $TESTENV in
|
||||
py34-cov)
|
||||
exe=/usr/bin/python3.4
|
||||
;;
|
||||
py3*-pyqt*)
|
||||
exe=$(readlink -f .tox/$TESTENV/bin/python)
|
||||
;;
|
||||
*)
|
||||
echo "Skipping coredump analysis in testenv $TESTENV!"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
find . -name *.core -o -name core -exec gdb --batch --quiet -ex "thread apply all bt full" "$exe" {} \;
|
||||
|
Loading…
Reference in New Issue
Block a user