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]

[commit/obvious] fix hppa long double format


Here's another simple HP-UX bug fix, backed up with some doco and a
test run.  This patch makes the type of "long double" right.

The name "floatformat_ia64_quad_big" looks a bit strange in the middle
of hppa-tdep.c.  If it bugs you too much, file a PR, and we can spend
some attention on canonicalizing the names.  Using the right format with
a funny name is definitely better than using the default format and
printing incorrect data.

Lucky for me, all HP compilers and models have identical long double
formats, and gcc uses the same format.  (BTW, HP Test Drive is actually
pretty nice, with a 17 millisecond ping time for me; 100 gigabytes of NFS
disk space; several gigabytes of /tmp space; and some Linux machines
where I can do all the script fu).

I tested this on native hppa2.0w-hp-hpux11.11 with gcc 3.3.2 and the
ILP32 model.  Nothing regressed.  These test scripts improved their
results:

  gdb.base/store.exp
  gdb.base/structs.exp
  gdb.cp/gdb1355.exp
  gdb.defects/bs14602.exp

I am committing this as an obvious fix.

Michael C

2003-12-18  Michael Chastain  <mec.gnu@mindspring.com>

	* hppa-tdep.c (hppa_gdbarch_init): Set long double floating
	point type to floatformat_ia64_quad_big.

Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.108
diff -c -3 -p -r1.108 hppa-tdep.c
*** hppa-tdep.c	18 Dec 2003 22:13:48 -0000	1.108
--- hppa-tdep.c	19 Dec 2003 00:29:34 -0000
*************** hppa_fetch_pointer_argument (struct fram
*** 5092,5097 ****
--- 5092,5102 ----
     So all these compilers use either ILP32 or LP64 model.
     TODO: gcc has more options so it needs more investigation.
  
+    For floating point types, see:
+ 
+      http://docs.hp.com/hpux/pdf/B3906-90006.pdf
+      HP-UX floating-point guide, hpux 11.00
+ 
     -- chastain 2003-12-18  */
  
  static struct gdbarch *
*************** hppa_gdbarch_init (struct gdbarch_info i
*** 5180,5185 ****
--- 5185,5191 ----
       and LP64, but might show differences some day.  */
    set_gdbarch_long_long_bit (gdbarch, 64);
    set_gdbarch_long_double_bit (gdbarch, 128);
+   set_gdbarch_long_double_format (gdbarch, &floatformat_ia64_quad_big);
  
    /* The following gdbarch vector elements do not depend on the address
       size, or in any other gdbarch element previously set.  */


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