(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.
+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
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
case 4:
alpha_sts (out, in);
break;
- case 8:
- memcpy (out, in, 8);
- break;
default:
error (_("Cannot retrieve value from floating point register"));
}
case 4:
alpha_lds (out, in);
break;
- case 8:
- memcpy (out, in, 8);
- break;
default:
error (_("Cannot store value in floating point register"));
}
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. */
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);
+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.
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})
@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})
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
}
\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. */
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);
}
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);
}
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. */
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
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
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);
}
{
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
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);
}
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);
}