aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/i386-linux-nat.c')
-rw-r--r--gdb/i386-linux-nat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index e20e894..222c614 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -311,7 +311,8 @@ supply_gregset (elf_gregset_t *gregsetp)
for (i = 0; i < NUM_GREGS; i++)
supply_register (i, (char *) (regp + regmap[i]));
- supply_register (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
+ if (I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
+ supply_register (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
}
/* Fill register REGNO (if it is a general-purpose register) in
@@ -328,7 +329,8 @@ fill_gregset (elf_gregset_t *gregsetp, int regno)
if ((regno == -1 || regno == i))
regcache_collect (i, regp + regmap[i]);
- if (regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
+ if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
+ && I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
regcache_collect (I386_LINUX_ORIG_EAX_REGNUM, regp + ORIG_EAX);
}