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

2c2fa1
commit a9ff5f12cff6cd06f74ecf387ac5468984c94c6f
2c2fa1
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2c2fa1
Date:   Tue Sep 6 17:29:15 2016 +0200
2c2fa1
2c2fa1
    Remove obsolete TYPE_FLAG_... values
2c2fa1
    
2c2fa1
    Now that init_type no longer takes a FLAGS argument, there is no user of
2c2fa1
    the TYPE_FLAGS_... enum values left.  This commit removes them (and all
2c2fa1
    references to them in comments as well).
2c2fa1
    
2c2fa1
    This is mostly a no-op, except for a change to the Python type printer,
2c2fa1
    which attempted to use them before.  (As best as I can tell, this wasn't
2c2fa1
    really needed anyway, since it was only used to pretty-print type
2c2fa1
    *instance* flags, which only use the instance flags.)
2c2fa1
    
2c2fa1
    gdb/ChangeLog:
2c2fa1
    
2c2fa1
            * gdbtypes.h (enum type_flag_value): Remove.
2c2fa1
            Remove references to TYPE_FLAG_... in comments throughout.
2c2fa1
            * gdbtypes.c (recursive_dump_type): Do not print TYPE_FLAG_...
2c2fa1
            flags, print the corresponding TYPE_... access macro names.
2c2fa1
            Remove references to TYPE_FLAG_... in comments throughout.
2c2fa1
            * infcall.c: Remove references to TYPE_FLAG_... in comments.
2c2fa1
            * valprint.c: Likewise.
2c2fa1
            * gdb-gdb.py (class TypeFlag): No longer consider TYPE_FLAG_...
2c2fa1
            values, only TYPE_INSTANCE_FLAG_... values.
2c2fa1
            (class TypeFlagsPrinter): Likewise.
2c2fa1
    
2c2fa1
    gdb/testsuite/ChangeLog:
2c2fa1
    
2c2fa1
            * gdb.cp/hang.exp: Remove reference to TYPE_FLAG_STUB in comment.
2c2fa1
    
2c2fa1
    Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2c2fa1
2c2fa1
### a/gdb/ChangeLog
2c2fa1
### b/gdb/ChangeLog
2c2fa1
## -1,5 +1,18 @@
2c2fa1
 2016-09-05  Ulrich Weigand  <uweigand@de.ibm.com>
2c2fa1
 
2c2fa1
+	* gdbtypes.h (enum type_flag_value): Remove.
2c2fa1
+	Remove references to TYPE_FLAG_... in comments throughout.
2c2fa1
+	* gdbtypes.c (recursive_dump_type): Do not print TYPE_FLAG_... 
2c2fa1
+	flags, print the corresponding TYPE_... access macro names.
2c2fa1
+	Remove references to TYPE_FLAG_... in comments throughout.
2c2fa1
+	* infcall.c: Remove references to TYPE_FLAG_... in comments.
2c2fa1
+	* valprint.c: Likewise.
2c2fa1
+	* gdb-gdb.py (class TypeFlag): No longer consider TYPE_FLAG_...
2c2fa1
+	values, only TYPE_INSTANCE_FLAG_... values.
2c2fa1
+	(class TypeFlagsPrinter): Likewise.
2c2fa1
+
2c2fa1
+2016-09-05  Ulrich Weigand  <uweigand@de.ibm.com>
2c2fa1
+
2c2fa1
 	* gdbtypes.h (init_type): Remove FLAGS argument.  Move OBJFILE
2c2fa1
 	argument to first position.
2c2fa1
 	(init_integer_type): New prototype.
2c2fa1
Index: gdb-7.6.1/gdb/gdb-gdb.py
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/gdb-gdb.py	2017-03-11 21:20:00.381958270 +0100
2c2fa1
+++ gdb-7.6.1/gdb/gdb-gdb.py	2017-03-11 21:22:11.333879984 +0100
2c2fa1
@@ -24,29 +24,26 @@
2c2fa1
 
2c2fa1
     In the GDB sources, struct type has a component called instance_flags
2c2fa1
     in which the value is the addition of various flags.  These flags are
