This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfa/Ada] Restructure fixed array range fall-back to remove builtin types
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 29 Jun 2009 08:38:42 -0700
- Subject: Re: [rfa/Ada] Restructure fixed array range fall-back to remove builtin types
- References: <200906261552.n5QFqLHr029329@d12av02.megacenter.de.ibm.com>
> I've tested this on amd64-linux with no regressions, however that doesn't
> say much, as the FSF mainline Ada compiler often doesn't even generate _XA
> types (the front-end generates them, but the middle-end never emits them
> because it considers them unused ...).
It's hard to test, because a failure to find the target type of an XA
type would be a bug in the compiler. So this code is really there to make
things a little more robust.
> * ada-lang.c (to_fixed_range_type): Add ORIG_TYPE argument.
> Fall back to orig_type as index type if symbol lookup fails.
> Allocate result types from ORIG_TYPE's objfile.
> (ada_array_bound_from_type, to_fixed_array_type,
> ada_evaluate_subexp): Pass original index type to
> to_fixed_range_type. Do not pass objfile.
>
> * ada-typeprint.c (print_range_type_named): Add ORIG_TYPE argument.
> Fall back to orig_type as index type if symbol lookup fails.
> (print_array_type, ada_print_type): Pass original index type
> to print_range_type_named.
This makes sense to me, and I verified that you handle the case of
array index types that are range types. So OK.
--
Joel