aboutsummaryrefslogtreecommitdiff
path: root/target/loongarch/gdbstub.c
diff options
context:
space:
mode:
authorJiajie Chen <c@jia.je>2023-08-08 13:42:47 +0800
committerSong Gao <gaosong@loongson.cn>2023-08-24 11:17:59 +0800
commit17ffe331a923c9015887917b27212ab39ff1d8ea (patch)
tree8ae3efa456efe22d4dc5059ff099563f9034e1b0 /target/loongarch/gdbstub.c
parent2948c1fb6b8d806d92394ec358e6ed727e946df9 (diff)
downloadqemu-17ffe331a923c9015887917b27212ab39ff1d8ea.zip
qemu-17ffe331a923c9015887917b27212ab39ff1d8ea.tar.gz
qemu-17ffe331a923c9015887917b27212ab39ff1d8ea.tar.bz2
target/loongarch: Split fcc register to fcc0-7 in gdbstub
Since GDB 13.1(GDB commit ea3352172), GDB LoongArch changed to use fcc0-7 instead of fcc register. This commit partially reverts commit 2f149c759 (`target/loongarch: Update gdb_set_fpu() and gdb_get_fpu()`) to match the behavior of GDB. Note that it is a breaking change for GDB 13.0 or earlier, but it is also required for GDB 13.1 or later to work. Signed-off-by: Jiajie Chen <c@jia.je> Acked-by: Song Gao <gaosong@loongson.cn> Message-Id: <20230808054315.3391465-1-c@jia.je> Signed-off-by: Song Gao <gaosong@loongson.cn>
Diffstat (limited to 'target/loongarch/gdbstub.c')
-rw-r--r--target/loongarch/gdbstub.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c
index e20b20f..b09804b 100644
--- a/target/loongarch/gdbstub.c
+++ b/target/loongarch/gdbstub.c
@@ -88,10 +88,9 @@ static int loongarch_gdb_get_fpu(CPULoongArchState *env,
{
if (0 <= n && n < 32) {
return gdb_get_reg64(mem_buf, env->fpr[n].vreg.D(0));
- } else if (n == 32) {
- uint64_t val = read_fcc(env);
- return gdb_get_reg64(mem_buf, val);
- } else if (n == 33) {
+ } else if (32 <= n && n < 40) {
+ return gdb_get_reg8(mem_buf, env->cf[n - 32]);
+ } else if (n == 40) {
return gdb_get_reg32(mem_buf, env->fcsr0);
}
return 0;
@@ -105,11 +104,10 @@ static int loongarch_gdb_set_fpu(CPULoongArchState *env,
if (0 <= n && n < 32) {
env->fpr[n].vreg.D(0) = ldq_p(mem_buf);
length = 8;
- } else if (n == 32) {
- uint64_t val = ldq_p(mem_buf);
- write_fcc(env, val);
- length = 8;
- } else if (n == 33) {
+ } else if (32 <= n && n < 40) {
+ env->cf[n - 32] = ldub_p(mem_buf);
+ length = 1;
+ } else if (n == 40) {
env->fcsr0 = ldl_p(mem_buf);
length = 4;
}