mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
Tools: scripts: add dumpstack
Given a pid this script attempts to dump a stack trace of that process to stderr
This commit is contained in:
parent
e061df0f6d
commit
5f018d0798
15
Tools/scripts/dumpstack
Executable file
15
Tools/scripts/dumpstack
Executable file
@ -0,0 +1,15 @@
|
||||
#!/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 -batch -x $TMPFILE --pid $PID < /dev/null 2>&1
|
||||
/bin/rm -f $TMPFILE
|
Loading…
Reference in New Issue
Block a user