zeek/aux/broctl/bin/crash-diag.in
Robin Sommer 2b6ad76bd5 Creating a branch release/1.5 with the current 1.5.3 release code.
This is so that people working from the current stable version can
still start using git.
2011-03-09 15:26:01 -08:00

60 lines
848 B
Bash
Executable file

#! /usr/bin/env bash
#
# $Id: crash-diag.in 6811 2009-07-06 20:41:10Z robin $
#
# crash-diag <cwd>
(
cd $1
if [ -e stderr.log ]; then
echo ==== stderr.log
tail -30 stderr.log
else
echo ==== No stderr.log.
fi
if [ -e stdout.log ]; then
echo ==== stdout.log
tail -30 stdout.log
else
echo ==== No stdout.log.
fi
echo
if [ -e .status ]; then
echo ==== .status
tail -30 .status
else
echo ==== No .status.
fi
echo
if [ -e prof.log ]; then
echo ==== prof.log
tail -30 prof.log
else
echo ==== No prof.log.
fi
echo
core=`ls -t *core* 2>&1`
if which gdb >/dev/null 2>&1; then
for c in $core; do
if [ -e $c ]; then
echo $c
echo "bt" | gdb --batch -x /dev/stdin ${bro} $c
fi
done
else
echo "No gdb installed."
fi
) >.crash-diag.log
cat .crash-diag.log