aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mips-linux-nat.c')
-rw-r--r--gdb/mips-linux-nat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 4e0c51b..b1dbb79 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -416,7 +416,13 @@ mips_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
/* If we know, or just found out, that PTRACE_GETREGS does not work, fall
back to PTRACE_PEEKUSER. */
if (!have_ptrace_regsets)
- linux_nat_trad_target::fetch_registers (regcache, regnum);
+ {
+ linux_nat_trad_target::fetch_registers (regcache, regnum);
+
+ /* Fill the inaccessible zero register with zero. */
+ if (regnum == MIPS_ZERO_REGNUM || regnum == -1)
+ regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
+ }
}
/* Store REGNO (or all registers if REGNO == -1) to the target