Debug Spike with GDB and OpenOCD
masterTo use GDB for debugging, you must use OpenOCD to bridge the connection.
Run Spike with Remote Bitbang: Start Spike listening on a specific port (e.g., 9824) and map a memory range:
$ spike --rbb-port=9824 -m0x10000:0x20000 rot13Run OpenOCD: Create a
spike.cfgfile to configure the remote bitbang adapter and target, then run:$ openocd -f spike.cfgRun GDB: Start your RISC-V GDB session and connect to the OpenOCD server:
$ riscv64-unknown-elf-gdb rot13 (gdb) target extended-remote localhost:3333 (gdb) load
$ spike --rbb-port=9824 -m0x10000:0x20000 rot13
$ openocd -f spike.cfg
$ riscv64-unknown-elf-gdb rot13