NuttX cmake small debug helper improvements

This commit is contained in:
Daniel Agar
2019-11-18 10:29:00 -05:00
parent 30fcb14156
commit a7fbaefd83
10 changed files with 87 additions and 44 deletions
+2
View File
@@ -14,6 +14,8 @@ set print pretty
set pagination off
set history save on
set history filename ~/.gdb_history
set history size unlimited
set history expansion on
set logging on
+14
View File
@@ -0,0 +1,14 @@
#! /bin/sh
set -o xtrace
@JLinkGDBServerExe_PATH@ -device @DEBUG_DEVICE@ -select usb -endian little -if SWD -speed auto -ir -LocalhostOnly 1 -strict -vd -singlerun &
cd @PX4_BINARY_DIR@ && @CMAKE_GDB@ -silent -nh \
-iex "set auto-load safe-path @PX4_BINARY_DIR@" \
-ex "target remote localhost:2331" \
-ex "monitor reset 0" \
-ex "load" \
-ex "monitor reset 0" \
-ex "continue" \
@PX4_CONFIG@.elf
+5
View File
@@ -0,0 +1,5 @@
#! /bin/sh
set -o xtrace
@Ozone_PATH@ -device @DEBUG_DEVICE@ -if SWD -speed auto -select usb -programfile @PX4_BINARY_DIR@/@PX4_CONFIG@.elf
-7
View File
@@ -1,7 +0,0 @@
#! /bin/sh
killall JLinkGDBServerCLExe
# TODO: set device from nuttx config
# eg CONFIG_ARCH_CHIP_STM32F427V or CONFIG_STM32_STM32F427
JLinkGDBServerCLExe -device STM32F427II -select usb -silent -endian little -if SWD -speed auto -ir -LocalhostOnly 1 -strict -vd -singlerun &
+7
View File
@@ -0,0 +1,7 @@
#! /bin/sh
set -o xtrace
killall JLinkGDBServerCLExe
JLinkGDBServerCLExe -silent -device @DEBUG_DEVICE@ -select usb -if SWD -speed auto -LocalhostOnly 1 -strict -vd -singlerun &
+1
View File
@@ -10,6 +10,7 @@
"type": "cortex-debug",
"servertype": "jlink",
"interface": "swd",
//"ipAddress": "server:19020",
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
"preLaunchCommands": [
@@ -1,12 +1,14 @@
#! /bin/sh
gdb-multiarch -nx -batch \
set -o xtrace
gdb-multiarch -silent -nx -batch \
-ex "target remote localhost:2331" \
-ex "monitor reset 0" \
-ex "load" \
-ex "compare-sections" \
-ex "monitor reset 0" \
-ex "monitor sleep 1000" \
-ex "monitor go" \
-ex "kill" \
-ex "monitor sleep 3000" \
-ex "disconnect" \
-ex "quit" \
${1}