]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
dwarf2read.c::read_subrange_type: Handle dynamic lower bounds
authorJoel Brobecker <brobecker@adacore.com>
Sun, 20 Apr 2014 03:41:56 +0000 (20:41 -0700)
committerJoel Brobecker <brobecker@adacore.com>
Mon, 28 Apr 2014 19:46:29 +0000 (15:46 -0400)
commit11c1ba785203f7f121324fa9727c2adbbc2119c2
tree5ad12628ba2da66507b0f0134ca482482d18edf0
parent8739bc53cd91cc38287432b1fb880be327c9435c
dwarf2read.c::read_subrange_type: Handle dynamic lower bounds

Currently, read_subrange_type handles dynamicity only in the case of
the upper bound, and assumes that the lower bound is always static.
That's rooted in the fact that dynamicity was added to support C99
variable-length arrays, where the lower bound is always zero, and
therefore never dynamic.  But the lower bound can, in fact, be dynamic
in other languages such as Ada.

Consider for instance the following declaration in Ada...

    type Array_Type is array (L .. U) of Natural;

... where L and U are parameters of the function where the declaration
above was made, and whose value are 5 and 10.  Currently, the debugger
is able to print the value of the upper bound correctly, but not the
lower bound:

    (gdb) ptype array_type
    type = array (1 .. 10) of natural

After this patch, the debugger now prints:

    (gdb) ptype array_type
    type = array (5 .. 10) of natural

gdb/ChangeLog:

        * dwarf2read.c (read_subrange_type): Handle dynamic
        DW_AT_lower_bound attributes.
gdb/ChangeLog
gdb/dwarf2read.c