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

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

* common/ptid.c (ptid_is_pid): Remove.
* common/ptid.h (ptid_is_pid): Don't declare.
* infrun.c: Update.
* linux-nat.c: Update.
* mi/mi-interp.c: Update.
* remote.c: Update.
* thread.c: Update.

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

* linux-low.c: Update.

gdb/ChangeLog
gdb/common/ptid.c
gdb/common/ptid.h
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c
gdb/infrun.c
gdb/linux-nat.c
gdb/mi/mi-interp.c
gdb/remote.c
gdb/thread.c

index e0a3322e257b57bc2f4af9b8d1ad68db9c1369f3..5cbe1ae48394ae71fac88fbc5f4fe28cc7255f9b 100644 (file)
@@ -1,3 +1,13 @@
+2018-07-03  Tom Tromey  <tom@tromey.com>
+
+       * common/ptid.c (ptid_is_pid): Remove.
+       * common/ptid.h (ptid_is_pid): Don't declare.
+       * infrun.c: Update.
+       * linux-nat.c: Update.
+       * mi/mi-interp.c: Update.
+       * remote.c: Update.
+       * thread.c: Update.
+
 2018-07-03  Tom Tromey  <tom@tromey.com>
 
        * common/ptid.c (ptid_get_tid): Remove.
index 11ef61cf582d389892a03ddd22b392c67a82cf67..1e71104cdb787c66f23931b266fcb26106ec610f 100644 (file)
@@ -35,14 +35,6 @@ ptid_equal (const ptid_t &ptid1, const ptid_t &ptid2)
 
 /* See ptid.h.  */
 
