OSDN Git Service

[Ada] fix printing slice of array defined as typedef
authorbrobecke <brobecke>
Fri, 1 Apr 2011 17:03:23 +0000 (17:03 +0000)
committerbrobecke <brobecke>
Fri, 1 Apr 2011 17:03:23 +0000 (17:03 +0000)
commit9757e9bcac0a879cc36a85f43e2a66afbcc9d6b6
tree625a4d2a0807e4ebd8afb50cd04ebb634a416340
parentdb7b16791ca34cc04047da7a20c55e6f7f130835
[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