mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
190683f3e8
causing fort to get rather unhappy
(This used to be commit cc3e15e19c
)
34 lines
527 B
Bash
Executable File
34 lines
527 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ -n "$VALGRIND" -o -n "$SMBD_VALGRIND" ]; then
|
|
echo "Not running gdb under valgrind"
|
|
exit 1
|
|
fi
|
|
|
|
# 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
|
|
|
|
if [ ! -f $PROG ]; then
|
|
PROG=`which $PROG`
|
|
fi
|
|
if [ ! -f $PROG ]; then
|
|
PROG=/proc/$PID/exe
|
|
fi
|
|
if [ ! -f $PROG ]; then
|
|
echo "Unable to find binary"
|
|
exit 1
|
|
fi
|
|
|
|
gdb -batch -x $TMPFILE $PROG $PID < /dev/null
|
|
/bin/rm -f $TMPFILE
|