Fix for PR gdb/209, PR gdb/156:
[deliverable/binutils-gdb.git] / gdb / i386-linux-nat.c
index eb222fdbcff7cf05e74809eca697123591e970f5..e91c8fc4dfcd0c40e0569b98c74add76df7bda2e 100644 (file)
 /* Prototypes for local functions.  */
 static void dummy_sse_values (void);
 
-/* On Linux, threads are implemented as pseudo-processes, in which
-   case we may be tracing more than one process at a time.  In that
-   case, inferior_ptid will contain the main process ID and the
-   individual thread (process) ID mashed together.  These macros are
-   used to separate them out.  These definitions should be overridden
-   if thread support is included.  */
-
-#if !defined (PIDGET)  /* Default definition for PIDGET/TIDGET.  */
-#define PIDGET(PID)    PID
-#define TIDGET(PID)    0
-#endif
 \f
 
 /* The register sets used in Linux ELF core-dumps are identical to the
@@ -99,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) \
@@ -317,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
@@ -331,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.024357 seconds and 4 git commands to generate.