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/dumpcore.sh
Views: 1798
1
#!/bin/sh
2
3
# attaches GDB to a process to dump a core
4
5
# we want everything on stderr, so the program is not disturbed
6
exec 1>&2
7
8
PID=$1
9
TMPFILE=/tmp/gdb.$$
10
COREFILE="ap-$$.core"
11
cat << EOF > $TMPFILE
12
set height 0
13
generate-core-file $COREFILE
14
quit
15
EOF
16
gdb -n -batch -x $TMPFILE --pid $PID < /dev/null 2>&1
17
/bin/rm -f $TMPFILE
18
19