aboutsummaryrefslogtreecommitdiff
path: root/home/dot_local/share/bin/executable_dbg
diff options
context:
space:
mode:
Diffstat (limited to 'home/dot_local/share/bin/executable_dbg')
-rw-r--r--home/dot_local/share/bin/executable_dbg27
1 files changed, 27 insertions, 0 deletions
diff --git a/home/dot_local/share/bin/executable_dbg b/home/dot_local/share/bin/executable_dbg
new file mode 100644
index 0000000..d042ba5
--- /dev/null
+++ b/home/dot_local/share/bin/executable_dbg
@@ -0,0 +1,27 @@
+#!/bin/sh
+GDB="arm-none-eabi-gdb"
+
+found_executable=false
+
+while ! $found_executable ; do
+ [ ! -e build/zephyr ] && break
+ [ ! -e build/zephyr/zephyr.elf ] && break
+ set -- --se="build/zephyr/zephyr.elf" "$@"
+
+ [ -e build/tfm/bin/tfm_s.elf ] && set -- "$@" --eval-command="add-symbol-file build/tfm/bin/tfm_s.elf"
+
+ found_executable=true
+done
+
+while ! $found_executable ; do
+ exec="$(find . -maxdepth 3 -name '*.elf' | head -n1)"
+ [ -n "$exec" ] && set -- "$@" --se="$exec"
+ found_executable=true
+ break
+done
+
+set -- "$@" --eval-command="set jlink autoconnect on"
+set -- "$@" --eval-command="set jlink watchdog on"
+
+exec "$GDB" "$@"
+