mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-09-26 04:38:19 +08:00
Jenkins attach GDB and print back trace on failure
This commit is contained in:
41
platforms/nuttx/Debug/jlink_gdb_backtrace.sh
Executable file
41
platforms/nuttx/Debug/jlink_gdb_backtrace.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#! /bin/sh
|
||||
|
||||
if command -v gdb-multiarch &> /dev/null
|
||||
then
|
||||
GDB_CMD=$(command -v gdb-multiarch)
|
||||
|
||||
elif command -v arm-none-eabi-gdb &> /dev/null
|
||||
then
|
||||
GDB_CMD=$(command -v arm-none-eabi-gdb)
|
||||
|
||||
else
|
||||
echo "gdb arm-none-eabi or multi-arch not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
file ${1}
|
||||
|
||||
gdb_cmd_file=$(mktemp)
|
||||
|
||||
cat >"${gdb_cmd_file}" <<EOL
|
||||
|
||||
source ${WORKSPACE}/platforms/nuttx/Debug/NuttX
|
||||
source ${WORKSPACE}/platforms/nuttx/Debug/ARMv7M
|
||||
|
||||
target remote localhost:2331
|
||||
|
||||
monitor regs
|
||||
|
||||
showtasks
|
||||
|
||||
vecstate
|
||||
|
||||
info threads
|
||||
|
||||
backtrace
|
||||
|
||||
bt full
|
||||
|
||||
EOL
|
||||
|
||||
${GDB_CMD} -silent --nh --nx --nw -batch -x ${gdb_cmd_file} ${1}
|
||||
Reference in New Issue
Block a user