This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA]: fix ia64 long double support


Fix to a couple of problems. First of all, we aren't setting up a long double format for the architecture so it defaults to double when you try and print a long double value via gdb.

Although the ia64 has a special long double format it specifies, this format is only valid for register values. Values in memory use the x86 extended float format which is 80 bits. Register long doubles are 82 bits (2 more bits of exponent).

Anyway, this simple change fixes it so long doubles print correctly.

Ok to commit?

-- Jeff J.

2003-12-04 Jeff Johnston <jjohnstn@redhat.com>

	* ia64-tdep.c (ia64_gdbarch_init): Set up the gdbarch long double
	format to be the i387 extended float format which is used for
	long double's in memory.
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.104
diff -u -p -r1.104 ia64-tdep.c
--- ia64-tdep.c	17 Nov 2003 21:38:36 -0000	1.104
+++ ia64-tdep.c	4 Dec 2003 22:29:43 -0000
@@ -3361,6 +3361,11 @@ ia64_gdbarch_init (struct gdbarch_info i
                0, "builtin_type_ia64_ext", NULL);
   TYPE_FLOATFORMAT (builtin_type_ia64_ext) = &floatformat_ia64_ext;
 
+  /* On the ia64, long double floats in memory are actually stored
+     in memory different than they are in registers.  In memory,
+     they match the x86 extended float format which is 80-bits.  */
+  set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
+
   set_gdbarch_short_bit (gdbarch, 16);
   set_gdbarch_int_bit (gdbarch, 32);
   set_gdbarch_long_bit (gdbarch, 64);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]