From patchwork Wed Jun 13 21:50:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27814 Received: (qmail 41479 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 41357 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=-24.4 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=H*Ad:U*tom, sk:linux_n X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.51.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Jun 2018 21:51:08 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 9599FD269 for ; Wed, 13 Jun 2018 16:51:07 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id TDfKfaB8XBcCXTDfSfP5dk; 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 1fTDfJ-001rOd-OD; Wed, 13 Jun 2018 16:50:53 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 07/10] Remove ptid_lwp_p Date: Wed, 13 Jun 2018 14:50:46 -0700 Message-Id: <20180613215049.9691-8-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: 1fTDfJ-001rOd-OD X-Source-Sender: (localhost.localdomain) [12.176.89.6]:50304 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This removes ptid_lwp_p in favor of the ptid_t::lwp_p method. ChangeLog 2018-06-13 Tom Tromey * common/ptid.c (ptid_lwp_p): Remove. * common/ptid.h (ptid_lwp_p): Don't declare. * fbsd-nat.c: Update. * linux-nat.c: Update. * nat/linux-procfs.c: Update. * nat/x86-linux-dregs.c: Update. * sol-thread.c: Update. --- gdb/ChangeLog | 10 ++++++++++ gdb/common/ptid.c | 8 -------- gdb/common/ptid.h | 4 ---- gdb/fbsd-nat.c | 4 ++-- gdb/linux-nat.c | 8 ++++---- gdb/nat/linux-procfs.c | 2 +- gdb/nat/x86-linux-dregs.c | 4 ++-- gdb/sol-thread.c | 2 +- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cc2eb23db6..ea3bb2c467 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2018-06-13 Tom Tromey + + * common/ptid.c (ptid_lwp_p): Remove. + * common/ptid.h (ptid_lwp_p): Don't declare. + * fbsd-nat.c: Update. + * linux-nat.c: Update. + * nat/linux-procfs.c: Update. + * nat/x86-linux-dregs.c: Update. + * sol-thread.c: Update. + 2018-06-13 Tom Tromey * common/ptid.c (ptid_is_pid): Remove. diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c index 1e71104cdb..9bf6e2d9a9 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_lwp_p (const ptid_t &ptid) -{ - return ptid.lwp_p (); -} - -/* See ptid.h. */ - int ptid_tid_p (const ptid_t &ptid) { diff --git a/gdb/common/ptid.h b/gdb/common/ptid.h index 61a8d5f710..8830dce2dc 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::lwp_p. */ - -extern int ptid_lwp_p (const ptid_t &ptid); - /* See ptid_t::tid_p. */ extern int ptid_tid_p (const ptid_t &ptid); diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 2adb7a437f..88eb80ee25 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -810,7 +810,7 @@ show_fbsd_nat_debug (struct ui_file *file, int from_tty, bool fbsd_nat_target::thread_alive (ptid_t ptid) { - if (ptid_lwp_p (ptid)) + if (ptid.lwp_p ()) { struct ptrace_lwpinfo pl; @@ -1102,7 +1102,7 @@ fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) "FLWP: fbsd_resume for ptid (%d, %ld, %ld)\n", ptid.pid (), ptid.lwp (), ptid.tid ()); - if (ptid_lwp_p (ptid)) + if (ptid.lwp_p ()) { /* If ptid is a specific LWP, suspend all other LWPs in the process. */ struct thread_info *tp; diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 6512fb7b93..a0ecb654e0 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -858,7 +858,7 @@ add_initial_lwp (ptid_t ptid) { struct lwp_info *lp; - gdb_assert (ptid_lwp_p (ptid)); + gdb_assert (ptid.lwp_p ()); lp = XNEW (struct lwp_info); @@ -935,7 +935,7 @@ find_lwp_pid (ptid_t ptid) int lwp; struct lwp_info dummy; - if (ptid_lwp_p (ptid)) + if (ptid.lwp_p ()) lwp = ptid.lwp (); else lwp = ptid.pid (); @@ -3927,7 +3927,7 @@ linux_nat_target::pid_to_str (ptid_t ptid) { static char buf[64]; - if (ptid_lwp_p (ptid) + if (ptid.lwp_p () && (ptid.pid () != ptid.lwp () || num_lwps (ptid.pid ()) > 1)) { @@ -4657,7 +4657,7 @@ linux_nat_get_siginfo (ptid_t ptid, siginfo_t *siginfo) ptid_t current_lwp_ptid (void) { - gdb_assert (ptid_lwp_p (inferior_ptid)); + gdb_assert (inferior_ptid.lwp_p ()); return inferior_ptid; } diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c index 20708fa41c..1c236c543d 100644 --- a/gdb/nat/linux-procfs.c +++ b/gdb/nat/linux-procfs.c @@ -240,7 +240,7 @@ linux_proc_tid_get_name (ptid_t ptid) char comm_path[100]; const char *comm_val; pid_t pid = ptid.pid (); - pid_t tid = ptid_lwp_p (ptid) ? ptid.lwp () : ptid.pid (); + pid_t tid = ptid.lwp_p () ? ptid.lwp () : ptid.pid (); xsnprintf (comm_path, sizeof (comm_path), "/proc/%ld/task/%ld/comm", (long) pid, (long) tid); diff --git a/gdb/nat/x86-linux-dregs.c b/gdb/nat/x86-linux-dregs.c index 8aa8717163..5437fb406a 100644 --- a/gdb/nat/x86-linux-dregs.c +++ b/gdb/nat/x86-linux-dregs.c @@ -43,7 +43,7 @@ x86_linux_dr_get (ptid_t ptid, int regnum) int tid; unsigned long value; - gdb_assert (ptid_lwp_p (ptid)); + gdb_assert (ptid.lwp_p ()); tid = ptid.lwp (); errno = 0; @@ -61,7 +61,7 @@ x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) { int tid; - gdb_assert (ptid_lwp_p (ptid)); + gdb_assert (ptid.lwp_p ()); tid = ptid.lwp (); errno = 0; diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 95248f2c17..bb73c4a031 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -300,7 +300,7 @@ thread_to_lwp (ptid_t thread_id, int default_lwp) td_thrhandle_t th; td_err_e val; - if (ptid_lwp_p (thread_id)) + if (thread_id.lwp_p ()) return thread_id; /* It's already an LWP ID. */ /* It's a thread. Convert to LWP. */