From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28221 invoked by alias); 9 Dec 2004 22:05:41 -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 28204 invoked from network); 9 Dec 2004 22:05:34 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 9 Dec 2004 22:05:34 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id iB9M5VHn031832; Thu, 9 Dec 2004 23:05:32 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id iB9M5Vao000875; Thu, 9 Dec 2004 23:05:31 +0100 (CET) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id iB9M5Vde000872; Thu, 9 Dec 2004 23:05:31 +0100 (CET) Date: Thu, 09 Dec 2004 22:31:00 -0000 Message-Id: <200412092205.iB9M5Vde000872@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: kewarken@qnx.com CC: gdb-patches@sources.redhat.com In-reply-to: <41B85B91.7090504@qnx.com> (message from Kris Warkentin on Thu, 09 Dec 2004 09:05:05 -0500) 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> <41B85B91.7090504@qnx.com> X-SW-Source: 2004-12/txt/msg00255.txt.bz2 Date: Thu, 09 Dec 2004 09:05:05 -0500 From: Kris Warkentin 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. Bugger. I let that patch fool me again. Thought the defines were new, but of course they're not. Forget what I said about them and check your patch in as is. That is... > +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. with that change please. Cheers, Mark