* amd64-tdep.c (amd64_convert_register_p): Delete.
authorDaniel Jacobowitz <drow@false.org>
Wed, 24 Oct 2007 20:29:14 +0000 (20:29 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 24 Oct 2007 20:29:14 +0000 (20:29 +0000)
(amd64_init_abi): Use i387_convert_register_p.
* alpha-tdep.c (alpha_convert_register_p): Return zero for
eight byte types.
(alpha_register_to_value, alpha_value_to_register): Do not handle
eight byte types.
* i386-tdep.c (i386_convert_register_p): Use i387_convert_register_p.
* i387-tdep.c (i387_convert_register_p): New.
(i387_register_to_value, i387_value_to_register): Update comments.
* i387-tdep.h (i387_convert_register_p): Declare.
* ia64-tdep.c (ia64_convert_register_p): Return zero for
builtin_type_ia64_ext.
(ia64_gdbarch_init): Do not initialize builtin_type_ia64_ext here.
(_initialize_ia64_tdep): Initialize builtin_type_ia64_ext here.
* m68k-tdep.c (m68k_convert_register_p): Return zero for
builtin_type_m68881_ext.
(m68k_register_to_value, m68k_value_to_register): Update comments.

* gdbint.texinfo (Register and Memory Data, Target Conditionals):
Document that gdbarch_convert_register_p should return zero for no-op
conversions.

gdb/ChangeLog
gdb/alpha-tdep.c
gdb/amd64-tdep.c
gdb/doc/ChangeLog
gdb/doc/gdbint.texinfo
gdb/i386-tdep.c
gdb/i387-tdep.c
gdb/i387-tdep.h
gdb/ia64-tdep.c
gdb/m68k-tdep.c

index fd634e5f12f4b7a6b8c9a7a7ecc0ba14024ea8b6..f00ede08593c1ba3aa14e8341b131728b66c669e 100644 (file)
@@ -1,3 +1,23 @@
+2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * amd64-tdep.c (amd64_convert_register_p): Delete.
+       (amd64_init_abi): Use i387_convert_register_p.
+       * alpha-tdep.c (alpha_convert_register_p): Return zero for
+       eight byte types.
+       (alpha_register_to_value, alpha_value_to_register): Do not handle
+       eight byte types.
+       * i386-tdep.c (i386_convert_register_p): Use i387_convert_register_p.
+       * i387-tdep.c (i387_convert_register_p): New.
+       (i387_register_to_value, i387_value_to_register): Update comments.
+       * i387-tdep.h (i387_convert_register_p): Declare.
+       * ia64-tdep.c (ia64_convert_register_p): Return zero for
+       builtin_type_ia64_ext.
+       (ia64_gdbarch_init): Do not initialize builtin_type_ia64_ext here.
+       (_initialize_ia64_tdep): Initialize builtin_type_ia64_ext here.
+       * m68k-tdep.c (m68k_convert_register_p): Return zero for
+       builtin_type_m68881_ext.
+       (m68k_register_to_value, m68k_value_to_register): Update comments.
+
 2007-10-24  Nathan Sidwell  <nathan@codesourcery.com>
 
        * target-memory.c (claim_memory): Propagate baton for split memory
index 623d1bea2c3cda735a1160e6ba4111f337dccf9f..4b175d015b834f0b742de0d2b6cd3b0f9fd72be6 100644 (file)
@@ -200,7 +200,8 @@ alpha_sts (void *out, const void *in)
 static int
 alpha_convert_register_p (int regno, struct type *type)
 {
-  return (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 31);
+  return (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 31
+         && TYPE_LENGTH (type) != 8);
 }
 
 static void
@@ -215,9 +216,6 @@ alpha_register_to_value (struct frame_info *frame, int regnum,
     case 4:
       alpha_sts (out, in);
       break;
-    case 8:
-      memcpy (out, in, 8);
-      break;
     default:
       error (_("Cannot retrieve value from floating point register"));
     }
@@ -234,9 +232,6 @@ alpha_value_to_register (struct frame_info *frame, int regnum,
     case 4:
       alpha_lds (out, in);
       break;
-    case 8:
-      memcpy (out, in, 8);
-      break;
     default:
       error (_("Cannot store value in floating point register"));
     }
index 3ca8dde7afe2c2794c9886b0452a8848b91f8570..ff5272ba5ca76a593daab219c824d1dc06f432cd 100644 (file)
@@ -200,14 +200,6 @@ amd64_dwarf_reg_to_regnum (int reg)
   return regnum;
 }
 
