Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Return unconditionally ptid.pid () in get_ptrace_pid() for NetBSD
@ 2020-03-17 16:30 Kamil Rytarowski
  2020-03-17 16:39 ` Simon Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: Kamil Rytarowski @ 2020-03-17 16:30 UTC (permalink / raw)
  To: gdb-patches; +Cc: simark, Kamil Rytarowski

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-18 16:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17 16:30 [PATCH] Return unconditionally ptid.pid () in get_ptrace_pid() for NetBSD Kamil Rytarowski
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox