The current RISCV gdb support only allows access to a limited amount of CSRs. Since people will presumably use CSRs for custom features, there needs to be a way to access every CSR regardless of whether gdb actually knows what it's used for.
I can think of two possible implementations:
1. Add a named register for each CSR (eg. csr0, csr1, ..., csr4095). I'm not sure how nicely this plays with gdb's implementation. It may be necessary to grow the register cache to hold every one of those registers. (Admittedly on modern hosts 32KB isn't much RAM.)
2. Add a separate command to access CSRs, eg. "csrr 5" to read CSR 5, and "csrw 5 0xdead" to write 0xdead to CSR 5.
Does anybody have any opinions on this matter?
Tim