]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove ancient Ada workaround
authorTom Tromey <tromey@adacore.com>
Tue, 18 Jul 2023 16:45:14 +0000 (10:45 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 21 Jul 2023 13:25:23 +0000 (07:25 -0600)
I ran across this very old code in gdb's Ada support.  After a bit of
archaeology, we couldn't determine what bug this might have been
working around.  It is no longer needed, so this patch removes it.

As this is entirely Ada-specific and was reviewed and tested at
AdaCore, I'm checking it in.

gdb/ada-lang.c
gdb/ada-lang.h
gdb/ada-typeprint.c
gdb/ada-valprint.c

index 795207589d0726fa01a71737753bf74698c52884..caeea58a803affb0d56513480c789c5329f9c2a1 100644 (file)
@@ -2066,23 +2066,6 @@ ada_is_array_descriptor_type (struct type *type)
          && desc_arity (desc_bounds_type (type)) > 0);
 }
 
-/* Non-zero iff type is a partially mal-formed GNAT array
-   descriptor.  FIXME: This is to compensate for some problems with
-   debugging output from GNAT.  Re-examine periodically to see if it
-   is still needed.  */
-
-int
-ada_is_bogus_array_descriptor (struct type *type)
-{
-  return
-    type != NULL
-    && type->code () == TYPE_CODE_STRUCT
-    && (lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL
-       || lookup_struct_elt_type (type, "P_ARRAY", 1) != NULL)
-    && !ada_is_array_descriptor_type (type);
-}
-
-
 /* If ARR has a record type in the form of a standard GNAT array descriptor,
    (fat pointer) returns the type of the array data described---specifically,
    a pointer-to-array type.  If BOUNDS is non-zero, the bounds data are filled
index 08620d7ed7c8bb58b8c633a6063978a74562c869..9eb9326a86c732cf14b7a00b78c89bfdc92329a1 100644 (file)
@@ -202,8 +202,6 @@ extern int ada_is_simple_array_type (struct type *);
 
 extern int ada_is_array_descriptor_type (struct type *);
 
-extern int ada_is_bogus_array_descriptor (struct type *);
-
 extern LONGEST ada_discrete_type_low_bound (struct type *);
 
 extern LONGEST ada_discrete_type_high_bound (struct type *);
index 98faf31546002d8f8216578970933d322be6303c..3d7f61ff25a20e34e2770cb27710ae09e89ea085 100644 (file)
@@ -1065,9 +1065,6 @@ ada_print_type (struct type *type0, const char *varstring,
       case TYPE_CODE_STRUCT:
        if (ada_is_array_descriptor_type (type))
          print_array_type (type, stream, show, level, flags);
-       else if (ada_is_bogus_array_descriptor (type))
-         gdb_printf (stream,
-                     _("array (?) of ? (<mal-formed descriptor>)"));
        else
          print_record_type (type, stream, show, level, flags);
        break;
index 0d5916c715cc385995094e32946f9be472db0544..dacc72d9f1bfda04fa05d279d86ee3d0e8ae0d54 100644 (file)
@@ -844,12 +844,6 @@ ada_val_print_struct_union (struct value *value,
                            int recurse,
                            const struct value_print_options *options)
 {
-  if (ada_is_bogus_array_descriptor (value->type ()))
-    {
-      gdb_printf (stream, "(...?)");
-      return;
-    }
-
   gdb_printf (stream, "(");
 
   if (print_field_values (value, value, stream, recurse, options,
@@ -1089,13 +1083,6 @@ ada_value_print (struct value *val0, struct ui_file *stream,
          gdb_printf (stream, ") ");
        }
     }
-  else if (ada_is_bogus_array_descriptor (type))
-    {
-      gdb_printf (stream, "(");
-      type_print (type, "", stream, -1);
-      gdb_printf (stream, ") (...?)");
-      return;
-    }
 
   opts = *options;
   opts.deref_ref = true;