aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorHui Li <lihui@loongson.cn>2023-07-06 11:22:37 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2023-07-19 22:00:03 +0800
commitfc07c81340b8e8fdd4fa225231d96a84cff77f19 (patch)
tree1db10ba7c6553458c4722daa98b6d4586b2c6fbb /gdb
parent6d30ada87b7a515a0f623687e2faadc1d4acf440 (diff)
downloadgdb-fc07c81340b8e8fdd4fa225231d96a84cff77f19.zip
gdb-fc07c81340b8e8fdd4fa225231d96a84cff77f19.tar.gz
gdb-fc07c81340b8e8fdd4fa225231d96a84cff77f19.tar.bz2
gdb: LoongArch: Update status of the entire regset in regcache
In the current code, when a register is fetched, the entire regset are fetched via ptrace, but only this register status is updated in regcache, it needs to fetch the same regset through ptrace again if another register in this regset is fetched later, this is obviously unnecessary. It is proper to update the status of the entire regset in regcache when fetching a register via ptrace. Signed-off-by: Hui Li <lihui@loongson.cn> Reviewed-By: Tom Tromey <tom@tromey.com> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/loongarch-linux-nat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/loongarch-linux-nat.c b/gdb/loongarch-linux-nat.c
index 5eb32b0..40231d5 100644
--- a/gdb/loongarch-linux-nat.c
+++ b/gdb/loongarch-linux-nat.c
@@ -65,7 +65,7 @@ fetch_gregs_from_thread (struct regcache *regcache, int regnum, pid_t tid)
if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, (long) &iov) < 0)
perror_with_name (_("Couldn't get NT_PRSTATUS registers"));
else
- loongarch_gregset.supply_regset (nullptr, regcache, regnum,
+ loongarch_gregset.supply_regset (nullptr, regcache, -1,
&regset, sizeof (regset));
}
}
@@ -116,7 +116,7 @@ fetch_fpregs_from_thread (struct regcache *regcache, int regnum, pid_t tid)
if (ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, (long) &iovec) < 0)
perror_with_name (_("Couldn't get NT_FPREGSET registers"));
else
- loongarch_fpregset.supply_regset (nullptr, regcache, regnum,
+ loongarch_fpregset.supply_regset (nullptr, regcache, -1,
&regset, sizeof (regset));
}
}