Fix for PR gdb/209, PR gdb/156:
[deliverable/binutils-gdb.git] / gdb / i386-linux-nat.c
index 94d9ab393bd16a0967e6924f14d821188d8131dc..e91c8fc4dfcd0c40e0569b98c74add76df7bda2e 100644 (file)
@@ -88,7 +88,7 @@ static int regmap[] =
 /* Which ptrace request retrieves which registers?
    These apply to the corresponding SET requests as well.  */
 #define GETREGS_SUPPLIES(regno) \
-  (0 <= (regno) && (regno) <= 15)
+  ((0 <= (regno) && (regno) <= 15) || (regno) == I386_LINUX_ORIG_EAX_REGNUM)
 #define GETFPREGS_SUPPLIES(regno) \
   (FP0_REGNUM <= (regno) && (regno) <= LAST_FPU_CTRL_REGNUM)
 #define GETFPXREGS_SUPPLIES(regno) \
@@ -306,6 +306,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));
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
@@ -320,7 +322,10 @@ fill_gregset (elf_gregset_t *gregsetp, int regno)
 
   for (i = 0; i < NUM_GREGS; i++)
     if ((regno == -1 || regno == i))
-      *(regp + regmap[i]) = *(elf_greg_t *) &registers[REGISTER_BYTE (i)];
+      regcache_collect (i, regp + regmap[i]);
+
+  if (regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
+    regcache_collect (I386_LINUX_ORIG_EAX_REGNUM, regp + ORIG_EAX);
 }
 
 #ifdef HAVE_PTRACE_GETREGS
This page took 0.023976 seconds and 4 git commands to generate.