From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9125 invoked by alias); 19 Sep 2013 12:44:11 -0000 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 Received: (qmail 9115 invoked by uid 89); 19 Sep 2013 12:44:11 -0000 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Sep 2013 12:44:11 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE,SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VMdaY-0005Ih-9M from Luis_Gustavo@mentor.com ; Thu, 19 Sep 2013 05:44:06 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 19 Sep 2013 05:44:06 -0700 Received: from [172.30.7.81] ([172.30.7.81]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 Sep 2013 05:44:05 -0700 Message-ID: <523AF193.1020907@codesourcery.com> Date: Thu, 19 Sep 2013 12:44:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Joel Brobecker CC: "'gdb-patches@sourceware.org'" , Pedro Alves Subject: Re: [PATCH] Move code to common/ptid.h References: <523AEB33.9080100@codesourcery.com> <20130919123407.GQ3132@adacore.com> In-Reply-To: <20130919123407.GQ3132@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00673.txt.bz2 On 09/19/2013 09:34 AM, Joel Brobecker wrote: >> 2013-09-19 Luis Machado >> >> * common/ptid.h (GET_LWP, GET_PID): Moved from >> linux-nat.h. >> (is_lwp, BUILD_LWP): Likewise. >> * linux-nat.h (GET_LWP, GET_PID): Moved to >> common/ptid.h. >> (is_lwp, BUILD_LWP): Likewise. > > No real objection from me. But I am wondering about the usefulness > of these macros, now that they are straight mapping to functions of > the same name. > > Some thoughts for the long term below. Do not feel like you should > take them on yourself. Just sharing them, and seeing how people > feel about that. I may take that on myself. If there is a general > agreement, though, then perhaps the patch you are suggestion is > a step in the wrong direction... > > In the past, before we had ptid_t, I have always found the (target- > specific?) effect of these macros to be a little obscure, and I am > still suffering from those effects. Getting over it is not the biggest > challenge I have faced in my life :-), but if the macros are not > really necessary, how about slowly transitioning them out in favor > of using the functions directly, at least for GET_LWP and GET_PID. > > I get "is_lwp", and we could either keep that as a macro, or define > a function. > > For BUILD_LWP, I personally don't see an advantage to having this > macro or function, but perhaps others might prefer having the hint > that we're building an LWP directly in the macro/function name. > I would define a function, though, Eg ptid_build_lwp (pid, lwp). > > Cheers, Luis. > Thanks Joel. Well, i feel the same, but this is old cruft that should either get out of the way or get out of the code. As is, these are just useless constructions that keep getting in the way of duplication removal. So, let's do it differently. Let's get rid of all these macros and their uses. How does that sound? Luis