This is Gdb 7.6.2, circa 2013 -- but it works!
Gdb for x86 on my desktop is 13.2.3, circa 2023.
There is also something called "gdbtui" (or gdb-tui) that was once distributed as part of gdb. I no longer see this on my system.
Here is an article about using GDB and openocd to debug rust programs for the Pi Pico.
The "rust" page launches GDB via this command line:arm-none-eabi-gdb -q -ex "target extended-remote :3333" target/thumbv6m-none-eabi/debug/rp2040-project-templateThe -q switch suppresses the version and copyright messages.
Some of my old notes suggest that you can use the following command to load an image (via openocd) into flash (this is for the blue pill).
flash write_image erase blink.bin 0x08000000
openocd -f interface/cmsis-dap.cfg -c "adapter speed 5000" -f target/rp2040.cfg -s tclSo, what is the "-s tcl" about. This adds the "tcl" directory to the openocd search path. I am not sure why this is useful, and it is probably something I can omit.
I leave this running in one text window and go to another and launch gdb:
arm-none-eabi-gdb blink.elf (gdb) target remote localhost:3333 Remote debugging using localhost:3333 0x20041f2c in ?? ()Aha! That seems like a nice start. A message in the openocd window says:
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
Now I follow along with the openocd Howto above:
load Loading section .text, size 0x4c lma 0xdeadbef0 Start address 0xdeadbef0, load size 76 Transfer rate: 608 bits in <1 sec, 76 bytes/write. (gdb) monitor reset init [rp2040.core0] halted due to debug-request, current mode: Thread xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00 [rp2040.core1] halted due to debug-request, current mode: Thread xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00 continueAnd my demo begins blinking the LED. This is my assembly language LED blink demo which is only 76 bytes in size and which only has a text segment. Note that since I didn't set a breakpoint, I no longer have a gdb prompt.
Tom's electronics pages / [email protected]