diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-05-18 13:47:44 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-05-18 13:47:44 +0000 |
commit | 17280b9f0a137dae1dbe2eb817b2d7ba18646cd6 (patch) | |
tree | 8685ba23990a06f72fae7dd19bded8d5b479586f /gdb/ada-lang.c | |
parent | 830bb937a1076fbaf1eae8f2a3bdce8bcf53f281 (diff) | |
download | gdb-17280b9f0a137dae1dbe2eb817b2d7ba18646cd6.zip gdb-17280b9f0a137dae1dbe2eb817b2d7ba18646cd6.tar.gz gdb-17280b9f0a137dae1dbe2eb817b2d7ba18646cd6.tar.bz2 |
* ada-lang.c (ada_coerce_to_simple_array_type): Reimplement to
avoid creating a dummy value.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index f8d68c1..0725dbd 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -1689,13 +1689,13 @@ ada_coerce_to_simple_array (struct value *arr) struct type * ada_coerce_to_simple_array_type (struct type *type) { - struct value *mark = value_mark (); - struct value *dummy = value_from_longest (builtin_type_int32, 0); - struct type *result; - deprecated_set_value_type (dummy, type); - result = ada_type_of_array (dummy, 0); - value_free_to_mark (mark); - return result; + if (ada_is_packed_array_type (type)) + return decode_packed_array_type (type); + + if (ada_is_array_descriptor_type (type)) + return ada_check_typedef (TYPE_TARGET_TYPE (desc_data_type (type))); + + return type; } /* Non-zero iff TYPE represents a standard GNAT packed-array type. */ |