summaryrefslogtreecommitdiff
path: root/source4/script/gdb_backtrace
blob: 0ba8c0eaad1b3923b4bbc0a2159beedf255a88e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# we want everything on stderr, so the program is not disturbed
exec 1>&2

PID=$1
PROG=$2

TMPFILE=/tmp/gdb.$$
cat << EOF  > $TMPFILE
set height 1000
bt full
quit
EOF

gdb -batch -x $TMPFILE $PROG $PID < /dev/null 
/bin/rm -f $TMPFILE