This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] static_kind -> bit0, bit1 [Re: [gdb] Fortran dynamic arrays]
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Tobias Burnus <burnus at net-b dot de>, Ulrich Weigand <uweigand at de dot ibm dot com>, Jim Blandy <jimb at red-bean dot com>
- Date: Tue, 7 Oct 2008 23:27:31 -0400
- Subject: Re: [patch] static_kind -> bit0, bit1 [Re: [gdb] Fortran dynamic arrays]
- References: <20080818111120.GE16894@adacore.com> <200808181553.m7IFrG3w005270@d12av02.megacenter.de.ibm.com> <48A59B3C.9050801@net-b.de> <20080818111120.GE16894@adacore.com> <20080907115637.GA12939@host0.dyn.jankratochvil.net> <20080919221221.GA23372@adacore.com> <20081004202457.GA20726@host0.dyn.jankratochvil.net> <20081006200001.GC3588@adacore.com> <20081007225538.GA1206@host0.dyn.jankratochvil.net>
> No, according to ISO C99 enums with no assignments get values 0, 1, 2...
Yeah, you're right. I checked C90 as well, since I believe we're still
restricted to using C90 for GDB for now, and it says the same thing.
> Included you as a co-author of this patch. OK to apply?
That's very kind, but you really didn't need to do that. You should
get sole credit for this work, as you clearly guided me as much as
I tried to guide you.
> 2008-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
> Joel Brobecker <brobecker@adacore.com>
>
> Convert static_kind into loc_kind enum.
> * gdbtypes.h (enum field_loc_kind): New.
> (union field_location): New field dwarf_block.
> (struct field): Rename static_kind as loc_kind.
> (FIELD_STATIC_KIND): Rename to ...
> (FIELD_LOC_KIND): ... here.
> (TYPE_FIELD_STATIC_KIND): Rename to ...
> (TYPE_FIELD_LOC_KIND): ... here and use there now new FIELD_LOC_KIND.
> (TYPE_FIELD_STATIC_HAS_ADDR): Remove.
> (TYPE_FIELD_STATIC): Remove.
> (TYPE_FIELD_BITPOS): Reformat.
> (SET_FIELD_BITPOS): New.
> (FIELD_PHYSADDR): Rename to ...
> (FIELD_STATIC_PHYSADDR): ... here.
> (TYPE_FIELD_STATIC_PHYSADDR): Follow the FIELD_PHYSADDR rename.
> (SET_FIELD_PHYSADDR): Use new FIELD_LOC_KIND.
> (FIELD_PHYSNAME): Rename to ...
> (FIELD_STATIC_PHYSNAME): ... here.
> (TYPE_FIELD_STATIC_PHYSNAME): Follow the FIELD_PHYSNAME rename.
> (SET_FIELD_PHYSNAME): Use new FIELD_LOC_KIND.
> (FIELD_DWARF_BLOCK, TYPE_FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK): New.
> (field_is_static): New declaration.
> * gdbtypes.c (field_is_static): New function.
> (copy_type_recursive): Update throughout.
> * amd64-tdep.c, c-typeprint.c, coffread.c, cp-valprint.c, dwarf2read.c,
> eval.c, jv-typeprint.c, jv-valprint.c, mdebugread.c, p-typeprint.c,
> p-valprint.c, valops.c, value.c, varobj.c: Update throughout.
Almost there: Pre-approved with the following nit fixed...
[in copy_type_recursive]
> + break;
> + default:
> + gdb_assert (0);
Can you change that to using an internal_error, instead? For instance,
internal_error (__FILE__, __LINE__, _("Unexpected ... kind: %d"),
TYPE_FIELD_LOC_KIND (type, i));
Something like that.
Thank you,
--
Joel