Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Kamil Rytarowski <n54@gmx.com>
Cc: gdb-patches@sourceware.org,  simark@simark.ca
Subject: Re: [PATCH] Disable get_ptrace_pid for NetBSD
Date: Wed, 18 Mar 2020 14:48:18 -0600	[thread overview]
Message-ID: <875zf1v17x.fsf@tromey.com> (raw)
In-Reply-To: <20200318162915.15043-1-n54@gmx.com> (Kamil Rytarowski's message of "Wed, 18 Mar 2020 17:29:15 +0100")

>>>>> "Kamil" == Kamil Rytarowski <n54@gmx.com> writes:

Kamil> Unlike most other Operating Systems, NetBSD tracks both pid and lwp.
Kamil> The process id on NetBSD is stored always in the pid field of ptid.

Kamil> gdb/ChangeLog:

Kamil> 	* inf-ptrace.h: Disable get_ptrace_pid on NetBSD.
Kamil> 	* inf-ptrace.c: Likewise.
Kamil> 	* (inf_ptrace_target::resume): Update.
Kamil> 	* (inf_ptrace_target::xfer_partial): Likewise.

Kamil> +#ifndef __NetBSD__
Kamil>  /* Return which PID to pass to ptrace in order to observe/control the
Kamil> -   tracee identified by PTID.  */
Kamil> +   tracee identified by PTID.
Kamil> +
Kamil> +   Unlike most other Operating Systems, NetBSD tracks both pid and lwp
Kamil> +   and avoids this function.  */

Kamil>  pid_t
Kamil>  get_ptrace_pid (ptid_t ptid)
Kamil> @@ -328,6 +332,7 @@ get_ptrace_pid (ptid_t ptid)
Kamil>      pid = ptid.pid ();
Kamil>    return pid;

Why not make just the body of this function

#ifdef __NetBSD__
  return ptid.pid ()
#else
  ... old code


That would mean fewer #ifs.

Tom


  reply	other threads:[~2020-03-18 20:48 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 [this message]
2020-03-18 20:54   ` Tom Tromey
2020-03-18 21:22     ` Simon Marchi
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=875zf1v17x.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=n54@gmx.com \
    --cc=simark@simark.ca \
    /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