2c2fa1
-    defined by two enumerates: type_flag_value, and type_instance_flag_value.
2c2fa1
-    This class helps us recreate a list with all these flags that is
2c2fa1
-    easy to manipulate and sort.  Because all flag names start with either
2c2fa1
-    TYPE_FLAG_ or TYPE_INSTANCE_FLAG_, a short_name attribute is provided
2c2fa1
-    that strips this prefix.
2c2fa1
+    defined by the enumerates type_instance_flag_value.  This class helps us
2c2fa1
+    recreate a list with all these flags that is easy to manipulate and sort.
2c2fa1
+    Because all flag names start with TYPE_INSTANCE_FLAG_, a short_name
2c2fa1
+    attribute is provided that strips this prefix.
2c2fa1
 
2c2fa1
     ATTRIBUTES
2c2fa1
-      name:  The enumeration name (eg: "TYPE_FLAG_UNSIGNED").
2c2fa1
+      name:  The enumeration name (eg: "TYPE_INSTANCE_FLAG_CONST").
2c2fa1
       value: The associated value.
2c2fa1
       short_name: The enumeration name, with the suffix stripped.
2c2fa1
     """
2c2fa1
     def __init__(self, name, value):
2c2fa1
         self.name = name
2c2fa1
         self.value = value
2c2fa1
-        self.short_name = name.replace("TYPE_FLAG_", '')
2c2fa1
-        if self.short_name == name:
2c2fa1
-            self.short_name = name.replace("TYPE_INSTANCE_FLAG_", '')
2c2fa1
+        self.short_name = name.replace("TYPE_INSTANCE_FLAG_", '')
2c2fa1
     def __cmp__(self, other):
2c2fa1
         """Sort by value order."""
2c2fa1
         return self.value.__cmp__(other.value)
2c2fa1
 
2c2fa1
-# A list of all existing TYPE_FLAGS_* and TYPE_INSTANCE_FLAGS_*
2c2fa1
-# enumerations, stored as TypeFlags objects.  Lazy-initialized.
2c2fa1
+# A list of all existing TYPE_INSTANCE_FLAGS_* enumerations,
2c2fa1
+# stored as TypeFlags objects.  Lazy-initialized.
2c2fa1
 TYPE_FLAGS = None
2c2fa1
 
2c2fa1
 class TypeFlagsPrinter:
2c2fa1
@@ -86,24 +83,13 @@
2c2fa1
         global TYPE_FLAGS
2c2fa1
         TYPE_FLAGS = []
2c2fa1
         try:
2c2fa1
-            flags = gdb.lookup_type("enum type_flag_value")
2c2fa1
-        except:
2c2fa1
-            print "Warning: Cannot find enum type_flag_value type."
2c2fa1
-            print "         `struct type' pretty-printer will be degraded"
2c2fa1
-            return
2c2fa1
-        try:
2c2fa1
             iflags = gdb.lookup_type("enum type_instance_flag_value")
2c2fa1
         except:
2c2fa1
             print "Warning: Cannot find enum type_instance_flag_value type."
2c2fa1
             print "         `struct type' pretty-printer will be degraded"
2c2fa1
             return
2c2fa1
-        # Note: TYPE_FLAG_MIN is a duplicate of TYPE_FLAG_UNSIGNED,
2c2fa1
-        # so exclude it from the list we are building.
2c2fa1
         TYPE_FLAGS = [TypeFlag(field.name, field.enumval)
2c2fa1
-                      for field in flags.fields()
2c2fa1
-                      if field.name != 'TYPE_FLAG_MIN']
2c2fa1
-        TYPE_FLAGS += [TypeFlag(field.name, field.enumval)
2c2fa1
-                       for field in iflags.fields()]
2c2fa1
+                      for field in iflags.fields()]
2c2fa1
         TYPE_FLAGS.sort()
2c2fa1
 
2c2fa1
 class StructTypePrettyPrinter:
2c2fa1
Index: gdb-7.6.1/gdb/gdbtypes.c
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/gdbtypes.c	2017-03-11 21:20:02.353972150 +0100
2c2fa1
+++ gdb-7.6.1/gdb/gdbtypes.c	2017-03-11 21:24:10.766720620 +0100
2c2fa1
@@ -3426,73 +3426,73 @@
2c2fa1
 		    TYPE_INSTANCE_FLAGS (type));
2c2fa1
   if (TYPE_CONST (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_CONST");
2c2fa1
+      puts_filtered (" TYPE_CONST");
2c2fa1
     }
2c2fa1
   if (TYPE_VOLATILE (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_VOLATILE");
2c2fa1
+      puts_filtered (" TYPE_VOLATILE");
2c2fa1
     }
2c2fa1
   if (TYPE_CODE_SPACE (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_CODE_SPACE");
2c2fa1
+      puts_filtered (" TYPE_CODE_SPACE");
2c2fa1
     }
2c2fa1
   if (TYPE_DATA_SPACE (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_DATA_SPACE");
2c2fa1
+      puts_filtered (" TYPE_DATA_SPACE");
2c2fa1
     }
2c2fa1
   if (TYPE_ADDRESS_CLASS_1 (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_ADDRESS_CLASS_1");
2c2fa1
+      puts_filtered (" TYPE_ADDRESS_CLASS_1");
2c2fa1
     }
2c2fa1
   if (TYPE_ADDRESS_CLASS_2 (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_ADDRESS_CLASS_2");
2c2fa1
+      puts_filtered (" TYPE_ADDRESS_CLASS_2");
2c2fa1
     }
2c2fa1
   if (TYPE_RESTRICT (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_RESTRICT");
2c2fa1
+      puts_filtered (" TYPE_RESTRICT");
2c2fa1
     }
2c2fa1
   puts_filtered ("\n");
2c2fa1
 
2c2fa1
   printfi_filtered (spaces, "flags");
2c2fa1
   if (TYPE_UNSIGNED (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_UNSIGNED");
2c2fa1
+      puts_filtered (" TYPE_UNSIGNED");
2c2fa1
     }
2c2fa1
   if (TYPE_NOSIGN (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_NOSIGN");
2c2fa1
+      puts_filtered (" TYPE_NOSIGN");
2c2fa1
     }
2c2fa1
   if (TYPE_STUB (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_STUB");
2c2fa1
+      puts_filtered (" TYPE_STUB");
2c2fa1
     }
2c2fa1
   if (TYPE_TARGET_STUB (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_TARGET_STUB");
2c2fa1
+      puts_filtered (" TYPE_TARGET_STUB");
2c2fa1
     }
2c2fa1
   if (TYPE_STATIC (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_STATIC");
2c2fa1
+      puts_filtered (" TYPE_STATIC");
2c2fa1
     }
2c2fa1
   if (TYPE_PROTOTYPED (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_PROTOTYPED");
2c2fa1
+      puts_filtered (" TYPE_PROTOTYPED");
2c2fa1
     }
2c2fa1
   if (TYPE_INCOMPLETE (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_INCOMPLETE");
2c2fa1
+      puts_filtered (" TYPE_INCOMPLETE");
2c2fa1
     }
2c2fa1
   if (TYPE_VARARGS (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_VARARGS");
2c2fa1
+      puts_filtered (" TYPE_VARARGS");
2c2fa1
     }
2c2fa1
   /* This is used for things like AltiVec registers on ppc.  Gcc emits
2c2fa1
      an attribute for the array type, which tells whether or not we
2c2fa1
      have a vector, instead of a regular array.  */
2c2fa1
   if (TYPE_VECTOR (type))
2c2fa1
     {
2c2fa1
-      puts_filtered (" TYPE_FLAG_VECTOR");
2c2fa1
+      puts_filtered (" TYPE_VECTOR");
2c2fa1
     }
2c2fa1
   if (TYPE_FIXED_INSTANCE (type))
2c2fa1
     {
2c2fa1
Index: gdb-7.6.1/gdb/gdbtypes.h
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/gdbtypes.h	2017-03-11 21:20:00.385958298 +0100
2c2fa1
+++ gdb-7.6.1/gdb/gdbtypes.h	2017-03-11 21:26:19.829629038 +0100
2c2fa1
@@ -160,35 +160,8 @@
2c2fa1
 
2c2fa1
 #define TYPE_CODE_CLASS TYPE_CODE_STRUCT
2c2fa1
 
2c2fa1
-/* Some constants representing each bit field in the main_type.  See
2c2fa1
-   the bit-field-specific macros, below, for documentation of each
2c2fa1
-   constant in this enum.  These enum values are only used with
2c2fa1
-   init_type.  Note that the values are chosen not to conflict with
2c2fa1
-   type_instance_flag_value; this lets init_type error-check its
2c2fa1
-   input.  */
2c2fa1
-
2c2fa1
-enum type_flag_value
2c2fa1
-{
2c2fa1
-  TYPE_FLAG_UNSIGNED = (1 << 8),
2c2fa1
-  TYPE_FLAG_NOSIGN = (1 << 9),
2c2fa1
-  TYPE_FLAG_STUB = (1 << 10),
2c2fa1
-  TYPE_FLAG_TARGET_STUB = (1 << 11),
2c2fa1
-  TYPE_FLAG_STATIC = (1 << 12),
2c2fa1
-  TYPE_FLAG_PROTOTYPED = (1 << 13),
2c2fa1
-  TYPE_FLAG_INCOMPLETE = (1 << 14),
2c2fa1
-  TYPE_FLAG_VARARGS = (1 << 15),
2c2fa1
-  TYPE_FLAG_VECTOR = (1 << 16),
2c2fa1
-  TYPE_FLAG_FIXED_INSTANCE = (1 << 17),
2c2fa1
-  TYPE_FLAG_STUB_SUPPORTED = (1 << 18),
2c2fa1
-  TYPE_FLAG_GNU_IFUNC = (1 << 19),
2c2fa1
-
2c2fa1
-  /* Used for error-checking.  */
2c2fa1
-  TYPE_FLAG_MIN = TYPE_FLAG_UNSIGNED
2c2fa1
-};
2c2fa1
-
2c2fa1
 /* Some bits for the type's instance_flags word.  See the macros below
2c2fa1
-   for documentation on each bit.  Note that if you add a value here,
2c2fa1
-   you must update the enum type_flag_value as well.  */
2c2fa1
+   for documentation on each bit.  */
2c2fa1
 enum type_instance_flag_value
2c2fa1
 {
2c2fa1
   TYPE_INSTANCE_FLAG_CONST = (1 << 0),
2c2fa1
@@ -202,7 +175,7 @@
2c2fa1
 };
2c2fa1
 
2c2fa1
 /* Unsigned integer type.  If this is not set for a TYPE_CODE_INT, the
2c2fa1
-   type is signed (unless TYPE_FLAG_NOSIGN (below) is set).  */
2c2fa1
+   type is signed (unless TYPE_NOSIGN (below) is set).  */
2c2fa1
 
2c2fa1
 #define TYPE_UNSIGNED(t)	(TYPE_MAIN_TYPE (t)->flag_unsigned)
2c2fa1
 
2c2fa1
@@ -383,11 +356,11 @@
2c2fa1
    architecture's two (or more) address spaces, but this is an extension
2c2fa1
    of the architecture's model.
2c2fa1
 
2c2fa1
-   If TYPE_FLAG_INST is set, an object of the corresponding type
2c2fa1
+   If TYPE_INSTANCE_FLAG_CODE_SPACE is set, an object of the corresponding type
2c2fa1
    resides in instruction memory, even if its address (in the extended
2c2fa1
    flat address space) does not reflect this.
2c2fa1
 
2c2fa1
-   Similarly, if TYPE_FLAG_DATA is set, then an object of the 
2c2fa1
+   Similarly, if TYPE_INSTANCE_FLAG_DATA_SPACE is set, then an object of the
2c2fa1
    corresponding type resides in the data memory space, even if
2c2fa1
    this is not indicated by its (flat address space) address.
2c2fa1
 
2c2fa1
@@ -403,7 +376,7 @@
2c2fa1
 /* Address class flags.  Some environments provide for pointers whose
2c2fa1
    size is different from that of a normal pointer or address types
2c2fa1
    where the bits are interpreted differently than normal addresses.  The
2c2fa1
-   TYPE_FLAG_ADDRESS_CLASS_n flags may be used in target specific
2c2fa1
+   TYPE_ADDRESS_CLASS_n flags may be used in target specific
2c2fa1
    ways to represent these different types of address classes.  */
2c2fa1
 #define TYPE_ADDRESS_CLASS_1(t) (TYPE_INSTANCE_FLAGS(t) \
2c2fa1
                                  & TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1)
2c2fa1
@@ -529,7 +502,7 @@
2c2fa1
 
2c2fa1
      This is used for printing only, except by poorly designed C++ code.
2c2fa1
      For looking up a name, look for a symbol in the STRUCT_DOMAIN.
2c2fa1
-     One more legitimate use is that if TYPE_FLAG_STUB is set, this is
2c2fa1
+     One more legitimate use is that if TYPE_STUB is set, this is
2c2fa1
      the name to use to look for definitions in other files.  */
2c2fa1
 
2c2fa1
   const char *tag_name;
2c2fa1
Index: gdb-7.6.1/gdb/infcall.c
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/infcall.c	2017-03-11 21:20:00.386958305 +0100
2c2fa1
+++ gdb-7.6.1/gdb/infcall.c	2017-03-11 21:20:02.355972164 +0100
2c2fa1
@@ -58,10 +58,9 @@
2c2fa1
 
2c2fa1
    Unfortunately, on certain older platforms, the debug info doesn't
2c2fa1
    indicate reliably how each function was defined.  A function type's
2c2fa1
-   TYPE_FLAG_PROTOTYPED flag may be clear, even if the function was
2c2fa1
-   defined in prototype style.  When calling a function whose
2c2fa1
-   TYPE_FLAG_PROTOTYPED flag is clear, GDB consults this flag to
2c2fa1
-   decide what to do.
2c2fa1
+   TYPE_PROTOTYPED flag may be clear, even if the function was defined
2c2fa1
+   in prototype style.  When calling a function whose TYPE_PROTOTYPED
2c2fa1
+   flag is clear, GDB consults this flag to decide what to do.
2c2fa1
 
2c2fa1
    For modern targets, it is proper to assume that, if the prototype
2c2fa1
    flag is clear, that can be trusted: `float' arguments should be
2c2fa1
Index: gdb-7.6.1/gdb/testsuite/gdb.cp/hang.exp
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/testsuite/gdb.cp/hang.exp	2017-03-11 21:20:00.386958305 +0100
2c2fa1
+++ gdb-7.6.1/gdb/testsuite/gdb.cp/hang.exp	2017-03-11 21:20:02.356972171 +0100
2c2fa1
@@ -58,8 +58,8 @@
2c2fa1
 #
2c2fa1
 # Since `hang2.o''s psymtab lists `hang1.o' as a dependency, GDB first
2c2fa1
 # reads `hang1.o''s symbols.  When GDB sees `(1,3)=xsB:', it creates a
2c2fa1
-# type object for `struct B', sets its TYPE_FLAG_STUB flag, and
2c2fa1
-# records it as type number `(1,3)'.
2c2fa1
+# type object for `struct B', sets its TYPE_STUB flag, and records it
2c2fa1
+# as type number `(1,3)'.
2c2fa1
 #
2c2fa1
 # When GDB finds the definition of `struct C::B', since the stabs
2c2fa1
 # don't indicate that the type is nested within C, it treats it as
2c2fa1
Index: gdb-7.6.1/gdb/valprint.c
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/valprint.c	2017-03-11 21:20:00.387958312 +0100
2c2fa1
+++ gdb-7.6.1/gdb/valprint.c	2017-03-11 21:20:02.356972171 +0100
2c2fa1
@@ -661,10 +661,9 @@
2c2fa1
       break;
2c2fa1
 
2c2fa1
     case TYPE_CODE_UNDEF:
2c2fa1
-      /* This happens (without TYPE_FLAG_STUB set) on systems which
2c2fa1
-         don't use dbx xrefs (NO_DBX_XREFS in gcc) if a file has a
2c2fa1
-         "struct foo *bar" and no complete type for struct foo in that
2c2fa1
-         file.  */
2c2fa1
+      /* This happens (without TYPE_STUB set) on systems which don't use
2c2fa1
+         dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
2c2fa1
+         and no complete type for struct foo in that file.  */
2c2fa1
       fprintf_filtered (stream, _("<incomplete type>"));
2c2fa1
       break;
2c2fa1