This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Fix Solaris build
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 26 Nov 2018 13:21:43 -0000
- Subject: [binutils-gdb] Fix Solaris build
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=24bce9bbe510c9efa36c0f85fb2f8a93ec8b623e
commit 24bce9bbe510c9efa36c0f85fb2f8a93ec8b623e
Author: Pedro Alves <palves@redhat.com>
Date: Mon Nov 26 13:13:35 2018 +0000
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.
Diff:
---
gdb/ChangeLog | 7 +++++++
gdb/procfs.c | 3 ++-
gdb/sol-thread.c | 17 +++++++++--------
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 12523ca..9badb72 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2018-11-25 Tom Tromey <tom@tromey.com>
* ui-out.c (ui_out::field_fmt): Remove comment.
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 0d8f9df..f82fc83 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -3133,7 +3133,8 @@ procfs_notice_thread (procinfo *pi, procinfo *thread, void *ptr)
{
ptid_t gdb_threadid = ptid_t (pi->pid, thread->tid, 0);
- if (!in_thread_list (gdb_threadid) || is_exited (gdb_threadid))
+ thread_info *thr = find_thread_ptid (gdb_threadid);
+ if (thr == NULL || thr->state == THREAD_EXITED)
add_thread (gdb_threadid);
return 0;
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 682302a..c6a5aca 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;