-/* Return nonzero if a value of type TYPE stored in register REGNUM
-   needs any special handling.  */
-
-static int
-amd64_convert_register_p (int regnum, struct type *type)
-{
-  return i386_fp_regnum_p (regnum);
-}
 \f
 
 /* Register classes as defined in the psABI.  */
@@ -1155,7 +1147,7 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_frame_align (gdbarch, amd64_frame_align);
   set_gdbarch_frame_red_zone_size (gdbarch, 128);
 
-  set_gdbarch_convert_register_p (gdbarch, amd64_convert_register_p);
+  set_gdbarch_convert_register_p (gdbarch, i387_convert_register_p);
   set_gdbarch_register_to_value (gdbarch, i387_register_to_value);
   set_gdbarch_value_to_register (gdbarch, i387_value_to_register);
 
index ed8ae707e7aaf2e3fe3a71019c58343e27d0f1e0..321f79ed83a269158c989c5d662b6d1e1e2c52e9 100644 (file)
@@ -1,12 +1,18 @@
+2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdbint.texinfo (Register and Memory Data, Target Conditionals):
+       Document that gdbarch_convert_register_p should return zero for no-op
+       conversions.
+
 2007-10-22  Ulrich Weigand  <uweigand@de.ibm.com>
 
-       * gdbarch.texi (Compiler Characteristics): Move documentation
+       * gdbint.texi (Compiler Characteristics): Move documentation
        of set_gdbarch_sofun_address_maybe_missing back to ...
        (Target Conditionals): ... here to fix build break.
 
 2007-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
 
-       * gdbarch.texi (Target Conditionals): Remove documentation of
+       * gdbint.texi (Target Conditionals): Remove documentation of
        SOFUN_ADDRESS_MAYBE_MISSING, replaced by ...
        (Compiler Characteristics): ... documentation of
        set_gdbarch_sofun_address_maybe_missing.
index 0854f919e4eb3b43c410c1c5c292c858b039dff4..e40dd4ed52527662b5f214dccff35b367f132c55 100644 (file)
@@ -3226,6 +3226,9 @@ when stored in memory.
 
 When non-zero, the macros @code{gdbarch_register_to_value} and
 @code{value_to_register} are used to perform any necessary conversion.
+
+This function should return zero for the register's native type, when
+no conversion is necessary.
 @end deftypefun
 
 @deftypefun void gdbarch_register_to_value (struct gdbarch *@var{gdbarch}, int @var{reg}, struct type *@var{type}, char *@var{from}, char *@var{to})
@@ -3462,8 +3465,8 @@ default so that @value{GDBN} will assume that all registers may be written.
 
 @item int gdbarch_convert_register_p (@var{gdbarch}, @var{regnum}, struct type *@var{type})
 @findex gdbarch_convert_register_p
-Return non-zero if register @var{regnum} can represent data values in a
-non-standard form.
+Return non-zero if register @var{regnum} represents data values of type
+@var{type} in a non-standard form.
 @xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
 
 @item CORE_ADDR gdbarch_decr_pc_after_break (@var{gdbarch})
index 58e1cf22df6cb87763542841f7350df03f759c1b..1fda5b13b58720100c07034635ca8b946a5389f0 100644 (file)
@@ -1880,7 +1880,7 @@ i386_convert_register_p (int regnum, struct type *type)
        return 1;
     }
 
-  return i386_fp_regnum_p (regnum);
+  return i387_convert_register_p (regnum, type);
 }
 
 /* Read a value of type TYPE from register REGNUM in frame FRAME, and
index 73a7797b0a90bcaba5e4a88d312bdd8fb7a4b06e..e665989e043946c2803f8766137e5988defc6c69 100644 (file)
@@ -285,6 +285,25 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
 }
 \f
 
+/* Return nonzero if a value of type TYPE stored in register REGNUM
+   needs any special handling.  */
+
+int
+i387_convert_register_p (int regnum, struct type *type)
+{
+  if (i386_fp_regnum_p (regnum))
+    {
+      /* Floating point registers must be converted unless we are
+        accessing them in their hardware type.  */
+      if (type == builtin_type_i387_ext)
+       return 0;
+      else
+       return 1;
+    }
+
+  return 0;
+}
+
 /* Read a value of type TYPE from register REGNUM in frame FRAME, and
    return its contents in TO.  */
 
@@ -304,8 +323,7 @@ i387_register_to_value (struct frame_info *frame, int regnum,
       return;
     }
 
