From e8a8f16a65a318c7e9364335d1ce721aba8585e7 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 21 Apr 2010 09:31:16 +0200 Subject: [PATCH] Allow traceback with gdb on Solaris --- bacula/scripts/btraceback.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bacula/scripts/btraceback.in b/bacula/scripts/btraceback.in index 959ce1544e..a9ab1a58e5 100755 --- a/bacula/scripts/btraceback.in +++ b/bacula/scripts/btraceback.in @@ -11,12 +11,15 @@ # PNAME=`basename $1` WD="$3" +GDB=`which gdb` if test `uname -s` = SunOS ; then gcore -o ${WD}/${PNAME} $2 if [ -x /usr/bin/mdb ]; then mdb -u -p $2 <@scriptdir@/btraceback.mdb >${WD}/bacula.$2.traceback 2>&1 - else + elif [ -x /usr/bin/dbx ]; then dbx $1 $2 <@scriptdir@/btraceback.dbx >${WD}/bacula.$2.traceback 2>&1 + elif [ "x${GDB}" != "x" ]; then + gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 >${WD}/bacula.$2.traceback 2>&1 fi PNAME="${PNAME} on `hostname`" cat ${WD}/bacula.$2.traceback \ -- 2.39.5