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

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