Blame SOURCES/gdb-rhbz1320945-float128-7of9.patch

01917d
commit 49f190bcb7f074ea2e27d4e967e4fae9ed7dafb6
01917d
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
01917d
Date:   Tue Sep 6 17:31:03 2016 +0200
01917d
01917d
    Add missing format for built-in floating-point types
01917d
    
01917d
    Many callers of init_float_type and arch_float_type still pass a NULL
01917d
    floatformat.  This commit changes those callers where the floatformat
01917d
    that is supposed to be use is obvious.  There are two categories where
01917d
    this is the case:
01917d
    
01917d
    - A number of built-in types are intended to match the platform ABI
01917d
      floating-point types (i.e. types that use gdbarch_float_bit etc.).
01917d
      Those places should use the platform ABI floating-point formats
01917d
      defined via gdbarch_float_format etc.
01917d
    
01917d
    - A number of language built-in types should simply use IEEE floating-
01917d
      point formats, since the language actually defines that this is the
01917d
      format that must be used to implement floating-point types for this
01917d
      language.  (This affects Java, Go, and Rust.)  The same applies for
01917d
      to the predefined "RS/6000" stabs floating-point built-in types.
01917d
    
01917d
    gdb/ChangeLog:
01917d
    
01917d
            * ada-lang.c (ada_language_arch_info): Use gdbarch-provided
01917d
            platform ABI floating-point formats for built-in types.
01917d
            * d-lang.c (build_d_types): Likewise.
01917d
            * f-lang.c (build_fortran_types): Likewise.
01917d
            * m2-lang.c (build_m2_types): Likewise.
01917d
            * mdebugread.c (basic_type): Likewise.
01917d
    
01917d
            * go-lang.c (build_go_types): Use IEEE floating-point formats
01917d
            for language built-in types as mandanted by the language.
01917d
            * jv-lang.c (build_java_types): Likewise.
01917d
            * rust-lang.c (rust_language_arch_info): Likewise.
01917d
            * stabsread.c (rs6000_builtin_type): Likewise.
01917d
    
01917d
    Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
01917d
01917d
### a/gdb/ChangeLog
01917d
### b/gdb/ChangeLog
01917d
## -1,5 +1,20 @@
01917d
 2016-09-05  Ulrich Weigand  <uweigand@de.ibm.com>
01917d
 
01917d
+	* ada-lang.c (ada_language_arch_info): Use gdbarch-provided
01917d
+	platform ABI floating-point formats for built-in types.
01917d
+	* d-lang.c (build_d_types): Likewise.
01917d
+	* f-lang.c (build_fortran_types): Likewise.
01917d
+	* m2-lang.c (build_m2_types): Likewise.
01917d
+	* mdebugread.c (basic_type): Likewise.
01917d
+
01917d
+	* go-lang.c (build_go_types): Use IEEE floating-point formats
01917d
+	for language built-in types as mandanted by the language.
01917d
+	* jv-lang.c (build_java_types): Likewise.
01917d
+	* rust-lang.c (rust_language_arch_info): Likewise.
01917d
+	* stabsread.c (rs6000_builtin_type): Likewise.
01917d
+
01917d
+2016-09-05  Ulrich Weigand  <uweigand@de.ibm.com>
01917d
+
01917d
 	* gdbtypes.c (init_type): Remove "char" special case.
01917d
 	(arch_integer_type): Likewise.
01917d
 	(gdbtypes_post_init): Set TYPE_NOSIGN for "char" type.
01917d
Index: gdb-7.6.1/gdb/ada-lang.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/ada-lang.c	2017-03-11 21:30:58.630560198 +0100
01917d
+++ gdb-7.6.1/gdb/ada-lang.c	2017-03-11 21:31:01.661580871 +0100
01917d
@@ -12666,16 +12666,16 @@
01917d
     = arch_integer_type (gdbarch, TARGET_CHAR_BIT, 0, "character");
01917d
   lai->primitive_type_vector [ada_primitive_type_float]
01917d
     = arch_float_type (gdbarch, gdbarch_float_bit (gdbarch),
01917d
-		       "float", NULL);
01917d
+		       "float", gdbarch_float_format (gdbarch));
01917d
   lai->primitive_type_vector [ada_primitive_type_double]
