2011-11-23 Thomas Klein <th.r.klein@web.de>
[deliverable/binutils-gdb.git] / gdb / i386-linux-nat.c
index 4fce1acf68b97865b958d8e9c90208be33645ee3..187c49d9b5882275d0854f0ad91e4312401712e1 100644 (file)
@@ -1,7 +1,7 @@
 /* Native-dependent code for GNU/Linux i386.
 
    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010 Free Software Foundation, Inc.
+   2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -170,7 +170,7 @@ fetch_register (struct regcache *regcache, int regno)
   regcache_raw_supply (regcache, regno, &val);
 }
 
-/* Store one register. */
+/* Store one register.  */
 
 static void
 store_register (const struct regcache *regcache, int regno)
@@ -216,8 +216,8 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
 
   if (I386_LINUX_ORIG_EAX_REGNUM
        < gdbarch_num_regs (get_regcache_arch (regcache)))
-    regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM,
-                         regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
+    regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
+                        + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
@@ -239,8 +239,8 @@ fill_gregset (const struct regcache *regcache,
   if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
       && I386_LINUX_ORIG_EAX_REGNUM
           < gdbarch_num_regs (get_regcache_arch (regcache)))
-    regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM,
-                         regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
+    regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
+                         + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
 }
 
 #ifdef HAVE_PTRACE_GETREGS
@@ -352,8 +352,15 @@ store_fpregs (const struct regcache *regcache, int tid, int regno)
 
 #else
 
-static void fetch_fpregs (struct regcache *regcache, int tid) {}
-static void store_fpregs (const struct regcache *regcache, int tid, int regno) {}
+static void
+fetch_fpregs (struct regcache *regcache, int tid)
+{
+}
+
+static void
+store_fpregs (const struct regcache *regcache, int tid, int regno)
+{
+}
 
 #endif
 \f
@@ -473,8 +480,17 @@ store_fpxregs (const struct regcache *regcache, int tid, int regno)
 
 #else
 
-static int fetch_fpxregs (struct regcache *regcache, int tid) { return 0; }
-static int store_fpxregs (const struct regcache *regcache, int tid, int regno) { return 0; }
+static int
+fetch_fpxregs (struct regcache *regcache, int tid)
+{
+  return 0;
+}
+
+static int
+store_fpxregs (const struct regcache *regcache, int tid, int regno)
+{
+  return 0;
+}
 
 #endif /* HAVE_PTRACE_GETFPXREGS */
 \f
@@ -691,11 +707,10 @@ static void
 i386_linux_dr_set_control (unsigned long control)
 {
   struct lwp_info *lp;
-  ptid_t ptid;
 
   i386_linux_dr[DR_CONTROL] = control;
-  ALL_LWPS (lp, ptid)
-    i386_linux_dr_set (ptid, DR_CONTROL, control);
+  ALL_LWPS (lp)
+    i386_linux_dr_set (lp->ptid, DR_CONTROL, control);
 }
 
 /* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST.  */
@@ -704,13 +719,12 @@ static void
 i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
 {
   struct lwp_info *lp;
-  ptid_t ptid;
 
   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
 
   i386_linux_dr[DR_FIRSTADDR + regnum] = addr;
-  ALL_LWPS (lp, ptid)
-    i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
+  ALL_LWPS (lp)
+    i386_linux_dr_set (lp->ptid, DR_FIRSTADDR + regnum, addr);
 }
 
 /* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST.  */
@@ -735,15 +749,14 @@ static void
 i386_linux_dr_unset_status (unsigned long mask)
 {
   struct lwp_info *lp;
-  ptid_t ptid;
 
-  ALL_LWPS (lp, ptid)
+  ALL_LWPS (lp)
     {
       unsigned long value;
-      
-      value = i386_linux_dr_get (ptid, DR_STATUS);
+
+      value = i386_linux_dr_get (lp->ptid, DR_STATUS);
       value &= ~mask;
-      i386_linux_dr_set (ptid, DR_STATUS, value);
+      i386_linux_dr_set (lp->ptid, DR_STATUS, value);
     }
 }
 
@@ -778,7 +791,7 @@ ps_get_thread_area (const struct ps_prochandle *ph,
      call.
 
      Is this function needed?  I'm guessing that the `base' is the
-     address of a descriptor that libthread_db uses to find the
+     address of a descriptor that libthread_db uses to find the
      thread local address base that GDB needs.  Perhaps that
      descriptor is defined by the ABI.  Anyway, given that
      libthread_db calls this function without prompting (gdb
@@ -877,7 +890,8 @@ i386_linux_resume (struct target_ops *ops,
 
              regcache_cooked_read_unsigned (regcache, I386_ESP_REGNUM, &sp);
              if (syscall == SYS_rt_sigreturn)
-               addr = read_memory_integer (sp + 8, 4, byte_order) + 20;
+               addr = read_memory_unsigned_integer (sp + 8, 4, byte_order)
+                 + 20;
              else
                addr = sp;
 
This page took 0.045046 seconds and 4 git commands to generate.