Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kamil Rytarowski <n54@gmx.com>
To: gdb-patches@sourceware.org
Cc: simark@simark.ca, Kamil Rytarowski <n54@gmx.com>
Subject: [PATCH] Return unconditionally ptid.pid () in get_ptrace_pid() for NetBSD
Date: Tue, 17 Mar 2020 17:30:20 +0100	[thread overview]
Message-ID: <20200317163020.28790-1-n54@gmx.com> (raw)

NetBSD tracks the PID and LWP pair separately and both values are
needed and meaningful.
---
 gdb/inf-ptrace.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index db17a76d946..6a6cb554ba7 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -321,10 +321,14 @@ get_ptrace_pid (ptid_t ptid)
 {
   pid_t pid;

+#if !defined(__NetBSD__)
   /* If we have an LWPID to work with, use it.  Otherwise, we're
-     dealing with a non-threaded program/target.  */
+     dealing with a non-threaded program/target.
+
+     NetBSD tracks the PID and LWP pair separately. */
   pid = ptid.lwp ();
   if (pid == 0)
+#endif
     pid = ptid.pid ();
   return pid;
 }
--
2.25.0



             reply	other threads:[~2020-03-17 16:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 16:30 Kamil Rytarowski [this message]
2020-03-17 16:39 ` Simon Marchi
2020-03-17 17:45   ` Kamil Rytarowski
2020-03-17 19:00     ` Simon Marchi
2020-03-18 16:45       ` 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=20200317163020.28790-1-n54@gmx.com \
    --to=n54@gmx.com \
    --cc=gdb-patches@sourceware.org \
    --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