So here is a new simplified patch proposal:
ChangeLog entry:
2003-03-11 Pierre Muller <muller at ics dot u-strasbg dot fr>
* doublest.c (floatformat_from_length): Accept also
the real size of 'long double' type.
Index: doublest.c
===================================================================
RCS file: /cvs/src/src/gdb/doublest.c,v
retrieving revision 1.12
diff -p -u -r1.12 doublest.c
--- doublest.c 27 Feb 2003 18:08:25 -0000 1.12
+++ doublest.c 11 Mar 2003 12:17:52 -0000
@@ -633,6 +633,14 @@ floatformat_from_length (int len)
return TARGET_DOUBLE_FORMAT;
else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
return TARGET_LONG_DOUBLE_FORMAT;
+ /* On i386 the 'long double' type takes 96 bits,
+ while the real number of used bits is only 80,
+ both in processor and in memory.
+ The code below accepts the real bit size. */
+ else if ((TARGET_LONG_DOUBLE_FORMAT)
+ && (len * TARGET_CHAR_BIT ==
+ TARGET_LONG_DOUBLE_FORMAT->totalsize))
+ return TARGET_LONG_DOUBLE_FORMAT;
return NULL;
}
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller at ics dot u-strasbg dot fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99