01917d
     = arch_float_type (gdbarch, gdbarch_double_bit (gdbarch),
01917d
-		       "long_float", NULL);
01917d
+		       "long_float", gdbarch_double_format (gdbarch));
01917d
   lai->primitive_type_vector [ada_primitive_type_long_long]
01917d
     = arch_integer_type (gdbarch, gdbarch_long_long_bit (gdbarch),
01917d
 			 0, "long_long_integer");
01917d
   lai->primitive_type_vector [ada_primitive_type_long_double]
01917d
     = arch_float_type (gdbarch, gdbarch_long_double_bit (gdbarch),
01917d
-		       "long_long_float", NULL);
01917d
+		       "long_long_float", gdbarch_long_double_format (gdbarch));
01917d
   lai->primitive_type_vector [ada_primitive_type_natural]
01917d
     = arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch),
01917d
 			 0, "natural");
01917d
Index: gdb-7.6.1/gdb/f-lang.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/f-lang.c	2017-03-11 21:30:58.631560204 +0100
01917d
+++ gdb-7.6.1/gdb/f-lang.c	2017-03-11 21:31:01.662580878 +0100
01917d
@@ -312,13 +312,13 @@
01917d
 
01917d
   builtin_f_type->builtin_real
01917d
     = arch_float_type (gdbarch, gdbarch_float_bit (gdbarch),
01917d
-		       "real", NULL);
01917d
+		       "real", gdbarch_float_format (gdbarch));
01917d
   builtin_f_type->builtin_real_s8
01917d
     = arch_float_type (gdbarch, gdbarch_double_bit (gdbarch),
01917d
-		       "real*8", NULL);
01917d
+		       "real*8", gdbarch_double_format (gdbarch));
01917d
   builtin_f_type->builtin_real_s16
01917d
     = arch_float_type (gdbarch, gdbarch_long_double_bit (gdbarch),
01917d
-		       "real*16", NULL);
01917d
+		       "real*16", gdbarch_long_double_format (gdbarch));
01917d
 
01917d
   builtin_f_type->builtin_complex_s8
01917d
     = arch_complex_type (gdbarch, "complex*8",
01917d
Index: gdb-7.6.1/gdb/go-lang.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/go-lang.c	2017-03-11 21:30:58.632560211 +0100
01917d
+++ gdb-7.6.1/gdb/go-lang.c	2017-03-11 21:31:01.662580878 +0100
01917d
@@ -634,9 +634,9 @@
01917d
   builtin_go_type->builtin_uint64
01917d
     = arch_integer_type (gdbarch, 64, 1, "uint64");
01917d
   builtin_go_type->builtin_float32
01917d
-    = arch_float_type (gdbarch, 32, "float32", NULL);
01917d
+    = arch_float_type (gdbarch, 32, "float32", floatformats_ieee_single);
01917d
   builtin_go_type->builtin_float64
01917d
-    = arch_float_type (gdbarch, 64, "float64", NULL);
01917d
+    = arch_float_type (gdbarch, 64, "float64", floatformats_ieee_double);
01917d
   builtin_go_type->builtin_complex64
01917d
     = arch_complex_type (gdbarch, "complex64",
01917d
 			 builtin_go_type->builtin_float32);
01917d
Index: gdb-7.6.1/gdb/jv-lang.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/jv-lang.c	2017-03-11 21:30:58.632560211 +0100
01917d
+++ gdb-7.6.1/gdb/jv-lang.c	2017-03-11 21:31:01.662580878 +0100
01917d
@@ -1220,9 +1220,9 @@
01917d
   builtin_java_type->builtin_char
01917d
     = arch_character_type (gdbarch, 16, 1, "char");
01917d
   builtin_java_type->builtin_float
01917d
-    = arch_float_type (gdbarch, 32, "float", NULL);
01917d
+    = arch_float_type (gdbarch, 32, "float", floatformats_ieee_single);
01917d
   builtin_java_type->builtin_double
01917d
-    = arch_float_type (gdbarch, 64, "double", NULL);
01917d
+    = arch_float_type (gdbarch, 64, "double", floatformats_ieee_double);
01917d
   builtin_java_type->builtin_void
01917d
     = arch_type (gdbarch, TYPE_CODE_VOID, 1, "void");
01917d
 
01917d
Index: gdb-7.6.1/gdb/m2-lang.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/m2-lang.c	2017-03-11 21:30:58.633560218 +0100
01917d
+++ gdb-7.6.1/gdb/m2-lang.c	2017-03-11 21:31:01.662580878 +0100
01917d
@@ -406,7 +406,8 @@
01917d
   builtin_m2_type->builtin_card
01917d
     = arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 1, "CARDINAL");
