This is the mail archive of the gdb-patches@sourceware.org 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: [RFA-v2] dwarf2read.c: Avoid complaint for char array of unspecified size


>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:

Pierre> 2010-05-26  Pierre Muller  <muller@ics.u-strasbg.fr>
Pierre> 	* dwarf2read.c (read_subrange_type): Create default subrange
Pierre> 	type if DIE->NUM_ATTRS is zero.

I think this is an improvement, but it would be preferable to just
directly implement what DWARF specifies:

    If the subrange entry has no type attribute describing the basis
    type, the basis type is assumed to be the same as the object
    described by the lower bound attribute (if it references an
    object). If there is no lower bound attribute, or that attribute
    does not reference an object, the basis type is the type of the
    upper bound or count attribute (if either of them references an
    object). If there is no upper bound or count attribute, or neither
    references an object, the type is assumed to be the same type, in
    the source language of the compilation unit containing the subrange
    entry, as a signed integer with the same size as an address on the
    target machine.

Pierre> +  if (die->num_attrs == 0)

A DW_TAG_subrange_type might have attributes that we ignore.  So, I
think there is no need for a check that is this specific; just determine
the type according to the above algorithm, and remove the existing
complaint code.

Tom


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