Enhance dwarfread.c::resolve_dynamic_type to resolve dynamic ranges
This change breaks down the resolve_dynamic_bounds function which
works only on arrays and its index range types into two functions,
one that resolves range types, and one that resolves arrays (using
the new routine to resolve the array's index range type). The
is_dynamic_type and resolve_dynamic_type function are then re-organized
to handle range types as well.
One small change worth mentioning is the fact that, now that range
types are resolved on their own (rather than in the limited context
of array index types), the resolved range types are created from
a copy of the dynamic range type, rather than from scratch (first
parameter of create_range_type). This allows us to preserve as many
original properties in the resolved type as possible (Eg. the type's
name).
This is preparation work that will help better support dynamic range
types for languages that allow the declaration of such types (Eg. Ada).
gdb/ChangeLog:
* dwarf2read.c (is_dynamic_type): Return true for dynamic
range types. Adjust the array handling implementation to
take advantage of this change.
(resolve_dynamic_range): New function, mostly extracted from
resolve_dynamic_bounds.
(resolve_dynamic_array): New function, mostly extracted from
resolve_dynamic_bounds.
(resolve_dynamic_bounds): Delete.
(resolve_dynamic_type): Reimplement. Add handling of
TYPE_CODE_RANGE types.