PX4-Autopilot/platforms/nuttx/Debug/jlink_debug_gdb.sh.in
Daniel Agar f63a7642d6 NuttX debug helper improvements
- use NuttX gdb script for nxthreads and thread backtrace
 - update jlink_gdb_backtrace and jlink_debug_gdb helper targets to use
NuttX gdb script
 - Debug/PX4 fix "perf" divide by zero
 - Debug/PX4 add "dmesg"
2021-12-05 19:18:56 -05:00

30 lines
752 B
Bash
Executable File

#! /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
@JLinkGDBServerExe_PATH@ -device @DEBUG_DEVICE@ -select usb -endian little -if SWD -speed auto -ir -LocalhostOnly 1 -strict -vd -singlerun &
cd @PX4_BINARY_DIR@ && ${GDB_CMD} -silent -nh \
-iex "set auto-load safe-path @PX4_BINARY_DIR@" \
-ix=@PX4_SOURCE_DIR@/platforms/nuttx/NuttX/nuttx/tools/nuttx-gdbinit \
-ex "target remote localhost:2331" \
-ex "monitor reset 0" \
-ex "load" \
-ex "monitor reset 0" \
-ex "continue" \
@PX4_CONFIG@.elf
# exit with status of last command
exit $?