From patchwork Wed Jun 13 21:50:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27813 Received: (qmail 41522 invoked by alias); 13 Jun 2018 21:51:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 41396 invoked by uid 89); 13 Jun 2018 21:51:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=beneath, H*Ad:U*tom X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.49.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Jun 2018 21:51:09 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 964885505 for ; Wed, 13 Jun 2018 16:51:07 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id TDfKfaB9QBcCXTDfSfP5eV; Wed, 13 Jun 2018 16:51:07 -0500 X-Authority-Reason: nr=8 Received: from [12.176.89.6] (port=50304 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fTDfK-001rOd-1L; Wed, 13 Jun 2018 16:50:54 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 08/10] Remove ptid_tid_p Date: Wed, 13 Jun 2018 14:50:47 -0700 Message-Id: <20180613215049.9691-9-tom@tromey.com> In-Reply-To: <20180613215049.9691-1-tom@tromey.com> References: <20180613215049.9691-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fTDfK-001rOd-1L X-Source-Sender: (localhost.localdomain) [12.176.89.6]:50304 X-Source-Auth: tom+tromey.com X-Email-Count: 9 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This removes ptid_tid_p in favor of the ptid_t::tid_p method. ChangeLog 2018-06-13 Tom Tromey * 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 + + * 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 * 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;