aboutsummaryrefslogtreecommitdiff
path: root/home/dot_local/share/bin/executable_dbg
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2026-08-02 14:48:29 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2026-08-02 14:48:29 +0200
commite43eb1177872f52e949fb5f0f93396ed94b0d093 (patch)
tree78b73af6a989fa2996d71b112e161b70d35081ef /home/dot_local/share/bin/executable_dbg
parent2f14a896e4b897bd747c24d7ad8e9e7bb3237d03 (diff)
move to chezmoi
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" "$@"
+