Changeset View
Changeset View
Standalone View
Standalone View
head/devel/gdb/files/patch-gdb-fbsd-nat.c
--- gdb/fbsd-nat.c.orig 2016-08-01 17:50:20.000000000 +0200 | diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c | ||||
+++ gdb/fbsd-nat.c 2016-12-14 23:23:39.467449000 +0100 | index ef5ad1ec92..dedb1ba59c 100644 | ||||
@@ -680,6 +680,9 @@ | --- gdb/fbsd-nat.c | ||||
if (!ptid_match (tp->ptid, *filter)) | +++ gdb/fbsd-nat.c | ||||
return 0; | @@ -682,6 +682,14 @@ fbsd_resume (struct target_ops *ops, | ||||
struct thread_info *tp; | |||||
int request; | |||||
+ if (tp->state == THREAD_EXITED) { | |||||
+ return 0; | |||||
+ } | |||||
if (ptrace (PT_RESUME, ptid_get_lwp (tp->ptid), NULL, 0) == -1) | |||||
perror_with_name (("ptrace")); | |||||
return 0; | |||||
@@ -710,6 +713,14 @@ | |||||
ptid_get_tid (ptid)); | |||||
if (ptid_lwp_p (ptid)) | |||||
{ | |||||
+#ifndef PT_LWP_EVENTS | +#ifndef PT_LWP_EVENTS | ||||
+ /* When LWP events are not supported, a new thread might already be | + /* When LWP events are not supported, a new thread might already be | ||||
+ running that has not yet reported an event when GDB wishes to | + running that has not yet reported an event when GDB wishes to | ||||
+ only run a single thread. Force an update of the thread list | + only run a single thread. Force an update of the thread list | ||||
+ to ensure that any such threads are suspended before the process | + to ensure that any such threads are suspended before the process | ||||
+ is resumed. */ | + is resumed. */ | ||||
+ fbsd_add_threads (ptid_get_pid (ptid)); | + fbsd_add_threads (ptid_get_pid (ptid)); | ||||
+#endif | +#endif | ||||
/* If ptid is a specific LWP, suspend all other LWPs in the process. */ | ALL_NON_EXITED_THREADS (tp) | ||||
iterate_over_threads (resume_one_thread_cb, &ptid); | { | ||||
} | if (ptid_get_pid (tp->ptid) != ptid_get_pid (ptid)) |