]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/riscv: Tell gdbstub the correct number of CSRs
authorJonathan Behrens <jonathan@fintelia.io>
Mon, 14 Oct 2019 15:45:27 +0000 (11:45 -0400)
committerPalmer Dabbelt <palmer@sifive.com>
Mon, 28 Oct 2019 14:47:28 +0000 (07:47 -0700)
If the number of registers reported to the gdbstub code does not match the
number in the associated XML file, then the register numbers used by the stub
may get out of sync with a remote GDB instance.

Signed-off-by: Jonathan Behrens <jonathan@fintelia.io>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
target/riscv/gdbstub.c

index ded140e8d8691885ef18beb56f5977b0b6a43c41..cb5bfd3d50dda2823271feea4eeccc442f2f41af 100644 (file)
@@ -384,7 +384,7 @@ void riscv_cpu_register_gdb_regs_for_features(CPUState *cs)
     }
 
     gdb_register_coprocessor(cs, riscv_gdb_get_csr, riscv_gdb_set_csr,
-                             4096, "riscv-32bit-csr.xml", 0);
+                             240, "riscv-32bit-csr.xml", 0);
 #elif defined(TARGET_RISCV64)
     if (env->misa & RVF) {
         gdb_register_coprocessor(cs, riscv_gdb_get_fpu, riscv_gdb_set_fpu,
@@ -392,6 +392,6 @@ void riscv_cpu_register_gdb_regs_for_features(CPUState *cs)
     }
 
     gdb_register_coprocessor(cs, riscv_gdb_get_csr, riscv_gdb_set_csr,
-                             4096, "riscv-64bit-csr.xml", 0);
+                             240, "riscv-64bit-csr.xml", 0);
 #endif
 }