This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Enable ptrace events on new child processes.
- From: John Baldwin <jhb at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 20 Jul 2016 18:03:14 -0000
- Subject: [binutils-gdb] Enable ptrace events on new child processes.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5fa14c6b9789bad6f91dd21889f7b1a0eb75c6d0
commit 5fa14c6b9789bad6f91dd21889f7b1a0eb75c6d0
Author: John Baldwin <jhb@FreeBSD.org>
Date: Fri Jul 15 17:01:21 2016 -0700
Enable ptrace events on new child processes.
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.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/fbsd-nat.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 678013f..36bc853 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2016-07-20 John Baldwin <jhb@FreeBSD.org>
+ * fbsd-nat.c (fbsd_wait): Use "fbsd_enable_proc_events" on
+ new child processes.
+
+2016-07-20 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);