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

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