From: Luis Machado <lgustavo@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: "'gdb-patches@sourceware.org'" <gdb-patches@sourceware.org>,
Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH] Move code to common/ptid.h
Date: Thu, 19 Sep 2013 12:44:00 -0000 [thread overview]
Message-ID: <523AF193.1020907@codesourcery.com> (raw)
In-Reply-To: <20130919123407.GQ3132@adacore.com>
On 09/19/2013 09:34 AM, Joel Brobecker wrote:
>> 2013-09-19 Luis Machado <lgustavo@codesourcery.com>
>>
>> * 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
next prev parent reply other threads:[~2013-09-19 12:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 12:16 Luis Machado
2013-09-19 12:28 ` Pedro Alves
2013-09-19 12:34 ` Joel Brobecker
2013-09-19 12:44 ` Luis Machado [this message]
2013-09-19 13:29 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=523AF193.1020907@codesourcery.com \
--to=lgustavo@codesourcery.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox