Remove ptid_lwp_p
authorTom Tromey <tom@tromey.com>
Mon, 11 Jun 2018 18:20:11 +0000 (12:20 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 3 Jul 2018 17:36:45 +0000 (11:36 -0600)
This removes ptid_lwp_p in favor of the ptid_t::lwp_p method.

gdb/ChangeLog
2018-07-03  Tom Tromey  <tom@tromey.com>

* 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
gdb/common/ptid.c
gdb/common/ptid.h
gdb/fbsd-nat.c
gdb/linux-nat.c
gdb/nat/linux-procfs.c
gdb/nat/x86-linux-dregs.c
gdb/sol-thread.c

index 5cbe1ae48394ae71fac88fbc5f4fe28cc7255f9b..ca4a11aec0c01013615ec184b0b891c03a108401 100644 (file)
@@ -1,3 +1,13 @@
+2018-07-03  Tom Tromey  <tom@tromey.com>
+
+       * 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-07-03  Tom Tromey  <tom@tromey.com>
 
        * common/ptid.c (ptid_is_pid): Remove.
index 1e71104cdb787c66f23931b266fcb26106ec610f..9bf6e2d9a9277a2d95156a5010ca9def7a215cd0 100644 (file)
@@ -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)
 {
index 61a8d5f7104c4faf7350af799129743a09e907a1..8830dce2dc6cd75870d5aeece99af26c89ab6e36 100644 (file)
@@ -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);
index 474d6ae173c8792dcba051c087dd42aa789aeb3f..4967dcb7c51230b98afa2a70b12b9b4c0071d2d5 100644 (file)
@@ -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;
index 5d693659f0f9f76a663beb62a5a00f31b404aa68..1c12240c951913b7d57d87399890d2a1bd025124 100644 (file)
@@ -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 ();
@@ -3933,7 +3933,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))
     {
@@ -4663,7 +4663,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;
 }
 
index 20708fa41c8ee5738d5d3b3c8baed585a4cfe3d6..1c236c543d9e5c1935db96bee590e448641e682f 100644 (file)
@@ -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);
index 8aa87171635f68ce87fb9bfe180c8c7383f6fd95..5437fb406afd7aae660ccdd4c1e2bc7f88c07284 100644 (file)
@@ -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;
index 95248f2c17f8a3024c2a9561dcbf5d41a6706ce9..bb73c4a031507c6b674ae22045ec69b6d72e8d77 100644 (file)
@@ -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.  */
This page took 0.051632 seconds and 4 git commands to generate.