-int
-ptid_is_pid (const ptid_t &ptid)
-{
-  return ptid.is_pid ();
-}
-
-/* See ptid.h.  */
-
 int
 ptid_lwp_p (const ptid_t &ptid)
 {
index e5cc7262931ab3ffa4b6f6906b9d808af71cfdd2..61a8d5f7104c4faf7350af799129743a09e907a1 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::is_pid.  */
-
-extern int ptid_is_pid (const ptid_t &ptid);
-
 /* See ptid_t::lwp_p.  */
 
 extern int ptid_lwp_p (const ptid_t &ptid);
index 5ecaf48a202f5bce2b1f64f08549f0d1bb2d6fa4..52335cfa8e178177a428c150fb393a0101b8cef5 100644 (file)
@@ -1,3 +1,7 @@
+2018-07-03  Tom Tromey  <tom@tromey.com>
+
+       * linux-low.c: Update.
+
 2018-07-03  Tom Tromey  <tom@tromey.com>
 
        * target.c: Update.
index a290b5b8b7360fdc74ea772e06437f133741050d..cef528bbb20fd9c70582873105534251d933c49d 100644 (file)
@@ -2635,7 +2635,7 @@ linux_wait_for_event_filtered (ptid_t wait_ptid, ptid_t filter_ptid,
 
   /* Check for a lwp with a pending status.  */
 
-  if (ptid_equal (filter_ptid, minus_one_ptid) || ptid_is_pid (filter_ptid))
+  if (ptid_equal (filter_ptid, minus_one_ptid) || filter_ptid.is_pid ())
     {
       event_thread = find_thread_in_random ([&] (thread_info *thread)
        {
@@ -4547,7 +4547,7 @@ linux_set_resume_request (thread_info *thread, thread_resume *resume, size_t n)
          /* Handle both 'pPID' and 'pPID.-1' as meaning 'all threads
             of PID'.  */
          || (ptid.pid () == pid_of (thread)
-             && (ptid_is_pid (ptid)
+             && (ptid.is_pid ()
                  || ptid.lwp () == -1)))
        {
          if (resume[ndx].kind == resume_stop
index 91c7d1e61da1b35998bcccc96506301def72ce87..c1a0cad17a872269cf12eacbcbe8b7361991e9df 100644 (file)
@@ -3493,7 +3493,7 @@ do_target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
 
   /* First check if there is a resumed thread with a wait status
      pending.  */
-  if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
+  if (ptid_equal (ptid, minus_one_ptid) || ptid.is_pid ())
     {
       tp = random_pending_event_thread (ptid);
     }
index d06bf7752b367b71d1d9f7ba732e44f054551321..5d693659f0f9f76a663beb62a5a00f31b404aa68 100644 (file)
@@ -1691,7 +1691,7 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
 
   /* A specific PTID means `step only this process id'.  */
   resume_many = (ptid_equal (minus_one_ptid, ptid)
-                || ptid_is_pid (ptid));
+                || ptid.is_pid ());
 
   /* Mark the lwps we're resuming as resumed.  */
   iterate_over_lwps (ptid, resume_set_callback, NULL);
@@ -3255,7 +3255,7 @@ linux_nat_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
   /* The first time we get here after starting a new inferior, we may
      not have added it to the LWP list yet - this is the earliest
      moment at which we know its PID.  */
-  if (ptid_is_pid (inferior_ptid))
+  if (inferior_ptid.is_pid ())
     {
       /* Upgrade the main thread's ptid.  */
       thread_change_ptid (inferior_ptid,
@@ -3389,7 +3389,7 @@ linux_nat_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
   /* If we're not waiting for a specific LWP, choose an event LWP from
      among those that have had events.  Giving equal priority to all
      LWPs that have had events helps prevent starvation.  */
-  if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
+  if (ptid_equal (ptid, minus_one_ptid) || ptid.is_pid ())
     select_event_lwp (ptid, &lp, &status);
 
   gdb_assert (lp != NULL);
index 1f368190f85d1f64ffd3927ca71bf61cec5b761c..9a48ee0c8fea319afbf89bc80f6321b549166c01 100644 (file)
@@ -970,7 +970,7 @@ mi_on_resume_1 (struct mi_interp *mi, ptid_t ptid)
 
   if (ptid.pid () == -1)
     fprintf_unfiltered (mi->raw_stdout, "*running,thread-id=\"all\"\n");
-  else if (ptid_is_pid (ptid))
+  else if (ptid.is_pid ())
     {
       int count = 0;
       inferior *inf;
@@ -1023,7 +1023,7 @@ mi_on_resume (ptid_t ptid)
 {
   struct thread_info *tp = NULL;
 
-  if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
+  if (ptid_equal (ptid, minus_one_ptid) || ptid.is_pid ())
     tp = inferior_thread ();
   else
     tp = find_thread_ptid (ptid);
index 0d64458cb17085f17147cf722f178c379b5fe75b..834305831c57c04e1e724dadcc5bcc507c1ffd72 100644 (file)
@@ -2435,7 +2435,7 @@ remote_target::remote_notice_new_inferior (ptid_t currthread, int executing)
       struct inferior *inf = NULL;
       int pid = currthread.pid ();
 
-      if (ptid_is_pid (inferior_ptid)
+      if (inferior_ptid.is_pid ()
          && pid == inferior_ptid.pid ())
        {
          /* inferior_ptid has no thread member yet.  This can happen
@@ -5998,7 +5998,7 @@ remote_target::append_resumption (char *p, char *endp,
              threads with a wildcard (though the protocol allows it,
              so stubs shouldn't make an active effort to forbid
              it).  */
-          && !(remote_multi_process_p (rs) && ptid_is_pid (ptid)))
+          && !(remote_multi_process_p (rs) && ptid.is_pid ()))
     {
       struct thread_info *tp;
 
@@ -6032,7 +6032,7 @@ remote_target::append_resumption (char *p, char *endp,
   else
     p += xsnprintf (p, endp - p, ";c");
 
-  if (remote_multi_process_p (rs) && ptid_is_pid (ptid))
+  if (remote_multi_process_p (rs) && ptid.is_pid ())
     {
       ptid_t nptid;
 
@@ -6185,7 +6185,7 @@ remote_target::remote_resume_with_vcont (ptid_t ptid, int step,
         a TID.  */
       append_resumption (p, endp, minus_one_ptid, step, siggnal);
     }
-  else if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
+  else if (ptid_equal (ptid, minus_one_ptid) || ptid.is_pid ())
     {
       /* Resume all threads (of all processes, or of a single
         process), with preference for INFERIOR_PTID.  This assumes
@@ -6244,7 +6244,7 @@ remote_target::resume (ptid_t ptid, int step, enum gdb_signal siggnal)
     {
       remote_thread_info *remote_thr;
 
-      if (ptid_equal (minus_one_ptid, ptid) || ptid_is_pid (ptid))
+      if (ptid_equal (minus_one_ptid, ptid) || ptid.is_pid ())
        remote_thr = get_remote_thread_info (inferior_ptid);
       else
        remote_thr = get_remote_thread_info (ptid);
@@ -6605,7 +6605,7 @@ remote_target::remote_stop_ns (ptid_t ptid)
     error (_("Remote server does not support stopping threads"));
 
   if (ptid_equal (ptid, minus_one_ptid)
-      || (!remote_multi_process_p (rs) && ptid_is_pid (ptid)))
+      || (!remote_multi_process_p (rs) && ptid.is_pid ()))
     p += xsnprintf (p, endp - p, "vCont;t");
   else
     {
@@ -6613,7 +6613,7 @@ remote_target::remote_stop_ns (ptid_t ptid)
 
       p += xsnprintf (p, endp - p, "vCont;t:");
 
-      if (ptid_is_pid (ptid))
+      if (ptid.is_pid ())
          /* All (-1) threads of process.  */
        nptid = ptid_t (ptid.pid (), -1, 0);
       else
@@ -11442,7 +11442,7 @@ remote_target::pid_to_str (ptid_t ptid)
 
   if (ptid_equal (ptid, null_ptid))
     return normal_pid_to_str (ptid);
-  else if (ptid_is_pid (ptid))
+  else if (ptid.is_pid ())
     {
       /* Printing an inferior target id.  */
 
index 3f3d6f2cc45966bf5c0d021cb054d91065a6bf5a..517a80715ea3bfabe965d084c47439d39ded7602 100644 (file)
@@ -799,7 +799,7 @@ set_resumed (ptid_t ptid, int resumed)
   struct thread_info *tp;
   int all = ptid == minus_one_ptid;
 
-  if (all || ptid_is_pid (ptid))
+  if (all || ptid.is_pid ())
     {
       for (tp = thread_list; tp; tp = tp->next)
        if (all || tp->ptid.pid () == ptid.pid ())
@@ -856,7 +856,7 @@ set_running (ptid_t ptid, int running)
   /* We try not to notify the observer if no thread has actually changed
      the running state -- merely to reduce the number of messages to
      frontend.  Frontend is supposed to handle multiple *running just fine.  */
-  if (all || ptid_is_pid (ptid))
+  if (all || ptid.is_pid ())
     {
       for (tp = thread_list; tp; tp = tp->next)
        if (all || tp->ptid.pid () == ptid.pid ())
@@ -936,7 +936,7 @@ set_executing (ptid_t ptid, int executing)
   struct thread_info *tp;
   int all = ptid == minus_one_ptid;
 
-  if (all || ptid_is_pid (ptid))
+  if (all || ptid.is_pid ())
     {
       for (tp = thread_list; tp; tp = tp->next)
        if (all || tp->ptid.pid () == ptid.pid ())
@@ -972,7 +972,7 @@ set_stop_requested (ptid_t ptid, int stop)
   struct thread_info *tp;
   int all = ptid == minus_one_ptid;
 
-  if (all || ptid_is_pid (ptid))
+  if (all || ptid.is_pid ())
     {
       for (tp = thread_list; tp; tp = tp->next)
        if (all || tp->ptid.pid () == ptid.pid ())
@@ -1000,7 +1000,7 @@ finish_thread_state (ptid_t ptid)
 
   all = ptid == minus_one_ptid;
 
-  if (all || ptid_is_pid (ptid))
+  if (all || ptid.is_pid ())
     {
       for (tp = thread_list; tp; tp = tp->next)
        {
This page took 0.04412 seconds and 4 git commands to generate.