From 45e8a27d984d3d75ba8ebca1ef3522b2f0fb3d4d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 17 Apr 2007 15:55:08 +0000 Subject: 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) --- source4/main.mk | 6 +++--- source4/script/gdb_run | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 source4/script/gdb_run diff --git a/source4/main.mk b/source4/main.mk index fe68db1526..4084d7ba4b 100644 --- a/source4/main.mk +++ b/source4/main.mk @@ -330,15 +330,15 @@ valgrindtest-env: everything gdbtest: gdbtest-quick gdbtest-quick: all - SMBD_VALGRIND="xterm -n smbd -e gdb --args " \ + SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \ $(SELFTEST) --immediate --quick --socket-wrapper gdbtest-all: everything - SMBD_VALGRIND="xterm -n smbd -e gdb --args " \ + SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \ $(SELFTEST) --immediate --socket-wrapper gdbtest-env: everything - SMBD_VALGRIND="xterm -n smbd -e gdb --args " \ + SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \ $(SELFTEST) --socket-wrapper --testenv wintest: all 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" -- cgit