From 19ee7c3eed01820b4215026363845f7757b15c86 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Thu, 8 Apr 2010 18:50:51 +0200 Subject: [PATCH] First attempt at using mdb on Solaris instead of dbx which isn't standard on most current Solaris versions. --- bacula/scripts/btraceback.in | 6 +++++- bacula/scripts/btraceback.mdb | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 bacula/scripts/btraceback.mdb diff --git a/bacula/scripts/btraceback.in b/bacula/scripts/btraceback.in index 1e7ae9e988..9b9a4882c7 100755 --- a/bacula/scripts/btraceback.in +++ b/bacula/scripts/btraceback.in @@ -14,7 +14,11 @@ PNAME="${PNAME} on `hostname`" WD="$3" if test `uname -s` = SunOS ; then gcore -o ${WD}/${PNAME} $2 - dbx $1 $2 <@scriptdir@/btraceback.dbx >${WD}/bacula.$2.traceback 2>&1 + if [ -x /usr/bin/mdb ]; then + mdb -u -p $2 <@scriptdir@/btraceback.mdb >${WD}/bacula.$2.traceback 2>&1 + else + dbx $1 $2 <@scriptdir@/btraceback.dbx >${WD}/bacula.$2.traceback 2>&1 + fi cat ${WD}/bacula.$2.traceback \ | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@ else diff --git a/bacula/scripts/btraceback.mdb b/bacula/scripts/btraceback.mdb new file mode 100644 index 0000000000..1e3f9aa4ca --- /dev/null +++ b/bacula/scripts/btraceback.mdb @@ -0,0 +1,24 @@ +# btraceback.mdb + +$G +::echo "******** RUNNING LWPS/THREADS:" +::echo +::walk thread + +::echo +::echo +::echo "******** STACK TRACE OF CURRENT LWP:" +::echo +$C + +::echo +::echo +::echo "******** VARIABLES DUMP OF CURRENT LWP:" +::echo + +::echo "******** STACK TRACE OF LWPS:" +::walk thread | ::findstack + +::echo "******** VARIABLES DUMP OF LWPS:" + +::quit -- 2.39.5