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>
This commit is contained in:
parent
6d30ada87b
commit
fc07c81340
1 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
®set, 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,
|
||||
®set, sizeof (regset));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue