From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18235 invoked by alias); 26 Sep 2008 23:15:38 -0000 Received: (qmail 18221 invoked by uid 22791); 26 Sep 2008 23:15:38 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 26 Sep 2008 23:15:03 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m8QNF0b7019433; Fri, 26 Sep 2008 19:15:00 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m8QNExBp032204; Fri, 26 Sep 2008 19:14:59 -0400 Received: from opsy.redhat.com (vpn-10-95.bos.redhat.com [10.16.10.95]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m8QNEwVC023961; Fri, 26 Sep 2008 19:14:59 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 181C437824E; Fri, 26 Sep 2008 17:13:59 -0600 (MDT) To: Jan Kratochvil Cc: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: Accessor macro wrappers removal [Re: [patch] static_kind -> bit0, bit1] 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> <20080926044309.GA3803@host0.dyn.jankratochvil.net> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Fri, 26 Sep 2008 23:15:00 -0000 In-Reply-To: <20080926044309.GA3803@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Fri\, 26 Sep 2008 06\:43\:09 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00532.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: [accessor macros] Joel> Personally, I find them to be very useful to quickly find who is using Joel> field "main_type" in struct type. Jan> How does it differ from Jan> grep -- '->main_type\>' *.[ch] Jan> ? Like Daniel said, this is a pain if unrelated fields have the same name. Also it is a pain if there are formatting oddities. However, if I am really desperate I just rename the field I want to find to something odd, then "make -k". The compiler will tell me all (or most) of the spots it is used :-) One thing that is nice about the accessor macros is that it makes it much simpler to play with certain kinds of field rearrangements. This isn't common, of course, but I did do it recently. It turns out you can push fields into struct general_symbol_info and save a word from minimal_symbol and symbol. Trying this out was easy since I only had to modify a few macros (well, once I fixed the code not using them :-) Anyway, I don't really care either way about this stuff. It seems to be a GNU cultural thing more than anything technical. Tom