Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>
Cc: Kamil Rytarowski <n54@gmx.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Disable get_ptrace_pid for NetBSD
Date: Wed, 18 Mar 2020 17:22:17 -0400	[thread overview]
Message-ID: <86f53c7d-80a9-f3da-6c0d-91c76c23f71d@simark.ca> (raw)
In-Reply-To: <87wo7htmd8.fsf@tromey.com>

On 2020-03-18 4:54 p.m., Tom Tromey wrote:
>>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
> 
> Tom> Why not make just the body of this function
> 
> Tom> #ifdef __NetBSD__
> Tom>   return ptid.pid ()
> Tom> #else
> Tom>   ... old code
> 
> Tom> That would mean fewer #ifs.
> 
> I see that's what you did originally and Simon requested this version.
> 
> Personally I think the new patch is uglier than the original, on the
> basis that use of "#if" generally makes the code harder to understand.
> 
> Tom
> 

Indeed, I suggested that.  I am hoping that we can isolate the ifdefs in these
"gdb_ptrace" functions (we should probably find a better name for those...), to
which you pass a "ptid" and do the right thing according to the current OS.  I
agree that adding ifdefs in the more complex code is ugly and less readable.

If my suggestion doesn't work well in practice, then feel free to revert to your
original solution, I certainly don't want to impose it if it turns out not to be
a good idea.

Simon


  reply	other threads:[~2020-03-18 21:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 16:29 Kamil Rytarowski
2020-03-18 20:48 ` Tom Tromey
2020-03-18 20:54   ` Tom Tromey
2020-03-18 21:22     ` Simon Marchi [this message]
2020-03-18 21:15 ` Simon Marchi
2020-03-18 21:40   ` Kamil Rytarowski
2020-03-18 21:43     ` Simon Marchi
2020-03-18 21:45       ` Kamil Rytarowski
2020-03-18 21:49 Kamil Rytarowski
2020-03-18 21:51 ` Kamil Rytarowski

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=86f53c7d-80a9-f3da-6c0d-91c76c23f71d@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=n54@gmx.com \
    --cc=tom@tromey.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