1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/selftest/gdb_run
Andreas Schneider 1399b2430a selftest: Reformat shell scripts
shfmt -f selftest/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-03 00:59:34 +00:00

22 lines
269 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"