riscvarchive / riscv-binutils-gdb

RISC-V backports for binutils-gdb. Development is done upstream at the FSF.
GNU General Public License v2.0
148 stars 233 forks source link

GDB Single Step fails on RISCV, EL2 with ICCM #270

Open jamesbbecker opened 2 years ago

jamesbbecker commented 2 years ago

Hello, I have a EL2 design running on an fpga (Nexys A7). I have a jtag controller running with openocd, with gdb connected via port 3333 on the openocd server. My EL2 design has two code memories designed in. One can handle 2-byte and single byte reads, the other (called ICCM) can only handle 4 byte word reads. When I have code running in the first memory, everything works fine - single step, breakpoints, etc. When I have code running in the ICCM memory, breakpoints work, but single stepping does not. Looking at the debug output of openocd, it appears that gdb is requesting a 2-byte read from the memory when a single step is requested. Since my memory can't handle a 2-byte read, it fails and the failure is sent all the way back to gdb. Since it is gdb which is requesting the two-byte read, I'm assuming its a gdb problem. I looked around but couldn't find an openocd setting to solve the problem.

kito-cheng commented 2 years ago

I would suggest you can send mail to gdb mailing list since that is seems like a gdb specific question, so I guess you can get more feedback from gdb expert there.

https://sourceware.org/mailman/listinfo/gdb/