This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix DW_AT_lower_bound DWARF-4+ defaults
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 26 Apr 2012 09:29:36 -0600
- Subject: Re: [patch] Fix DW_AT_lower_bound DWARF-4+ defaults
- References: <20120426150708.GA31687@host2.jankratochvil.net>
>>>>> "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