summaryrefslogtreecommitdiff
path: root/selftest/gdb_backtrace
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-11-28 13:53:40 +0300
committerMatthieu Patou <mat@samba.org>2010-11-28 13:32:21 +0100
commit7e2b315ca0f228b617adc7769f3880a8aabd5d67 (patch)
treeb51a3ef94d11bf315445bacb15ab772d8081fc4d /selftest/gdb_backtrace
parent736d36a9487336ca8bc47fba4c7565f9d37e06c5 (diff)
downloadsamba-7e2b315ca0f228b617adc7769f3880a8aabd5d67.tar.gz
add handling for solaris
Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Sun Nov 28 13:32:21 CET 2010 on sn-devel-104
Diffstat (limited to 'selftest/gdb_backtrace')
-rwxr-xr-xselftest/gdb_backtrace12
1 files changed, 11 insertions, 1 deletions
diff --git a/selftest/gdb_backtrace b/selftest/gdb_backtrace
index 1d8249b08a0..5a7d2307bd4 100755
--- a/selftest/gdb_backtrace
+++ b/selftest/gdb_backtrace
@@ -30,6 +30,12 @@ case "${UNAME}" in
OSF1)
DB_LIST="ladebug ${DB_LIST}"
;;
+ #
+ # On solaris dbx is working way more better than gdb
+ # let's try it first
+ #
+ SunOS)
+ DB_LIST="dbx ${DB_LIST}"
esac
for DB in ${DB_LIST}; do
@@ -45,12 +51,13 @@ test x"${DB_BIN}" = x"" && {
}
#
-# we first try to use /proc/${PID}/exe
+# we first try to use /proc/${PID}/exe or /proc/{$PID}/path for solaris
# then fallback to the binary from the commandline
# then we search for the commandline argument with
# 'which'
#
test -f "/proc/${PID}/exe" && BINARY="/proc/${PID}/exe"
+test -f "/proc/${PID}/path/a.out" && BINARY=`ls -l /proc/${PID}/path/a.out |sed 's/.*-> //'`
test x"${BINARY}" = x"" && BINARY="/proc/${PID}/exe"
test -f "${BINARY}" || BINARY=`which ${BINARY}`
@@ -84,5 +91,8 @@ quit
EOF
${DB_BIN} -x "${BATCHFILE_MAIN}" "${BINARY}" "${PID}"
;;
+dbx)
+ ${DB_BIN} "where;dump;kill;quit" "${BINARY}" "${PID}"
+ ;;
esac
/bin/rm -f ${BATCHFILE_PRE} ${BATCHFILE_MAIN}