git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@5373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-01-19 18:07:38 +00:00
Родитель 15dd75c243
Коммит 03efbe659c
1 изменённых файлов: 27 добавлений и 0 удалений

27
RunSafely.sh Executable file
Просмотреть файл

@ -0,0 +1,27 @@
#!/bin/sh
#
# Program: RunSafely.sh
#
# Synopsis: This script simply runs another program. If the program works
# correctly, this script has no effect, otherwise it will do things
# like print a stack trace of a core dump. It always returns
# "successful" so that tests will continue to be run.
#
# Syntax: ./RunSafely.sh <program> <arguments>
#
PROGRAM=$1
shift
rm -f core*
ulimit -c hard
$PROGRAM $*
if ls | egrep "^core" > /dev/null
then
corefile=`ls core* | head -1`
echo "where" > StackTrace.$$
gdb -q -batch --command=StackTrace.$$ --core=$corefile $PROGRAM < /dev/null
rm -f StackTrace.$$ $corefile
fi
exit 0