]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove ptid_match
authorTom Tromey <tom@tromey.com>
Mon, 11 Jun 2018 20:35:00 +0000 (14:35 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 3 Jul 2018 17:36:45 +0000 (11:36 -0600)
This removes ptid_match in favor of the ptid_t::matches method.

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

* common/ptid.c (ptid_match): Remove.
* common/ptid.h (ptid_match): Don't declare.
* fbsd-nat.c: Update.
* infcmd.c: Update.
* infrun.c: Update.
* linux-nat.c: Update.
* record-btrace.c: Update.
* regcache.c: Update.
* remote.c: Update.

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

* server.c: Update.

12 files changed:
gdb/ChangeLog
gdb/common/ptid.c
gdb/common/ptid.h
gdb/fbsd-nat.c
gdb/gdbserver/ChangeLog
gdb/gdbserver/server.c
gdb/infcmd.c
gdb/infrun.c
gdb/linux-nat.c
gdb/record-btrace.c
gdb/regcache.c
gdb/remote.c

index 2072328414ccc42ce5d4efd2db6a5297cd8afd4f..e52d898d7af7a23ed9e67d79dda0515959b36394 100644 (file)
@@ -1,3 +1,15 @@
+2018-07-03  Tom Tromey  <tom@tromey.com>
+
+       * common/ptid.c (ptid_match): Remove.
+       * common/ptid.h (ptid_match): Don't declare.
+       * fbsd-nat.c: Update.
+       * infcmd.c: Update.
+       * infrun.c: Update.
+       * linux-nat.c: Update.
+       * record-btrace.c: Update.
+       * regcache.c: Update.
+       * remote.c: Update.
+
 2018-07-03  Tom Tromey  <tom@tromey.com>
 
        * common/ptid.c (ptid_tid_p): Remove.
index e0f62b10f1a6ca0cf41582cef30717839b9bafed..b9a331ad5eae35935a6a597743a07fd4d111d668 100644 (file)
@@ -32,11 +32,3 @@ ptid_equal (const ptid_t &ptid1, const ptid_t &ptid2)
 {
   return ptid1 == ptid2;
 }
-
-/* See ptid.h.  */
-
-int
-ptid_match (const ptid_t &ptid, const ptid_t &filter)
-{
-  return ptid.matches (filter);
-}
index 86878de905dbd6156809ba462375d2830926c2a3..2fc84b9c85688e2adda5d43fc17d02db52cb4191 100644 (file)
@@ -160,8 +160,4 @@ extern ptid_t minus_one_ptid;
 
 extern int ptid_equal (const ptid_t &ptid1, const ptid_t &ptid2);
 
-/* See ptid_t::matches.  */
-
-extern int ptid_match (const ptid_t &ptid, const ptid_t &filter);
-
 #endif
index 4967dcb7c51230b98afa2a70b12b9b4c0071d2d5..45428876968afcef08b02f86e889a50b0225a6b8 100644 (file)
@@ -1130,7 +1130,7 @@ fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
 
       ALL_NON_EXITED_THREADS (tp)
         {
-         if (!ptid_match (tp->ptid, ptid))
+         if (!tp->ptid.matches (ptid))
            continue;
 
          if (ptrace (PT_RESUME, tp->ptid.lwp (), NULL, 0) == -1)
index 52335cfa8e178177a428c150fb393a0101b8cef5..5e2d64e75f8bed43ee3a64d7d2d670dedc4b5cfd 100644 (file)
@@ -1,3 +1,7 @@
+2018-07-03  Tom Tromey  <tom@tromey.com>
+
+       * server.c: Update.
+
 2018-07-03  Tom Tromey  <tom@tromey.com>
 
        * linux-low.c: Update.
index 5c24315ecb878d25c2182654598a29aa50a72495..3c58c6eb10d66c91aae7fe5c2e080e87a1895e34 100644 (file)
@@ -190,7 +190,7 @@ remove_all_on_match_ptid (QUEUE (notif_event_p) *q,
   ptid_t filter_ptid = *(ptid_t *) data;
   struct vstop_notif *vstop_event = (struct vstop_notif *) event;
 
-  if (ptid_match (vstop_event->ptid, filter_ptid))
+  if (vstop_event->ptid.matches (filter_ptid))
     {
       if (q->free_func != NULL)
        q->free_func (event);
@@ -229,13 +229,13 @@ in_queued_stop_replies_ptid (QUEUE (notif_event_p) *q,
   ptid_t filter_ptid = *(ptid_t *) data;
   struct vstop_notif *vstop_event = (struct vstop_notif *) event;
 
-  if (ptid_match (vstop_event->ptid, filter_ptid))
+  if (vstop_event->ptid.matches (filter_ptid))
     return 0;
 
   /* Don't resume fork children that GDB does not know about yet.  */
   if ((vstop_event->status.kind == TARGET_WAITKIND_FORKED
        || vstop_event->status.kind == TARGET_WAITKIND_VFORKED)
-      && ptid_match (vstop_event->status.value.related_pid, filter_ptid))
+      && vstop_event->status.value.related_pid.matches (filter_ptid))
     return 0;
 
   return 1;
index 41322c6575fc516ecb6d21828fc4b2a62f1375a0..c9c70fb1aa69b6cfad61fe6643f8f803163d485e 100644 (file)
@@ -1351,7 +1351,7 @@ signal_command (const char *signum_exp, int from_tty)
        {
          if (ptid_equal (tp->ptid, inferior_ptid))
            continue;
-         if (!ptid_match (tp->ptid, resume_ptid))
+         if (!tp->ptid.matches (resume_ptid))
            continue;
 
          if (tp->suspend.stop_signal != GDB_SIGNAL_0
index c1a0cad17a872269cf12eacbcbe8b7361991e9df..c1214ee8ad0b501b7676693d117b030d826a6e8f 100644 (file)
@@ -2877,7 +2877,7 @@ clear_proceed_status (int step)
         we're about to resume, implicitly and explicitly.  */
       ALL_NON_EXITED_THREADS (tp)
         {
-         if (!ptid_match (tp->ptid, resume_ptid))
+         if (!tp->ptid.matches (resume_ptid))
            continue;
          clear_proceed_status_thread (tp);
        }
@@ -3095,7 +3095,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
            continue;
 
          /* Ignore threads of processes we're not resuming.  */
-         if (!ptid_match (tp->ptid, resume_ptid))
+         if (!tp->ptid.matches (resume_ptid))
            continue;
 
          if (!thread_still_needs_step_over (tp))
@@ -3149,7 +3149,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
        ALL_NON_EXITED_THREADS (tp)
         {
          /* Ignore threads of processes we're not resuming.  */
-         if (!ptid_match (tp->ptid, resume_ptid))
+         if (!tp->ptid.matches (resume_ptid))
            continue;
 
          if (tp->resumed)
@@ -3291,7 +3291,7 @@ infrun_thread_stop_requested (ptid_t ptid)
      thread had been temporarily paused for some step-over), set up
      for reporting the stop now.  */
   ALL_NON_EXITED_THREADS (tp)
-    if (ptid_match (tp->ptid, ptid))
+    if (tp->ptid.matches (ptid))
       {
        if (tp->state != THREAD_RUNNING)
          continue;
@@ -3453,7 +3453,7 @@ random_pending_event_thread (ptid_t waiton_ptid)
   /* First see how many events we have.  Count only resumed threads
      that have an event pending.  */
   ALL_NON_EXITED_THREADS (event_tp)
-    if (ptid_match (event_tp->ptid, waiton_ptid)
+    if (event_tp->ptid.matches (waiton_ptid)
        && event_tp->resumed
        && event_tp->suspend.waitstatus_pending_p)
       num_events++;
@@ -3472,7 +3472,7 @@ random_pending_event_thread (ptid_t waiton_ptid)
 
   /* Select the Nth thread that has had an event.  */
   ALL_NON_EXITED_THREADS (event_tp)
-    if (ptid_match (event_tp->ptid, waiton_ptid)
+    if (event_tp->ptid.matches (waiton_ptid)
        && event_tp->resumed
        && event_tp->suspend.waitstatus_pending_p)
       if (random_selector-- == 0)
index 1c12240c951913b7d57d87399890d2a1bd025124..c79d72cd051f69c945c4a010b89cfdeb580c7d2e 100644 (file)
@@ -958,7 +958,7 @@ iterate_over_lwps (ptid_t filter,
     {
       lpnext = lp->next;
 
-      if (ptid_match (lp->ptid, filter))
+      if (lp->ptid.matches (filter))
        {
          if ((*callback) (lp, data) != 0)
            return lp;
@@ -3513,7 +3513,7 @@ resume_stopped_resumed_lwps (struct lwp_info *lp, void *data)
 
          /* Don't bother if there's a breakpoint at PC that we'd hit
             immediately, and we're not waiting for this LWP.  */
-         if (!ptid_match (lp->ptid, *wait_ptid_p))
+         if (!lp->ptid.matches (*wait_ptid_p))
            {
              if (breakpoint_inserted_here_p (regcache->aspace (), pc))
                leave_stopped = 1;
index b67d71161946a1135767a8670a706471bd61a37c..09a3f6cc5c436c0c2416dd3c440ca726ceb0c29f 100644 (file)
@@ -1401,7 +1401,7 @@ record_btrace_target::record_is_replaying (ptid_t ptid)
   struct thread_info *tp;
 
   ALL_NON_EXITED_THREADS (tp)
-    if (ptid_match (tp->ptid, ptid) && btrace_is_replaying (tp))
+    if (tp->ptid.matches (ptid) && btrace_is_replaying (tp))
       return true;
 
   return false;
@@ -2178,12 +2178,12 @@ record_btrace_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
      For all-stop targets, we only step INFERIOR_PTID and continue others.  */
   if (!target_is_non_stop_p ())
     {
-      gdb_assert (ptid_match (inferior_ptid, ptid));
+      gdb_assert (inferior_ptid.matches (ptid));
 
       ALL_NON_EXITED_THREADS (tp)
-       if (ptid_match (tp->ptid, ptid))
+       if (tp->ptid.matches (ptid))
          {
-           if (ptid_match (tp->ptid, inferior_ptid))
+           if (tp->ptid.matches (inferior_ptid))
              record_btrace_resume_thread (tp, flag);
            else
              record_btrace_resume_thread (tp, cflag);
@@ -2192,7 +2192,7 @@ record_btrace_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
   else
     {
       ALL_NON_EXITED_THREADS (tp)
-       if (ptid_match (tp->ptid, ptid))
+       if (tp->ptid.matches (ptid))
          record_btrace_resume_thread (tp, flag);
     }
 
@@ -2555,7 +2555,7 @@ record_btrace_target::wait (ptid_t ptid, struct target_waitstatus *status,
 
     ALL_NON_EXITED_THREADS (tp)
       {
-       if (ptid_match (tp->ptid, ptid)
+       if (tp->ptid.matches (ptid)
            && ((tp->btrace.flags & (BTHR_MOVE | BTHR_STOP)) != 0))
          moving.push_back (tp);
       }
@@ -2682,7 +2682,7 @@ record_btrace_target::stop (ptid_t ptid)
       struct thread_info *tp;
 
       ALL_NON_EXITED_THREADS (tp)
-       if (ptid_match (tp->ptid, ptid))
+       if (tp->ptid.matches (ptid))
          {
            tp->btrace.flags &= ~BTHR_MOVE;
            tp->btrace.flags |= BTHR_STOP;
index 1e241de281a18d3f17183a5a4512f277ad809bb0..bc916f352eb28f6ad4b2fa1ef3ed38a508bceadf 100644 (file)
@@ -452,7 +452,7 @@ registers_changed_ptid (ptid_t ptid)
        it != regcache::current_regcache.end ();
        )
     {
-      if (ptid_match ((*it)->ptid (), ptid))
+      if ((*it)->ptid ().matches (ptid))
        {
          delete *it;
          it = regcache::current_regcache.erase_after (oit);
@@ -461,13 +461,13 @@ registers_changed_ptid (ptid_t ptid)
        oit = it++;
     }
 
-  if (ptid_match (current_thread_ptid, ptid))
+  if (current_thread_ptid.matches (ptid))
     {
       current_thread_ptid = null_ptid;
       current_thread_arch = NULL;
     }
 
-  if (ptid_match (inferior_ptid, ptid))
+  if (inferior_ptid.matches (ptid))
     {
       /* We just deleted the regcache of the current thread.  Need to
         forget about any frames we have cached, too.  */
index 834305831c57c04e1e724dadcc5bcc507c1ffd72..c72060fe23b4f688b806606fe39b02a9b4b07257 100644 (file)
@@ -6075,7 +6075,7 @@ remote_target::append_pending_thread_resumptions (char *p, char *endp,
   struct thread_info *thread;
 
   ALL_NON_EXITED_THREADS (thread)
-    if (ptid_match (thread->ptid, ptid)
+    if (thread->ptid.matches (ptid)
        && !ptid_equal (inferior_ptid, thread->ptid)
        && thread->suspend.stop_signal != GDB_SIGNAL_0)
       {