01917d
   builtin_m2_type->builtin_real
01917d
-    = arch_float_type (gdbarch, gdbarch_float_bit (gdbarch), "REAL", NULL);
01917d
+    = arch_float_type (gdbarch, gdbarch_float_bit (gdbarch), "REAL",
01917d
+		       gdbarch_float_format (gdbarch));
01917d
   builtin_m2_type->builtin_char
01917d
     = arch_character_type (gdbarch, TARGET_CHAR_BIT, 1, "CHAR");
01917d
   builtin_m2_type->builtin_bool
01917d
Index: gdb-7.6.1/gdb/mdebugread.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/mdebugread.c	2017-03-11 21:30:58.634560225 +0100
01917d
+++ gdb-7.6.1/gdb/mdebugread.c	2017-03-11 21:31:01.664580891 +0100
01917d
@@ -1413,12 +1413,12 @@
01917d
 
01917d
     case btFloat:
01917d
       tp = init_float_type (objfile, gdbarch_float_bit (gdbarch),
01917d
-			    "float", NULL);
01917d
+			    "float", gdbarch_float_format (gdbarch));
01917d
       break;
01917d
 
01917d
     case btDouble:
01917d
       tp = init_float_type (objfile, gdbarch_double_bit (gdbarch),
01917d
-			    "double", NULL);
01917d
+			    "double", gdbarch_double_format (gdbarch));
01917d
       break;
01917d
 
01917d
     case btComplex:
01917d
Index: gdb-7.6.1/gdb/stabsread.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/stabsread.c	2017-03-11 21:30:58.636560239 +0100
01917d
+++ gdb-7.6.1/gdb/stabsread.c	2017-03-11 21:31:01.665580898 +0100
01917d
@@ -2133,17 +2133,20 @@
01917d
       break;
01917d
     case 12:
01917d
       /* IEEE single precision (32 bit).  */
01917d
-      rettype = init_float_type (objfile, 32, "float", NULL);
01917d
+      rettype = init_float_type (objfile, 32, "float",
01917d
+				 floatformats_ieee_single);
01917d
       break;
01917d
     case 13:
01917d
       /* IEEE double precision (64 bit).  */
01917d
-      rettype = init_float_type (objfile, 64, "double", NULL);
01917d
+      rettype = init_float_type (objfile, 64, "double",
01917d
+				 floatformats_ieee_double);
01917d
       break;
01917d
     case 14:
01917d
       /* This is an IEEE double on the RS/6000, and different machines with
01917d
          different sizes for "long double" should use different negative
01917d
          type numbers.  See stabs.texinfo.  */
01917d
-      rettype = init_float_type (objfile, 64, "long double", NULL);
01917d
+      rettype = init_float_type (objfile, 64, "long double",
01917d
+				 floatformats_ieee_double);
01917d
       break;
01917d
     case 15:
01917d
       rettype = init_integer_type (objfile, 32, 0, "integer");
01917d
@@ -2152,10 +2155,12 @@
01917d
       rettype = init_boolean_type (objfile, 32, 1, "boolean");
01917d
       break;
01917d
     case 17:
01917d
-      rettype = init_float_type (objfile, 32, "short real", NULL);
01917d
+      rettype = init_float_type (objfile, 32, "short real",
01917d
+				 floatformats_ieee_single);
01917d
       break;
01917d
     case 18:
01917d
-      rettype = init_float_type (objfile, 64, "real", NULL);
01917d
+      rettype = init_float_type (objfile, 64, "real",
01917d
+				 floatformats_ieee_double);
01917d
       break;
01917d
     case 19:
01917d
       rettype = init_type (objfile, TYPE_CODE_ERROR, 0, "stringptr");