[patch] Fix DW_AT_lower_bound DWARF-4+ defaults

Tom Tromey tromey@redhat.com
Thu Apr 26 16:09:00 GMT 2012


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> +	case language_d:
Jan> +	case language_java:
Jan> +	case language_objc:
Jan> +	  if (cu->header.version >= 4)
Jan> +	    low = 0;
Jan> +	  break;

I looked at the DWARF 3 spec and it says:

    If the lower bound value is missing, the value is assumed to be a
    language-dependent default constant. The default lower bound value for C
    or C++ is 0. For Fortran, it is 1.

So it seems wrong to complain here; at least for Java and ObjC, where
there is only a single sensible default.  I can't speak for the other
languages, but even there I think the DWARF text mentioning specific
defaults is informative, not exhaustive, and we should just pick a
reasonable default and not complain.

Tom



More information about the Gdb-patches mailing list