summaryrefslogtreecommitdiff
path: root/gdb/sol-thread.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-11-26 13:13:35 +0000
committerPedro Alves <palves@redhat.com>2018-11-26 13:16:26 +0000
commit24bce9bbe510c9efa36c0f85fb2f8a93ec8b623e (patch)
tree747f4be2b9b431af262f31be57a2324ca5e3c2ed /gdb/sol-thread.c
parent9b4e3a5e23b37b3e9ff188043630d190e9c2e55f (diff)
downloadbinutils-gdb-24bce9bbe510c9efa36c0f85fb2f8a93ec8b623e.tar.gz
Fix Solaris build
The recent commit 080363310650 ("Per-inferior thread list, thread ranges/iterators, down with ALL_THREADS, etc.") removed the definitions of is_running/is_stopped/is_exited but missed updating a couple uses of is_exited in Solaris-specific code. Tested by Rainer Orth on amd64-pc-solaris2.11. gdb/ChangeLog: 2018-11-26 Pedro Alves <palves@redhat.com> * procfs.c (procfs_notice_thread): Replace uses of in_thread_list/is_exited with find_thread_ptid/THREAD_EXITED. * sol-thread.c (sol_thread_target::wait) (sol_update_thread_list_callback): Likewise.
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r--gdb/sol-thread.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 682302a40be..c6a5aca5010 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -460,11 +460,12 @@ sol_thread_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
rtnval = save_ptid;
/* See if we have a new thread. */
- if (rtnval.tid_p ()
- && rtnval != save_ptid
- && (!in_thread_list (rtnval)
- || is_exited (rtnval)))
- add_thread (rtnval);
+ if (rtnval.tid_p () && rtnval != save_ptid)
+ {
+ thread_info *thr = find_thread_ptid (rtnval);
+ if (thr == NULL || thr->state == THREAD_EXITED)
+ add_thread (rtnval);
+ }
}
/* During process initialization, we may get here without the thread
@@ -1035,14 +1036,14 @@ sol_update_thread_list_callback (const td_thrhandle_t *th, void *ignored)
{
td_err_e retval;
td_thrinfo_t ti;
- ptid_t ptid;
retval = p_td_thr_get_info (th, &ti);
if (retval != TD_OK)
return -1;
- ptid = ptid_t (inferior_ptid.pid (), 0, ti.ti_tid);
- if (!in_thread_list (ptid) || is_exited (ptid))
+ ptid_t ptid = ptid_t (inferior_ptid.pid (), 0, ti.ti_tid);
+ thread_info *thr = find_thread_ptid (ptid);
+ if (thr == NULL || thr->state == THREAD_EXITED)
add_thread (ptid);
return 0;