Fri Dec 1 22:22:40 2017 UTC ()
don't suspend other threads if we are resuming.


(christos)
diff -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

cvs diff -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c (expand / switch to unified diff)

--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c 2017/12/01 22:20:44 1.3
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c 2017/12/01 22:22:40 1.4
@@ -546,39 +546,46 @@ nbsd_resume (struct target_ops *ops, @@ -546,39 +546,46 @@ nbsd_resume (struct target_ops *ops,
546 else 546 else
547 pid = ptid_get_pid (ptid); 547 pid = ptid_get_pid (ptid);
548 if (nbsd_is_vfork_done_pending (pid)) 548 if (nbsd_is_vfork_done_pending (pid))
549 return; 549 return;
550#endif 550#endif
551 551
552 if (debug_nbsd_lwp) 552 if (debug_nbsd_lwp)
553 fprintf_unfiltered (gdb_stdlog, 553 fprintf_unfiltered (gdb_stdlog,
554 "NLWP: nbsd_resume for ptid (%d, %ld, %ld)\n", 554 "NLWP: nbsd_resume for ptid (%d, %ld, %ld)\n",
555 ptid_get_pid (ptid), ptid_get_lwp (ptid), 555 ptid_get_pid (ptid), ptid_get_lwp (ptid),
556 ptid_get_tid (ptid)); 556 ptid_get_tid (ptid));
557 if (ptid_lwp_p (ptid)) 557 if (ptid_lwp_p (ptid))
558 { 558 {
559 /* If ptid is a specific LWP, suspend all other LWPs in the process. */ 559 /* FreeBSD: If ptid is a specific LWP, suspend all other LWPs in the
 560 * process.
 561 */
 562 /* NetBSD, this function is about resuming so we only deal with
 563 * the thread we've been asked to work with
 564 */
560 struct thread_info *tp; 565 struct thread_info *tp;
561 int request; 566 int request;
562 567
563 ALL_NON_EXITED_THREADS (tp) 568 ALL_NON_EXITED_THREADS (tp)
564 { 569 {
565 if (ptid_get_pid (tp->ptid) != ptid_get_pid (ptid)) 570 if (ptid_get_pid (tp->ptid) != ptid_get_pid (ptid))
566 continue; 571 continue;
567 572
568 if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid)) 573 if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid))
569 request = PT_RESUME; 574 request = PT_RESUME;
 575#ifndef __NetBSD__
570 else 576 else
571 request = PT_SUSPEND; 577 request = PT_SUSPEND;
 578#endif
572 579
573 if (ptrace (request, ptid_get_pid (tp->ptid), NULL, 580 if (ptrace (request, ptid_get_pid (tp->ptid), NULL,
574 ptid_get_lwp (tp->ptid)) == -1) 581 ptid_get_lwp (tp->ptid)) == -1)
575 perror_with_name (("ptrace")); 582 perror_with_name (("ptrace"));
576 } 583 }
577 } 584 }
578 else 585 else
579 { 586 {
580 /* If ptid is a wildcard, resume all matching threads (they won't run 587 /* If ptid is a wildcard, resume all matching threads (they won't run
581 until the process is continued however). */ 588 until the process is continued however). */
582 struct thread_info *tp; 589 struct thread_info *tp;
583 590
584 ALL_NON_EXITED_THREADS (tp) 591 ALL_NON_EXITED_THREADS (tp)