* [pushed] Remove ancient Ada workaround
@ 2023-07-21 13:41 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-07-21 13:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
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 | 17 -----------------
gdb/ada-lang.h | 2 --
gdb/ada-typeprint.c | 3 ---
gdb/ada-valprint.c | 13 -------------
4 files changed, 35 deletions(-)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 795207589d0..caeea58a803 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -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
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 08620d7ed7c..9eb9326a86c 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -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 *);
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 98faf315460..3d7f61ff25a 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -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;
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 0d5916c715c..dacc72d9f1b 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -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;
--
2.40.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-07-21 13:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-21 13:41 [pushed] Remove ancient Ada workaround Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).