Jenkins attach GDB and print back trace on failure

This commit is contained in:
Daniel Agar
2021-10-21 12:05:32 -04:00
parent 258cde668c
commit 17328bef69
3 changed files with 71 additions and 76 deletions

View 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}