Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] Enable ptrace events on new child processes.
Date: Mon, 18 Jul 2016 14:58:00 -0000	[thread overview]
Message-ID: <20160718145759.58543-3-jhb@FreeBSD.org> (raw)
In-Reply-To: <20160718145759.58543-1-jhb@FreeBSD.org>

New child processes on FreeBSD do not inherit optional ptrace events
such as fork and LWP events from the parent process.  Instead,
explicitly enable events on new children when reporting a fork
event.

gdb/ChangeLog:

	* fbsd-nat.c (fbsd_wait): Use "fbsd_enable_proc_events" on
	new child processes.
---
 gdb/ChangeLog  | 5 +++++
 gdb/fbsd-nat.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dcedc14..33cd6a7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2016-07-15  John Baldwin  <jhb@FreeBSD.org>
 
+	* fbsd-nat.c (fbsd_wait): Use "fbsd_enable_proc_events" on
+	new child processes.
+
+2016-07-15  John Baldwin  <jhb@FreeBSD.org>
+
 	* fbsd-nat.c (fbsd_enable_lwp_events): Remove function.
 	(fbsd_enable_proc_events): New function.
 	(fbsd_enable_follow_fork): Remove function.
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 508ab19..5e4304e 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -836,6 +836,9 @@ fbsd_wait (struct target_ops *ops,
 		  child_ptid = ptid_build (child, pl.pl_lwpid, 0);
 		}
 
+	      /* Enable additional events on the child process.  */
+	      fbsd_enable_proc_events (ptid_get_pid (child_ptid));
+
 	      /* For vfork, the child process will have the P_PPWAIT
 		 flag set.  */
 	      fbsd_fetch_kinfo_proc (child, &kp);
-- 
2.8.4


  parent reply	other threads:[~2016-07-18 14:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 14:58 [PATCH 0/3] Add "real" vfork done handling on FreeBSD John Baldwin
2016-07-18 14:58 ` [PATCH 1/3] Consolidate code to enable optional FreeBSD native target event reporting John Baldwin
2016-07-18 14:58 ` John Baldwin [this message]
2016-07-18 14:58 ` [PATCH 3/3] Use a real vfork done event on FreeBSD when available John Baldwin
2016-07-19 18:44 ` [PATCH 0/3] Add "real" vfork done handling on FreeBSD 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=20160718145759.58543-3-jhb@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    /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