summaryrefslogtreecommitdiff
path: root/source4/script/gdb_run
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-17 15:55:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:01 -0500
commit45e8a27d984d3d75ba8ebca1ef3522b2f0fb3d4d (patch)
tree1a26d98c3dae1c48aeab297499a3a24f6e0efb45 /source4/script/gdb_run
parentcc098d19bc3df836cceb78cb6463eb1b59e93e36 (diff)
downloadsamba-45e8a27d984d3d75ba8ebca1ef3522b2f0fb3d4d.tar.gz
samba-45e8a27d984d3d75ba8ebca1ef3522b2f0fb3d4d.tar.bz2
samba-45e8a27d984d3d75ba8ebca1ef3522b2f0fb3d4d.zip
r22312: avoid the need of typing 'run' into each gdb xterm
if someone knows how to tell gdb to only exit if 'run' exists clean via the if/else logic please tell me! see http://davis.lbl.gov/Manuals/GDB/gdb_20.html#SEC194) but there's no useful example :-( metze (This used to be commit 4a95e893087e6e3194cd18289a9bf019d0f0abde)
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"