summaryrefslogtreecommitdiff
path: root/source4/script/gdb_run
diff options
context:
space:
mode:
Diffstat (limited to 'source4/script/gdb_run')
-rwxr-xr-xsource4/script/gdb_run17
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/script/gdb_run b/source4/script/gdb_run
new file mode 100755
index 0000000000..bfefce1ac9
--- /dev/null
+++ b/source4/script/gdb_run
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if test -z "$TMPDIR"; then
+ TMPDIR="/tmp"
+fi
+
+TMPFILE=$TMPDIR/gdb_run.$$
+cat << EOF > $TMPFILE
+run
+bt
+quit
+EOF
+
+trap "/bin/rm -f $TMPFILE" EXIT
+CMD="gdb -x $TMPFILE --args $@"
+echo $CMD
+eval "$CMD"