summaryrefslogtreecommitdiff
path: root/source4/script/gdb_backtrace
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-06 17:55:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:43 -0500
commit9db9ce6087d93d9d8b7d262b9df3b81ae624181c (patch)
tree351f612c7070f6f6acc2c4b7ecfe1b71af06fb93 /source4/script/gdb_backtrace
parent47f90dde40cf1e31ebc570af315f7fb9f78cd79f (diff)
downloadsamba-9db9ce6087d93d9d8b7d262b9df3b81ae624181c.tar.gz
samba-9db9ce6087d93d9d8b7d262b9df3b81ae624181c.tar.bz2
samba-9db9ce6087d93d9d8b7d262b9df3b81ae624181c.zip
r19149: ladebug needs to have the stoponattach flag set
to generate the current backtrace without waiting for a signal... metze (This used to be commit d86100289a3a857456e2d4441c290ca2ea2330ff)
Diffstat (limited to 'source4/script/gdb_backtrace')
-rwxr-xr-xsource4/script/gdb_backtrace17
1 files changed, 11 insertions, 6 deletions
diff --git a/source4/script/gdb_backtrace b/source4/script/gdb_backtrace
index 0e593764ff..b19a5b2f4b 100755
--- a/source4/script/gdb_backtrace
+++ b/source4/script/gdb_backtrace
@@ -61,22 +61,27 @@ test -f "${BINARY}" || {
echo "${BASENAME}: Trying to use ${DB_BIN} on ${BINARY} on PID ${PID}"
-BATCHFILE=/tmp/gdb_backtrace.$$
+BATCHFILE_PRE=/tmp/gdb_backtrace_pre.$$
+BATCHFILE_MAIN=/tmp/gdb_backtrace_main.$$
case "${DB}" in
ladebug)
-cat << EOF > ${BATCHFILE}
+cat << EOF > ${BATCHFILE_PRE}
+set \$stoponattach
+EOF
+
+cat << EOF > ${BATCHFILE_MAIN}
where
quit
EOF
- ${DB_BIN} -c "${BATCHFILE}" -pid "${PID}" "${BINARY}"
+ ${DB_BIN} -c "${BATCHFILE_MAIN}" -i "${BATCHFILE_PRE}" -pid "${PID}" "${BINARY}"
;;
gdb)
-cat << EOF > ${BATCHFILE}
+cat << EOF > ${BATCHFILE_MAIN}
set height 1000
bt full
quit
EOF
- ${DB_BIN} -x "${BATCHFILE}" "${BINARY}" "${PID}"
+ ${DB_BIN} -x "${BATCHFILE_MAIN}" "${BINARY}" "${PID}"
;;
esac
-/bin/rm -f ${BATCHFILE}
+/bin/rm -f ${BATCHFILE_PRE} ${BATCHFILE_MAIN}