3
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; version 2 of the License.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
# Does not work on Windows (gcc only)
19
if [ `uname | grep -ic cygwin || true` -ne 0 ]
32
if [ -f `dirname $core`/env.sh ]
34
. `dirname $core`/env.sh
40
bt=`dirname $core`/bt.gdb
41
echo "thread apply all bt" > $bt
49
out=`dirname $core`/bt.txt
60
tmp=`echo ${core}.tmp`
61
gdb -c $core -x $bt -q 2>&1 | grep "Core was generated" | awk '{ print $5;}' | sed 's!`!!' | sed `echo "s/'\.//"` > $tmp
67
echo "*** $exe - $core" >> $out
68
gdb -q -batch -x $bt -c $core $exe >> $out 2>&1
69
elif [ -x "`which $exe 2> /dev/null`" ]
72
echo "*** $exe - $core" >> $out
73
gdb -q -batch -x $bt -c $core $exe >> $out 2>&1
75
echo "*** $core : cant find exe: $exe" >> $out