riscvarchive / riscv-binutils-gdb

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

GDB: single step on "j ." #169

Open elinsky-cloudbear opened 5 years ago

elinsky-cloudbear commented 5 years ago

I tried to do single step on "j .". This causes infinite message exchange between GDB and OpenOCD. It looks like GDB is not satisfied that $pc is not changed after single step completion. Please, see log below.

Breakpoint 1, main () at ../src/main.c:27 27 while(1); (gdb) disable 1 (gdb) s Sending packet: $g#67...Packet received: 00000000e60a0080b0ff0180f018008000000000cc0a00800000000000000000e0ff018000000000f01000800000000000000000d0ff018012111111050000001f0000000000000000000000000000002011008000000000e0e60100000000000000000000000000000000000000000000000000000000000000000000000000 Sending packet: $vCont;s:1;c#c1...Packet received: S05 Sending packet: $p20#d2...Packet received: 040c0080 Sending packet: $vCont;s:1;c#c1...Packet received: S05 Sending packet: $p20#d2...Packet received: 040c0080 Sending packet: $vCont;s:1;c#c1...Packet received: S05 Sending packet: $p20#d2...Packet received: 040c0080 Sending packet: $vCont;s:1;c#c1...Packet received: S05 Sending packet: $p20#d2...Packet received: 040c0080

And so on.

jim-wilson commented 5 years ago

It works correctly using gdb on a Fedora linux system running on the HiFive Unleashed. It works correctly using gdb connected to a system qemu with machine sifive_e via target remote. Unfortunately I don't know how to use openocd, but I am skeptical that this is a gdb problem, unless perhaps you are using an old obsolete gdb version. I'm using the current riscv/riscv-gnu-toolchain riscv-gdb which is gdb-8.2.50 (gdb-8.3 prerelease).