summaryrefslogtreecommitdiff
path: root/devel/gdb/files/commit-8607ea6
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-07-15 01:10:15 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2016-07-15 01:10:15 +0000
commit2fab2693cf8c910c01866048213a7a4def3f7b7a (patch)
tree5c731adeded9fc905dd8d25738950fcce182c23f /devel/gdb/files/commit-8607ea6
parentUpgrade third-party brotli module from 4f08382 to ada972b. (diff)
Import several patches recently merged upstream.
- Fix fork following to honor 'detach-on-fork' - Fix vfork following to post a fake vfork_done event to fix breakpoints in vfork parents (a real vfork_done event is pending but requires kernel changes currently in review). - Fix x86 debug registers to work with multiple threads (PR 157755) - Add support for 'info auxv' on both live processes and cores. - Add support for 'catch syscall'. Note that catching system calls by names requires parsing an XML file mapping system call names to numbers. The port now installs the XML syscall files to the data directory. In addition, the EXPAT option is now enabled by default as expat is used to parse the XML files. - Bump PORTREVISION. PR: 157755, 210874 Approved by: luca.pizzamiglio@gmail.com (maintainer), bdrewery
Diffstat (limited to 'devel/gdb/files/commit-8607ea6')
-rw-r--r--devel/gdb/files/commit-8607ea6165
1 files changed, 165 insertions, 0 deletions
diff --git a/devel/gdb/files/commit-8607ea6 b/devel/gdb/files/commit-8607ea6
new file mode 100644
index 000000000000..e392208169ad
--- /dev/null
+++ b/devel/gdb/files/commit-8607ea6
@@ -0,0 +1,165 @@
+commit 8607ea632c806235554aa2336cf01bf3758c1264
+Author: John Baldwin <jhb@FreeBSD.org>
+Date: Fri Jun 24 21:06:36 2016 -0700
+
+ Move fbsd_resume and related functions below fork following helper code.
+
+ gdb/ChangeLog:
+
+ * fbsd-nat.c (super_resume): Move earlier next to "super_wait".
+ (resume_one_thread_cb): Move below fork following helper code.
+ (resume_all_threads_cb): Likewise.
+ (fbsd_resume): Likewise.
+
+diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
+index 0999712..daf4580 100644
+--- gdb/fbsd-nat.c
++++ gdb/fbsd-nat.c
+@@ -281,6 +281,10 @@ fbsd_xfer_partial (struct target_ops *ops, enum target_object object,
+ #ifdef PT_LWPINFO
+ static int debug_fbsd_lwp;
+
++static void (*super_resume) (struct target_ops *,
++ ptid_t,
++ int,
++ enum gdb_signal);
+ static ptid_t (*super_wait) (struct target_ops *,
+ ptid_t,
+ struct target_waitstatus *,
+@@ -492,70 +496,6 @@ fbsd_update_thread_list (struct target_ops *ops)
+ #endif
+ }
+
+-static void (*super_resume) (struct target_ops *,
+- ptid_t,
+- int,
+- enum gdb_signal);
+-
+-static int
+-resume_one_thread_cb (struct thread_info *tp, void *data)
+-{
+- ptid_t *ptid = (ptid_t *) data;
+- int request;
+-
+- if (ptid_get_pid (tp->ptid) != ptid_get_pid (*ptid))
+- return 0;
+-
+- if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (*ptid))
+- request = PT_RESUME;
+- else
+- request = PT_SUSPEND;
+-
+- if (ptrace (request, ptid_get_lwp (tp->ptid), NULL, 0) == -1)
+- perror_with_name (("ptrace"));
+- return 0;
+-}
+-
+-static int
+-resume_all_threads_cb (struct thread_info *tp, void *data)
+-{
+- ptid_t *filter = (ptid_t *) data;
+-
+- if (!ptid_match (tp->ptid, *filter))
+- return 0;
+-
+- if (ptrace (PT_RESUME, ptid_get_lwp (tp->ptid), NULL, 0) == -1)
+- perror_with_name (("ptrace"));
+- return 0;
+-}
+-
+-/* Implement the "to_resume" target_ops method. */
+-
+-static void
+-fbsd_resume (struct target_ops *ops,
+- ptid_t ptid, int step, enum gdb_signal signo)
+-{
+-
+- if (debug_fbsd_lwp)
+- fprintf_unfiltered (gdb_stdlog,
+- "FLWP: fbsd_resume for ptid (%d, %ld, %ld)\n",
+- ptid_get_pid (ptid), ptid_get_lwp (ptid),
+- ptid_get_tid (ptid));
+- if (ptid_lwp_p (ptid))
+- {
+- /* If ptid is a specific LWP, suspend all other LWPs in the process. */
+- iterate_over_threads (resume_one_thread_cb, &ptid);
+- }
+- else
+- {
+- /* If ptid is a wildcard, resume all matching threads (they won't run
+- until the process is continued however). */
+- iterate_over_threads (resume_all_threads_cb, &ptid);
+- ptid = inferior_ptid;
+- }
+- super_resume (ops, ptid, step, signo);
+-}
+-
+ #ifdef TDP_RFPPWAIT
+ /*
+ To catch fork events, PT_FOLLOW_FORK is set on every traced process
+@@ -638,6 +578,65 @@ fbsd_is_child_pending (pid_t pid)
+ }
+ #endif
+
++static int
++resume_one_thread_cb (struct thread_info *tp, void *data)
++{
++ ptid_t *ptid = (ptid_t *) data;
++ int request;
++
++ if (ptid_get_pid (tp->ptid) != ptid_get_pid (*ptid))
++ return 0;
++
++ if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (*ptid))
++ request = PT_RESUME;
++ else
++ request = PT_SUSPEND;
++
++ if (ptrace (request, ptid_get_lwp (tp->ptid), NULL, 0) == -1)
++ perror_with_name (("ptrace"));
++ return 0;
++}
++
++static int
++resume_all_threads_cb (struct thread_info *tp, void *data)
++{
++ ptid_t *filter = (ptid_t *) data;
++
++ if (!ptid_match (tp->ptid, *filter))
++ return 0;
++
++ if (ptrace (PT_RESUME, ptid_get_lwp (tp->ptid), NULL, 0) == -1)
++ perror_with_name (("ptrace"));
++ return 0;
++}
++
++/* Implement the "to_resume" target_ops method. */
++
++static void
++fbsd_resume (struct target_ops *ops,
++ ptid_t ptid, int step, enum gdb_signal signo)
++{
++
++ if (debug_fbsd_lwp)
++ fprintf_unfiltered (gdb_stdlog,
++ "FLWP: fbsd_resume for ptid (%d, %ld, %ld)\n",
++ ptid_get_pid (ptid), ptid_get_lwp (ptid),
++ ptid_get_tid (ptid));
++ if (ptid_lwp_p (ptid))
++ {
++ /* If ptid is a specific LWP, suspend all other LWPs in the process. */
++ iterate_over_threads (resume_one_thread_cb, &ptid);
++ }
++ else
++ {
++ /* If ptid is a wildcard, resume all matching threads (they won't run
++ until the process is continued however). */
++ iterate_over_threads (resume_all_threads_cb, &ptid);
++ ptid = inferior_ptid;
++ }
++ super_resume (ops, ptid, step, signo);
++}
++
+ /* Wait for the child specified by PTID to do something. Return the
+ process ID of the child, or MINUS_ONE_PTID in case of error; store
+ the status in *OURSTATUS. */