aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-01-12 16:16:24 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-01-12 16:16:24 +0000
commitc2ff108bbd19e8855e4c5318acd166a06c566b63 (patch)
tree8f4e4162906951bf7a0646f4312b4158e56ad294 /gdb/dwarf2read.c
parent41e8491fdf450e560451afb71c2d6c20708f78d6 (diff)
downloadgdb-c2ff108bbd19e8855e4c5318acd166a06c566b63.zip
gdb-c2ff108bbd19e8855e4c5318acd166a06c566b63.tar.gz
gdb-c2ff108bbd19e8855e4c5318acd166a06c566b63.tar.bz2
gdb/
PR fortran/11104 and DWARF unbound arrays detection. * dwarf2read.c (read_subrange_type): Set zero length on unspecified upper bound. Set TYPE_HIGH_BOUND_UNDEFINED if not language_ada on unspecified upper bound. * eval.c (evaluate_subexp_standard) <multi_f77_subscript>: Remove variables array_size_array, tmp_type and offset_item. New variable array. Remove call to f77_get_upperbound. New variables array_type and index. Call value_subscripted_rvalue for each dimenasion. Remove the final call to deprecated_set_value_type. gdb/testsuite/ PR fortran/11104 and DWARF unbound arrays detection. * gdb.fortran/multi-dim.exp: New file. * gdb.fortran/multi-dim.f90: New file.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 2161c74..03bd331 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -8192,6 +8192,11 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
int count = dwarf2_get_attr_constant_value (attr, 1);
high = low + count - 1;
}
+ else
+ {
+ /* Unspecified array length. */
+ high = low - 1;
+ }
}
/* Dwarf-2 specifications explicitly allows to create subrange types
@@ -8247,6 +8252,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
if (attr && attr->form == DW_FORM_block1)
TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1;
+ /* Ada expects an empty array on no boundary attributes. */
+ if (attr == NULL && cu->language != language_ada)
+ TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1;
+
name = dwarf2_name (die, cu);
if (name)
TYPE_NAME (range_type) = name;