aboutsummaryrefslogtreecommitdiff
path: root/gdb/common/ptid.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/common/ptid.c')
-rw-r--r--gdb/common/ptid.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c
index 506b5c2..e8d25c0 100644
--- a/gdb/common/ptid.c
+++ b/gdb/common/ptid.c
@@ -83,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);
+}