1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/selftest/gdb_run
Stefan Metzmacher e952a127d6 selftest/gdb_*: make use of 'mktemp'
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01 05:54:21 +01:00

22 lines
271 B
Bash
Executable File

#!/bin/sh
ENV="$1"
shift 1
TMPFILE=`mktemp --tmpdir gdb_run.XXXXXXXXXX`
test -n "${TMPFILE}" || {
echo "mktemp doesn't work" 1>&2
exit 1
}
cat << EOF > $TMPFILE
run
bt
EOF
trap "/bin/rm -f $TMPFILE" EXIT
CMD="gdb -x $TMPFILE --args $@"
echo $CMD
eval $ENV "$CMD"