]> git.sur5r.net Git - bacula/bacula/commitdiff
Allow traceback with gdb on Solaris
authorKern Sibbald <kern@sibbald.com>
Wed, 21 Apr 2010 07:31:16 +0000 (09:31 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:53:43 +0000 (16:53 +0200)
bacula/scripts/btraceback.in

index 959ce1544edbac2c97b0f82547adbbc7c1d15135..a9ab1a58e5ce8c2ce72d14b3b0382e20f466d5e5 100755 (executable)
 #
 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 \