From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 08/10] Remove ptid_tid_p
Date: Wed, 13 Jun 2018 21:51:00 -0000 [thread overview]
Message-ID: <20180613215049.9691-9-tom@tromey.com> (raw)
In-Reply-To: <20180613215049.9691-1-tom@tromey.com>
This removes ptid_tid_p in favor of the ptid_t::tid_p method.
ChangeLog
2018-06-13 Tom Tromey <tom@tromey.com>
* common/ptid.c (ptid_tid_p): Remove.
* common/ptid.h (ptid_tid_p): Don't declare.
* sol-thread.c: Update.
---
gdb/ChangeLog | 6 ++++++
gdb/common/ptid.c | 8 --------
gdb/common/ptid.h | 4 ----
gdb/sol-thread.c | 16 ++++++++--------
4 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ea3bb2c467..243d74fd9c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-13 Tom Tromey <tom@tromey.com>
+
+ * common/ptid.c (ptid_tid_p): Remove.
+ * common/ptid.h (ptid_tid_p): Don't declare.
+ * sol-thread.c: Update.
+
2018-06-13 Tom Tromey <tom@tromey.com>
* common/ptid.c (ptid_lwp_p): Remove.
diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c
index 9bf6e2d9a9..e0f62b10f1 100644
--- a/gdb/common/ptid.c
+++ b/gdb/common/ptid.c
@@ -35,14 +35,6 @@ ptid_equal (const ptid_t &ptid1, const ptid_t &ptid2)
/* See ptid.h. */
-int
-ptid_tid_p (const ptid_t &ptid)
-{
- return ptid.tid_p ();
-}
-
-/* See ptid.h. */
-
int
ptid_match (const ptid_t &ptid, const ptid_t &filter)
{
diff --git a/gdb/common/ptid.h b/gdb/common/ptid.h
index 8830dce2dc..86878de905 100644
--- a/gdb/common/ptid.h
+++ b/gdb/common/ptid.h
@@ -160,10 +160,6 @@ extern ptid_t minus_one_ptid;
extern int ptid_equal (const ptid_t &ptid1, const ptid_t &ptid2);
-/* See ptid_t::tid_p. */
-
-extern int ptid_tid_p (const ptid_t &ptid);
-
/* See ptid_t::matches. */
extern int ptid_match (const ptid_t &ptid, const ptid_t &filter);
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index bb73c4a031..4bb9b34ae5 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -340,7 +340,7 @@ lwp_to_thread (ptid_t lwp)
td_thrhandle_t th;
td_err_e val;
- if (ptid_tid_p (lwp))
+ if (lwp.tid_p ())
return lwp; /* It's already a thread ID. */
/* It's an LWP. Convert it to a thread ID. */
@@ -460,7 +460,7 @@ sol_thread_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
rtnval = save_ptid;
/* See if we have a new thread. */
- if (ptid_tid_p (rtnval)
+ if (rtnval.tid_p ()
&& !ptid_equal (rtnval, save_ptid)
&& (!in_thread_list (rtnval)
|| is_exited (rtnval)))
@@ -486,7 +486,7 @@ sol_thread_target::fetch_registers (struct regcache *regcache, int regnum)
gdb_fpregset_t *fpregset_p = &fpregset;
ptid_t ptid = regcache->ptid ();
- if (!ptid_tid_p (ptid))
+ if (!ptid.tid_p ())
{
/* It's an LWP; pass the request on to the layer beneath. */
beneath ()->fetch_registers (regcache, regnum);
@@ -538,7 +538,7 @@ sol_thread_target::store_registers (struct regcache *regcache, int regnum)
prfpregset_t fpregset;
ptid_t ptid = regcache->ptid ();
- if (!ptid_tid_p (ptid))
+ if (!ptid.tid_p ())
{
/* It's an LWP; pass the request on to the layer beneath. */
beneath ()->store_registers (regcache, regnum);
@@ -591,7 +591,7 @@ sol_thread_target::xfer_partial (enum target_object object,
{
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
- if (ptid_tid_p (inferior_ptid) || !target_thread_alive (inferior_ptid))
+ if (inferior_ptid.tid_p () || !target_thread_alive (inferior_ptid))
{
/* It's either a thread or an LWP that isn't alive. Any live
LWP will do so use the first available.
@@ -697,7 +697,7 @@ sol_thread_target::mourn_inferior ()
bool
sol_thread_target::thread_alive (ptid_t ptid)
{
- if (ptid_tid_p (ptid))
+ if (ptid.tid_p ())
{
/* It's a (user-level) thread. */
td_err_e val;
@@ -785,7 +785,7 @@ rw_common (int dowrite, const struct ps_prochandle *ph, psaddr_t addr,
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
- if (ptid_tid_p (inferior_ptid) || !target_thread_alive (inferior_ptid))
+ if (inferior_ptid.tid_p () || !target_thread_alive (inferior_ptid))
{
/* It's either a thread or an LWP that isn't alive. Any live
LWP will do so use the first available.
@@ -1003,7 +1003,7 @@ sol_thread_target::pid_to_str (ptid_t ptid)
{
static char buf[100];
- if (ptid_tid_p (ptid))
+ if (ptid.tid_p ())
{
ptid_t lwp;
--
2.14.4
next prev parent reply other threads:[~2018-06-13 21:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 21:51 [RFA 00/10] Remove standalone ptid functions Tom Tromey
2018-06-13 21:51 ` [RFA 04/10] Remove ptid_get_lwp Tom Tromey
2018-06-13 21:51 ` [RFA 02/10] Remove pid_to_ptid Tom Tromey
2018-06-13 21:51 ` [RFA 09/10] Remove ptid_match Tom Tromey
2018-06-13 21:51 ` [RFA 05/10] Remove ptid_get_tid Tom Tromey
2018-06-13 21:51 ` [RFA 07/10] Remove ptid_lwp_p Tom Tromey
2018-06-13 21:51 ` Tom Tromey [this message]
2018-06-13 21:51 ` [RFA 06/10] Remove ptid_is_pid Tom Tromey
2018-06-13 21:51 ` [RFA 03/10] Remove ptid_get_pid Tom Tromey
2018-06-13 21:51 ` [RFA 01/10] Remove ptid_build Tom Tromey
2018-06-13 21:51 ` [RFA 10/10] Remove ptid_equal Tom Tromey
2018-06-13 23:22 ` [RFA 00/10] Remove standalone ptid functions Joel Brobecker
2018-06-14 2:04 ` Simon Marchi
2018-06-14 11:06 ` Pedro Alves
2018-06-14 15:42 ` Tom Tromey
2018-07-02 15:00 ` Tom Tromey
2018-07-03 13:54 ` Pedro Alves
2018-07-03 15:27 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180613215049.9691-9-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox