]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/gdbtypes.c
Enhance dwarfread.c::resolve_dynamic_type to resolve dynamic ranges
authorJoel Brobecker <brobecker@adacore.com>
Sat, 19 Apr 2014 16:40:53 +0000 (09:40 -0700)
committerJoel Brobecker <brobecker@adacore.com>
Mon, 28 Apr 2014 19:41:48 +0000 (15:41 -0400)
commit6f8a3220a931ac052fedd75539058bd8aa97b3a8
tree66487c2f304ba3ff87953be23a396283b227c2a0
parent4d072ce478ebb605b2f0ca326c7c3168d4ee5989
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.
gdb/ChangeLog
gdb/gdbtypes.c