From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14843 invoked by alias); 9 Dec 2004 14:08:38 -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 14305 invoked from network); 9 Dec 2004 14:08:29 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sourceware.org with SMTP; 9 Dec 2004 14:08:29 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id JAA08481; Thu, 9 Dec 2004 09:29:18 -0500 Received: from [10.12.2.12] (dhcpb12 [10.12.2.12]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id JAA04701; Thu, 9 Dec 2004 09:08:28 -0500 Message-ID: <41B85B91.7090504@qnx.com> Date: Thu, 09 Dec 2004 15:45:00 -0000 From: Kris Warkentin User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) MIME-Version: 1.0 To: Mark Kettenis CC: gdb-patches@sources.redhat.com Subject: Re: Revised: [patch] general updates and improvements to QNX NTO support References: <419E5B3C.3020209@qnx.com> <41A794A8.9090008@qnx.com> <41B0905D.7070408@qnx.com> <200412031617.iB3GHFN3020509@elgar.sibelius.xs4all.nl> <41B0988D.3030005@qnx.com> <200412031743.iB3Hhr2Y020661@elgar.sibelius.xs4all.nl> <41B47B26.2060905@qnx.com> <200412082219.iB8MJi18008804@elgar.sibelius.xs4all.nl> In-Reply-To: <200412082219.iB8MJi18008804@elgar.sibelius.xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-12/txt/msg00248.txt.bz2 Mark Kettenis wrote: > Date: Mon, 06 Dec 2004 10:30:46 -0500 > From: Kris Warkentin > > Based on Mark's comments, I've refactored this patch to provide a > cleaner interface to nto_tdep.c. I created an nto_set_target function > so that the targets can initialize their own nto_target_ops and set the > target properly rather than initializing current_nto_target. > >Thanks. That looks good! I still think you should avoid the > > #define nto_xxx_yyy (current_nto_target.xxx_yyy) > >defines. They're hiding the fact that you're using a global variable. >Consider a patch that uses current_nto_target.xxx_yyy directly >pre-approved. I've got one additional nit, please see below. > > Question. I use the nto_xxx_yyy functions _everywhere_ in our code. Would it be acceptable if I changed the define to be like target.h as in: #define nto_xxx_yyy(args) (*current_nto_target.xxx_yyy) (args) Then the only time I would do the full current_nto_target.xxx_yyy is in cases like below where it needs to be obvious that I'm testing or setting a global variable. Its just that there are so many instances of these macros in our target support that the syntactic sugar is very attractive for code readability. > +enum gdb_osabi > +nto_elf_osabi_sniffer (bfd *abfd) > +{ > + if (nto_is_nto_target) > + { > + return nto_is_nto_target (abfd); > + } > + return GDB_OSABI_UNKNOWN; > +} > + > >Could you remove the redundant braces here? With that change, this is >OK. > No problem. Thanks. Kris