ardupilot/Tools/scripts/dumpstack
Peter Barker 392a174e2e Tools: scripts: dumpstack: do not run any gdbinit scripts
Often these scripts look for hardware dongles that may not exist
2019-07-17 14:04:41 +10:00

16 lines
265 B
Bash
Executable File

#!/bin/sh
# we want everything on stderr, so the program is not disturbed
exec 1>&2
PID=$1
TMPFILE=/tmp/gdb.$$
cat << EOF > $TMPFILE
set height 0
bt full
thread apply all bt full
quit
EOF
gdb -n -batch -x $TMPFILE --pid $PID < /dev/null 2>&1
/bin/rm -f $TMPFILE