This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Handle DW_TAG_subrange_type


Hello Helena,

> I agree that the subrange type should be handled in more places, so ok
> with Joel's calls for that.
> 
> Almost identical code is in read_array_type. Would it be possible to
> unify that as well into a single function read_subrange_type?  I.e. do
> you think that that "else if (attr->form == DW_FORM_block1)" clause
> will interfere with the ADA case? If not and we can unify them, then,
> I'd prefer the version that Andreas has, since it handles the default
> high and low, not as -1, but the same as the original code.

Here is a revised patch, which I hope addresses all your comments.
Tested on x86-linux, using gcc HEAD. No regression.

I should also mention that I am about to send a patch to gcc-patches,
which slightly modifies the dwarf-2 output, and will likely cause GCC
to generate more of these subrange_type DIEs. It is more a cleanup
patch than anything else, but I did verify that GDB together with the
attached patch handle the new GCC without trouble.

2004-01-14  J. Brobecker  <brobecker@gnat.com>

        * dwarf2read.c (dwarf2_non_const_array_bound_ignored_complaint):
        Delete, no longer used.
        (read_subrange_type): New function, mostly extracted from
        read_array_type().
        (read_array_type): Replace extracted code by call to
        read_subrange_type().
        (dwarf2_get_attr_constant_value): New function.
        (scan_partial_symbols): Add handling for DW_TAG_subrange_type.
        (add_partial_symbol): Likewise.
        (process_die): Likewise.
        (new_symbol): Likewise.
        (read_type_die): Likewise.

OK to apply?

Thanks,
-- 
Joel

Attachment: gdb-subrange.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]