-  /* Convert to TYPE.  This should be a no-op if TYPE is equivalent to
-     the extended floating-point format used by the FPU.  */
+  /* Convert to TYPE.  */
   get_frame_register (frame, regnum, from);
   convert_typed_floating (from, builtin_type_i387_ext, to, type);
 }
@@ -329,8 +347,7 @@ i387_value_to_register (struct frame_info *frame, int regnum,
       return;
     }
 
-  /* Convert from TYPE.  This should be a no-op if TYPE is equivalent
-     to the extended floating-point format used by the FPU.  */
+  /* Convert from TYPE.  */
   convert_typed_floating (from, type, to, builtin_type_i387_ext);
   put_frame_register (frame, regnum, to);
 }
index a6bd0c50869536c606825562ae31ef305e3d2160..a94b27ae13f234e2cdf4831cc215b1f1bf1fc0b6 100644 (file)
@@ -55,6 +55,11 @@ extern void i387_print_float_info (struct gdbarch *gdbarch,
                                   struct frame_info *frame,
                                   const char *args);
 
+/* Return nonzero if a value of type TYPE stored in register REGNUM
+   needs any special handling.  */
+
+extern int i387_convert_register_p (int regnum, struct type *type);
+
 /* Read a value of type TYPE from register REGNUM in frame FRAME, and
    return its contents in TO.  */
 
index ea030a763eaec3ba0b8d6b289a792a3af9f0a95a..d5bea78955ef8ad273cc45d48dbd053cf7e6e396 100644 (file)
@@ -920,7 +920,8 @@ ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
 static int
 ia64_convert_register_p (int regno, struct type *type)
 {
-  return (regno >= IA64_FR0_REGNUM && regno <= IA64_FR127_REGNUM);
+  return (regno >= IA64_FR0_REGNUM && regno <= IA64_FR127_REGNUM
+         && type != builtin_type_ia64_ext);
 }
 
 static void
@@ -3564,12 +3565,6 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   tdep->sigcontext_register_address = 0;
   tdep->pc_in_sigtramp = 0;
 
-  /* Define the ia64 floating-point format to gdb.  */
-  builtin_type_ia64_ext =
-    init_type (TYPE_CODE_FLT, 128 / 8,
-               0, "builtin_type_ia64_ext", NULL);
-  TYPE_FLOATFORMAT (builtin_type_ia64_ext) = floatformats_ia64_ext;
-
   /* According to the ia64 specs, instructions that store long double
      floats in memory use a long-double format different than that
      used in the floating registers.  The memory format matches the
@@ -3652,5 +3647,11 @@ extern initialize_file_ftype _initialize_ia64_tdep; /* -Wmissing-prototypes */
 void
 _initialize_ia64_tdep (void)
 {
+  /* Define the ia64 floating-point format to gdb.  */
+  builtin_type_ia64_ext =
+    init_type (TYPE_CODE_FLT, 128 / 8,
+               0, "builtin_type_ia64_ext", NULL);
+  TYPE_FLOATFORMAT (builtin_type_ia64_ext) = floatformats_ia64_ext;
+
   gdbarch_register (bfd_arch_ia64, ia64_gdbarch_init, NULL);
 }
index 87e8c1d9d632f8d5e44ba25123aa4701fffc5be2..b75a952e83fda447a3a3384731778a94709e2165 100644 (file)
@@ -171,7 +171,8 @@ m68k_convert_register_p (int regnum, struct type *type)
 {
   if (!gdbarch_tdep (current_gdbarch)->fpregs_present)
     return 0;
-  return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7);
+  return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7
+         && type != builtin_type_m68881_ext);
 }
 
 /* Read a value of type TYPE from register REGNUM in frame FRAME, and
@@ -193,8 +194,7 @@ m68k_register_to_value (struct frame_info *frame, int regnum,
       return;
     }
 
-  /* Convert to TYPE.  This should be a no-op if TYPE is equivalent to
-     the extended floating-point format used by the FPU.  */
+  /* Convert to TYPE.  */
   get_frame_register (frame, regnum, from);
   convert_typed_floating (from, fpreg_type, to, type);
 }
@@ -218,8 +218,7 @@ m68k_value_to_register (struct frame_info *frame, int regnum,
       return;
     }
 
-  /* Convert from TYPE.  This should be a no-op if TYPE is equivalent
-     to the extended floating-point format used by the FPU.  */
+  /* Convert from TYPE.  */
   convert_typed_floating (from, type, to, fpreg_type);
   put_frame_register (frame, regnum, to);
 }
This page took 0.039172 seconds and 4 git commands to generate.