This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [4/4] RFC: dynamic arrays and DW_FORM_exprloc
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 15 Jul 2011 20:15:12 +0200
- Subject: Re: [4/4] RFC: dynamic arrays and DW_FORM_exprloc
- References: <m3livzbemk.fsf@fleche.redhat.com>
On Fri, 15 Jul 2011 20:08:51 +0200, Tom Tromey wrote:
> A -gdwarf-4 regression:
>
> -PASS: gdb.fortran/multi-dim.exp: print valid variable bound array element
> +FAIL: gdb.fortran/multi-dim.exp: print valid variable bound array element
>
> The bug here is that with DWARF 4, GCC uses DW_FORM_exprloc when
> emitting the bounds of a variably-sized array. GDB, however, only
> checks for DW_FORM_block1.
>
> Jan, any comments?
[...]
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -8623,7 +8623,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
> attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
> if (attr)
> {
> - if (attr->form == DW_FORM_block1 || is_ref_attr (attr))
> + if (attr->form == DW_FORM_block1
> + || attr->form == DW_FORM_exprloc
> + || is_ref_attr (attr))
and
> - if (attr && attr->form == DW_FORM_block1)
> + if (attr && (attr->form == DW_FORM_block1
> + || attr->form == DW_FORM_exprloc))
archer-jankratochvil-vla handles DW_FORM_exprloc by using attr_form_is_block
here. But that may be outside of the scope of this patch, this change is OK.
Thanks,
Jan