]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[Ada] fix printing slice of array defined as typedef
authorJoel Brobecker <brobecker@gnat.com>
Tue, 17 May 2011 21:26:08 +0000 (21:26 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 17 May 2011 21:26:08 +0000 (21:26 +0000)
commitc69ffaa4fa88f3cd3d27668b5fa581d3d9e3d5d1
tree3c96565549d86fb71a9c94dc17c672bc36670794
parent0b9768a4faacbeee5d95a7ef8a93220ed658887d
[Ada] fix printing slice of array defined as typedef

A change we are making in the compiler to help preserve useful
types when using -feliminate-unused-debug-types exposed a small
hole in our value-printing code.

One example of the problem happens when trying to print a slice
of an array pointer.  If the variable is defined as a pointer to
the typedef of an array, then we fail to print the slice, like so:

    (gdb) p arr_ptr(1..2)
    cannot take slice of non-array

gdb/ChangeLog:

        * ada-lang.c (ada_is_simple_array_type, ada_value_slice_from_ptr)
        (ada_value_slice, empty_array, to_fixed_array_type): Deal with
        typedefs.
gdb/ChangeLog
gdb/ada-lang.c