]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move ptid_match to common/ptid.c.
authorHui Zhu <hui@codesourcery.com>
Thu, 27 Feb 2014 14:30:07 +0000 (14:30 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 27 Feb 2014 14:30:07 +0000 (14:30 +0000)
So that gdbserver can use it too.

gdb/
2014-02-27  Hui Zhu  <hui@codesourcery.com>

PR 12702
* infrun.c (ptid_match): Move ...
* common/ptid.c (ptid_match): ... here.
* inferior.h (ptid_match): Move ...
* common/ptid.h (ptid_match): ... here.

gdb/ChangeLog
gdb/common/ptid.c
gdb/common/ptid.h
gdb/inferior.h
gdb/infrun.c

index 59407ce9c28745cf54ae9c1deb4619ddc0234576..ad08c8e790d2c758b40c5655fb0085fb12e91875 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-27  Hui Zhu  <hui@codesourcery.com>
+
+       PR 12702
+       * infrun.c (ptid_match): Move ...
+       * common/ptid.c (ptid_match): ... here.
+       * inferior.h (ptid_match): Move ...
+       * common/ptid.h (ptid_match): ... here.
+
 2014-02-27  Mark Kettenis  <kettenis@gnu.org>
 
        * mips64obsd-tdep.c (mips64obsd_init_abi): Call obsd_init_abi.
index 49354ad28016d9b4cce79a922f8e577c5431984e..f614669f93f1cf45aa7006827313a9603b4c1d55 100644 (file)
@@ -114,3 +114,17 @@ ptid_tid_p (ptid_t ptid)
 
   return (ptid_get_tid (ptid) != 0);
 }
+
+int
+ptid_match (ptid_t ptid, ptid_t filter)
+{
+  if (ptid_equal (filter, minus_one_ptid))
+    return 1;
+  if (ptid_is_pid (filter)
+      && ptid_get_pid (ptid) == ptid_get_pid (filter))
+    return 1;
+  else if (ptid_equal (ptid, filter))
+    return 1;
+
+  return 0;
+}
index cc1825e9bef46c35ea4f354d4352311c735f99f6..e151a14c935c8b1637b22d25a85c317261f2639f 100644 (file)
@@ -83,4 +83,14 @@ int ptid_lwp_p (ptid_t ptid);
 /* Return true if PTID's tid member is non-zero.  */
 int ptid_tid_p (ptid_t ptid);
 
+/* Returns true if PTID matches filter FILTER.  FILTER can be the wild
+   card MINUS_ONE_PTID (all ptid match it); can be a ptid representing
+   a process (ptid_is_pid returns true), in which case, all lwps and
+   threads of that given process match, lwps and threads of other
+   processes do not; or, it can represent a specific thread, in which
+   case, only that thread will match true.  PTID must represent a
+   specific LWP or THREAD, it can never be a wild card.  */
+
+extern int ptid_match (ptid_t ptid, ptid_t filter);
+
 #endif
index 43e035b8e9c0e25bf021d0b0e38c08ceb38ab79f..9f6375e734ff2beee56ebca18d6a6f97143a43d3 100644 (file)
@@ -65,16 +65,6 @@ extern void discard_infcall_control_state (struct infcall_control_state *);
 extern struct regcache *
   get_infcall_suspend_state_regcache (struct infcall_suspend_state *);
 
-/* Returns true if PTID matches filter FILTER.  FILTER can be the wild
-   card MINUS_ONE_PTID (all ptid match it); can be a ptid representing
-   a process (ptid_is_pid returns true), in which case, all lwps and
-   threads of that given process match, lwps and threads of other
-   processes do not; or, it can represent a specific thread, in which
-   case, only that thread will match true.  PTID must represent a
-   specific LWP or THREAD, it can never be a wild card.  */
-
-extern int ptid_match (ptid_t ptid, ptid_t filter);
-
 /* Save value of inferior_ptid so that it may be restored by
    a later call to do_cleanups().  Returns the struct cleanup
    pointer needed for later doing the cleanup.  */
index 5d60a908a2abc8070849c430b7ac296b88beba79..042d5fa76ac6c62ee1aaa406d304fc2f85ccbf65 100644 (file)
@@ -7092,20 +7092,6 @@ discard_infcall_control_state (struct infcall_control_state *inf_status)
   xfree (inf_status);
 }
 \f
-int
-ptid_match (ptid_t ptid, ptid_t filter)
-{
-  if (ptid_equal (filter, minus_one_ptid))
-    return 1;
-  if (ptid_is_pid (filter)
-      && ptid_get_pid (ptid) == ptid_get_pid (filter))
-    return 1;
-  else if (ptid_equal (ptid, filter))
-    return 1;
-
-  return 0;
-}
-
 /* restore_inferior_ptid() will be used by the cleanup machinery
    to restore the inferior_ptid value saved in a call to
    save_inferior_ptid().  */