From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31702 invoked by alias); 17 Sep 2002 19:35:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31695 invoked from network); 17 Sep 2002 19:35:19 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 17 Sep 2002 19:35:19 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17rP40-0004LM-00; Tue, 17 Sep 2002 15:35:16 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17rO7w-0007Jn-00; Tue, 17 Sep 2002 15:35:16 -0400 Date: Tue, 17 Sep 2002 12:35:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: David Carlton , gdb-patches@sources.redhat.com Subject: Re: [RFA] convert blocks to dictionaries, phase 1, main part Message-ID: <20020917193516.GB27789@nevyn.them.org> Mail-Followup-To: Andrew Cagney , David Carlton , gdb-patches@sources.redhat.com References: <3D87587B.9080304@ges.redhat.com> <3D877FA4.8050607@ges.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D877FA4.8050607@ges.redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-09/txt/msg00354.txt.bz2 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