static int nbsd_thread_alive (struct target_ops *ops, ptid_t ptid) { struct target_ops *beneath = find_target_beneath (ops); td_thread_t *th; td_thread_info_t ti; int val; if (nbsd_thread_active) { if (ptid_lwp_p (ptid)) { struct ptrace_lwpinfo pl; pl.pl_lwpid = ptid_get_lwp (ptid); val = ptrace (PT_LWPINFO, ptid_get_pid (ptid), (void *)&pl, sizeof(pl)); if (val == -1) val = 0; else val = 1; } else val = beneath->to_thread_alive (beneath, ptid); } else val = beneath->to_thread_alive (beneath, ptid); return val; }
static int fbsd_thread_alive (struct target_ops *ops, ptid_t ptid) { if (ptid_lwp_p (ptid)) { struct ptrace_lwpinfo pl; if (ptrace (PT_LWPINFO, ptid_get_lwp (ptid), (caddr_t) &pl, sizeof pl) == -1) return 0; #ifdef PL_FLAG_EXITED if (pl.pl_flags & PL_FLAG_EXITED) return 0; #endif } return 1; }
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); }