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.
This commit is contained in:
parent
41e8491fdf
commit
c2ff108bbd
6 changed files with 144 additions and 43 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue