Update the copyright header of various files...
[deliverable/binutils-gdb.git] / gdb / i387-tdep.c
index 1af66c5a84ee633bcb8a2ef84f8d0a20cfd3c9f8..c4ace82f0899eac03536efed20a16dd76172ee44 100644 (file)
@@ -1,7 +1,7 @@
 /* Intel 387 floating point stuff.
 
    Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -253,7 +253,8 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
          break;
        }
 
-      get_frame_register (frame, (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep),
+      get_frame_register (frame,
+                         (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep),
                          raw);
 
       fputs_filtered ("0x", file);
@@ -287,7 +288,8 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
    needs any special handling.  */
 
 int
-i387_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
+i387_convert_register_p (struct gdbarch *gdbarch, int regnum,
+                        struct type *type)
 {
   if (i386_fp_regnum_p (gdbarch, regnum))
     {
@@ -305,9 +307,10 @@ i387_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
 /* Read a value of type TYPE from register REGNUM in frame FRAME, and
    return its contents in TO.  */
 
-void
+int
 i387_register_to_value (struct frame_info *frame, int regnum,
-                       struct type *type, gdb_byte *to)
+                       struct type *type, gdb_byte *to,
+                       int *optimizedp, int *unavailablep)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
   gdb_byte from[I386_MAX_REGISTER_SIZE];
@@ -319,12 +322,18 @@ i387_register_to_value (struct frame_info *frame, int regnum,
     {
       warning (_("Cannot convert floating-point register value "
               "to non-floating-point type."));
-      return;
+      *optimizedp = *unavailablep = 0;
+      return 0;
     }
 
   /* Convert to TYPE.  */
-  get_frame_register (frame, regnum, from);
+  if (!get_frame_register_bytes (frame, regnum, 0, TYPE_LENGTH (type),
+                                from, optimizedp, unavailablep))
+    return 0;
+
   convert_typed_floating (from, i387_ext_type (gdbarch), to, type);
+  *optimizedp = *unavailablep = 0;
+  return 1;
 }
 
 /* Write the contents FROM of a value of type TYPE into register
@@ -585,9 +594,9 @@ i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
 
                    if (val[0] & (1 << fpreg))
                      {
-                       int regnum = (fpreg + 8 - top) % 8 
-                                      + I387_ST0_REGNUM (tdep);
-                       tag = i387_tag (FXSAVE_ADDR (tdep, regs, regnum));
+                       int thisreg = (fpreg + 8 - top) % 8 
+                                      + I387_ST0_REGNUM (tdep);
+                       tag = i387_tag (FXSAVE_ADDR (tdep, regs, thisreg));
                      }
                    else
                      tag = 3;          /* Empty */
@@ -786,7 +795,7 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
       return;
 
     case all:
-      /* Hanle the upper YMM registers.  */
+      /* Handle the upper YMM registers.  */
       if ((tdep->xcr0 & I386_XSTATE_AVX))
        {
          if ((clear_bv & I386_XSTATE_AVX))
@@ -880,9 +889,9 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
 
                    if (val[0] & (1 << fpreg))
                      {
-                       int regnum = (fpreg + 8 - top) % 8 
+                       int thisreg = (fpreg + 8 - top) % 8 
                                       + I387_ST0_REGNUM (tdep);
-                       tag = i387_tag (FXSAVE_ADDR (tdep, regs, regnum));
+                       tag = i387_tag (FXSAVE_ADDR (tdep, regs, thisreg));
                      }
                    else
                      tag = 3;          /* Empty */
@@ -957,7 +966,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
       gdb_byte raw[I386_MAX_REGISTER_SIZE];
       gdb_byte *xstate_bv_p = XSAVE_XSTATE_BV_ADDR (regs);
       unsigned int xstate_bv = 0;
-      /* The supported bits in `xstat_bv' are 1 byte. */
+      /* The supported bits in `xstat_bv' are 1 byte.  */
       unsigned int clear_bv = (~(*xstate_bv_p)) & tdep->xcr0;
       gdb_byte *p;
 
This page took 0.025612 seconds and 4 git commands to generate.