summaryrefslogtreecommitdiff
path: root/blink/build/gdbinit
diff options
context:
space:
mode:
authorpants <niklasjo2004@gmail.com>2026-09-21 14:16:49 -0700
committerpants <niklasjo2004@gmail.com>2026-09-21 14:16:49 -0700
commita203dd13618db523d38daca82c608b285bc21c8f (patch)
tree4a2cfc861248415d07f7c834557d36224ec00694 /blink/build/gdbinit
Diffstat (limited to 'blink/build/gdbinit')
-rw-r--r--blink/build/gdbinit/connect7
-rw-r--r--blink/build/gdbinit/gdbinit2
-rw-r--r--blink/build/gdbinit/prefix_map1
-rw-r--r--blink/build/gdbinit/py_extensions7
-rw-r--r--blink/build/gdbinit/symbols25
5 files changed, 42 insertions, 0 deletions
diff --git a/blink/build/gdbinit/connect b/blink/build/gdbinit/connect
new file mode 100644
index 0000000..faa3857
--- /dev/null
+++ b/blink/build/gdbinit/connect
@@ -0,0 +1,7 @@
+# Connect to the default openocd-esp port and stop on app_main()
+set remotetimeout 10
+target remote :3333
+monitor reset halt
+maintenance flush register-cache
+thbreak app_main
+continue
diff --git a/blink/build/gdbinit/gdbinit b/blink/build/gdbinit/gdbinit
new file mode 100644
index 0000000..ac8ff2a
--- /dev/null
+++ b/blink/build/gdbinit/gdbinit
@@ -0,0 +1,2 @@
+source /home/nik/repos/esp32/blink/build/gdbinit/symbols
+source /home/nik/repos/esp32/blink/build/gdbinit/connect
diff --git a/blink/build/gdbinit/prefix_map b/blink/build/gdbinit/prefix_map
new file mode 100644
index 0000000..c7842ec
--- /dev/null
+++ b/blink/build/gdbinit/prefix_map
@@ -0,0 +1 @@
+# There is no prefix map defined for the project.
diff --git a/blink/build/gdbinit/py_extensions b/blink/build/gdbinit/py_extensions
new file mode 100644
index 0000000..336f995
--- /dev/null
+++ b/blink/build/gdbinit/py_extensions
@@ -0,0 +1,7 @@
+# Add Python GDB extensions
+python
+try:
+ import freertos_gdb
+except ModuleNotFoundError:
+ print('warning: python extension "freertos_gdb" not found.')
+end
diff --git a/blink/build/gdbinit/symbols b/blink/build/gdbinit/symbols
new file mode 100644
index 0000000..a808fdd
--- /dev/null
+++ b/blink/build/gdbinit/symbols
@@ -0,0 +1,25 @@
+# Load esp32 ROM ELF symbols
+define target hookpost-remote
+set confirm off
+ # if $_streq((char *) 0x3ff9ea80, "Jun 8 2016")
+ if (*(int*) 0x3ff9ea80) == 0x206e754a && (*(int*) 0x3ff9ea84) == 0x32203820 && (*(int*) 0x3ff9ea88) == 0x363130
+ add-symbol-file /home/nik/.espressif/tools/esp-rom-elfs/20241011/esp32_rev0_rom.elf
+ else
+ # if $_streq((char *) 0x3ff9e986, "Jul 29 2019")
+ if (*(int*) 0x3ff9e986) == 0x206c754a && (*(int*) 0x3ff9e98a) == 0x32203932 && (*(int*) 0x3ff9e98e) == 0x393130
+ add-symbol-file /home/nik/.espressif/tools/esp-rom-elfs/20241011/esp32_rev300_rom.elf
+ else
+ echo Warning: Unknown esp32 ROM revision.\n
+ end
+ end
+set confirm on
+end
+
+
+# Load bootloader symbols
+set confirm off
+ add-symbol-file /home/nik/repos/esp32/blink/build/bootloader/bootloader.elf
+set confirm on
+
+# Load application symbols
+file /home/nik/repos/esp32/blink/build/blink.elf