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 RISCV V support #196

Open RaphaelKlink opened 4 years ago

RaphaelKlink commented 4 years ago

Is there a current or planned support for the RISCV Vector Extension for the gdb part?

jim-wilson commented 4 years ago

No. Someone will eventually volunteer to do the work.

fpedd commented 2 years ago

Have there been any updates since the issue was first opened?

jim-wilson commented 2 years ago

FSF GDB sources have basic support for the vector registers. This was added in June and is in the GDB 11 release. It probably only works with qemu and/or openocd at this time.

We are still lacking ptrace support to read/write vector registers. So a gdb running on a vector linux system won't be able to read/write vector registers. This probably won't happen until people have vector capable hardware running vector capable linux distros.

There will likely be more changes needed after this. For instance, if vector registers are added to ucontext_t, then the signal handler debug support will need support to read vector registers from ucontext_t. The core file debug support will need to be updated to read vector registers from the core dump. Though we need OS support to put them in the core dump file first. The gdbserver port will need vector register support added to it. Etc.

fanghuaqi commented 2 years ago

Is there a branch in this repo to evaluate the feature of support vector register read or write in gdb?

jim-wilson commented 2 years ago

GDB development happens upstream. See https://sourceware.org/gdb/ and use the master branch sources. But vector support is rather limited at this time as I mentioned.

If you want to use this with riscv-gnu-toolchain, you can use the --with-gdb-src= configure option, or you can use git tricks (e.g. git remote).

fanghuaqi commented 2 years ago

Thanks for sharing this info