On 1/4/22 7:51 AM, Konrad Schwarz wrote:
+++ b/target/riscv/csr32-op-gdbserver.h
...
+++ b/target/riscv/csr64-op-gdbserver.h

There is a *lot* of overlap between these two files.
Why not add this data to the main csr_ops array?
That would put all the info for each csr in one place.

+  [CSR_CYCLE] { .gdb_type = "uint64", .gdb_group = "user" },

I think you should be able to use "unsigned long" as a proxy for the native 
register size.

+char const riscv_gdb_csr_types[] =
+#ifdef TARGET_RISCV32
...
+#elif defined TARGET_RISCV64
...
+# endif
+;

Ideally we shouldn't use ifdefs for this -- we should choose one or the other depending on the startup env->misa_mxl_max. We are still using an ifdef for the main riscv-*-virtual.xml, but that could be considered a bug to fix.


r~

Reply via email to