* aarch64-linux-nat.c: Replace PIDGET with ptid_get_pid.
[deliverable/binutils-gdb.git] / gdb / common / ptid.c
index 389d2b34d7f4b86a558b581bdee0e91a8e08ec84..e8d25c02d1895529b299156b189e1ac0a5e636e6 100644 (file)
@@ -1,8 +1,6 @@
 /* The ptid_t type and common functions operating on it.
 
-   Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1986-2013 Free Software Foundation, Inc.
    
    This file is part of GDB.
 
@@ -85,10 +83,33 @@ ptid_equal (ptid_t ptid1, ptid_t ptid2)
 int
 ptid_is_pid (ptid_t ptid)
 {
-  if (ptid_equal (minus_one_ptid, ptid))
-    return 0;
-  if (ptid_equal (null_ptid, ptid))
+  if (ptid_equal (minus_one_ptid, ptid)
+      || ptid_equal (null_ptid, ptid))
     return 0;
 
   return (ptid_get_lwp (ptid) == 0 && ptid_get_tid (ptid) == 0);
 }
+
+/* Returns true if PTID represents a lwp.  */
+
+int
+ptid_lwp_p (ptid_t ptid)
+{
+  if (ptid_equal (minus_one_ptid, ptid)
+      || ptid_equal (null_ptid, ptid))
+    return 0;
+
+  return (ptid_get_lwp (ptid) != 0);
+}
+
+/* Returns true if PTID represents a tid.  */
+
+int
+ptid_tid_p (ptid_t ptid)
+{
+  if (ptid_equal (minus_one_ptid, ptid)
+      || ptid_equal (null_ptid, ptid))
+    return 0;
+
+  return (ptid_get_tid (ptid) != 0);
+}
This page took 0.025719 seconds and 4 git commands to generate.