This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] convert blocks to dictionaries, phase 1, main part
On Tue, Sep 17, 2002 at 03:16:52PM -0400, Andrew Cagney wrote:
>
> >>- macro's are bad m'kay :-)
> >
> >
> >Even accessor macros for members of structures? Gee, I like those:
> >it's a lot easier to find all places where, say, struct block's
> >'hashtable' member is being used by grepping for 'BLOCK_HASHTABLE'
> >than by grepping for 'hashtable' and then sorting out which ones of
> >those really are referring to the 'hashtable' member as opposed to
> >some other use of the phrase.
>
> Yep. If you think accessor macro's are a good idea, try debugging /
> using sim/common some time :-(
>
> Also grep -e '->hashtable' works pretty well.
Not for anything with a generic name. More than just blocks may have a
member named ->hashtable. An accessor macro lets you do extra checking
where necessary and be much clearer about what interfaces are being
used.
We've argued about this before, and I still hold that your distrust of
simple accessor macros serves no purpose - ESPECIALLY after all of
Jim's work to improve macro debugging. Which feels like it has a ways
to go, but is already tremendously useful to me.
> >So if you want me to get rid of all macros (other than, presumably,
> >symbolic constants, though I could use the enum trick there), I can
> >certainly do that.
>
> Yes, please. Symbolic constants as enum's is recommended.
>
> >>- just implement interfaces sufficient for the immediate needs. For
> >> instance, instead of providing ``enum dict_type'', just describe
> >> the idea. Since we can compile with -Werror, changing internal
> >> interface, when there is evidence that it is actually needed, has
> >> become relativly easy.
>
> >dict_type really is necessary currently: I need to provide hash tables
> >and linear environments to support the existing functionality of
> >blocks. It's just like the 'hashtable' member of struct block.
>
> Then just mention those that do apply.
> (I thought DanielJ indicated that you just doing an initial linear
> implementation?)
No, I indicated that he was doing a linear and hashed implementation.
I meant to, at least.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer