CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/scripts/dumpstack.sh
Views: 1798
1
#!/bin/sh
2
3
# we want everything on stderr, so the program is not disturbed
4
exec 1>&2
5
6
PID=$1
7
TMPFILE=/tmp/gdb.$$
8
cat << EOF > $TMPFILE
9
set height 0
10
bt full
11
thread apply all bt full
12
quit
13
EOF
14
gdb -n -batch -x $TMPFILE --pid $PID < /dev/null 2>&1
15
/bin/rm -f $TMPFILE
16
17