summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-21 12:11:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:53 -0500
commita369f0ecaf35fb49652873c4c1ddcaf28629c26e (patch)
tree1a7336cb6826733d19fc5744e753c558a8ba9148 /source4/script
parentf8c1258d01fa631b719579e186b28027a34887cf (diff)
downloadsamba-a369f0ecaf35fb49652873c4c1ddcaf28629c26e.tar.gz
samba-a369f0ecaf35fb49652873c4c1ddcaf28629c26e.tar.bz2
samba-a369f0ecaf35fb49652873c4c1ddcaf28629c26e.zip
r8678: setup for gdb backtrace in 'make test'
(This used to be commit acf8c8fd4995acef47390df5a7d4e611c597367d)
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/gdb_backtrace17
-rwxr-xr-xsource4/script/tests/selftest.sh1
2 files changed, 18 insertions, 0 deletions
diff --git a/source4/script/gdb_backtrace b/source4/script/gdb_backtrace
new file mode 100755
index 0000000000..0ba8c0eaad
--- /dev/null
+++ b/source4/script/gdb_backtrace
@@ -0,0 +1,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
diff --git a/source4/script/tests/selftest.sh b/source4/script/tests/selftest.sh
index 3f1bea75f1..673e6a06a8 100755
--- a/source4/script/tests/selftest.sh
+++ b/source4/script/tests/selftest.sh
@@ -92,6 +92,7 @@ cat >$CONFFILE<<EOF
name resolve order = bcast
interfaces = lo*
tls enabled = $TLS_ENABLED
+ panic action = $SRCDIR/script/gdb_backtrace %PID% %PROG%
[tmp]
path = $TMPDIR