GDB (API)
/home/stan/gdb/src/gdb/common/ptid.h
Go to the documentation of this file.
00001 /* The ptid_t type and common functions operating on it.
00002 
00003    Copyright (C) 1986-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #ifndef PTID_H
00021 #define PTID_H
00022 
00023 /* The ptid struct is a collection of the various "ids" necessary for
00024    identifying the inferior process/thread being debugged.  This
00025    consists of the process id (pid), lightweight process id (lwp) and
00026    thread id (tid).  When manipulating ptids, the constructors,
00027    accessors, and predicates declared in this file should be used.  Do
00028    NOT access the struct ptid members directly.  */
00029 
00030 struct ptid
00031 {
00032   /* Process id.  */
00033   int pid;
00034 
00035   /* Lightweight process id.  */
00036   long lwp;
00037 
00038   /* Thread id.  */
00039   long tid;
00040 };
00041 
00042 typedef struct ptid ptid_t;
00043 
00044 /* The null or zero ptid, often used to indicate no process. */
00045 extern ptid_t null_ptid;
00046 
00047 /* The (-1,0,0) ptid, often used to indicate either an error condition
00048    or a "don't care" condition, i.e, "run all threads."  */
00049 extern ptid_t minus_one_ptid;
00050 
00051 /* Make a ptid given the necessary PID, LWP, and TID components.  */
00052 ptid_t ptid_build (int pid, long lwp, long tid);
00053 
00054 /* Make a new ptid from just a pid.  This ptid is usually used to
00055    represent a whole process, including all its lwps/threads.  */
00056 ptid_t pid_to_ptid (int pid);
00057 
00058 /* Fetch the pid (process id) component from a ptid.  */
00059 int ptid_get_pid (ptid_t ptid);
00060 
00061 /* Fetch the lwp (lightweight process) component from a ptid.  */
00062 long ptid_get_lwp (ptid_t ptid);
00063 
00064 /* Fetch the tid (thread id) component from a ptid.  */
00065 long ptid_get_tid (ptid_t ptid);
00066 
00067 /* Compare two ptids to see if they are equal.  */
00068 int ptid_equal (ptid_t ptid1, ptid_t ptid2);
00069 
00070 /* Returns true if PTID represents a whole process, including all its
00071    lwps/threads.  Such ptids have the form of (pid,0,0), with pid !=
00072    -1.  */
00073 int ptid_is_pid (ptid_t ptid);
00074 
00075 /* Return true if PTID's lwp member is non-zero.  */
00076 int ptid_lwp_p (ptid_t ptid);
00077 
00078 /* Return true if PTID's tid member is non-zero.  */
00079 int ptid_tid_p (ptid_t ptid);
00080 
00081 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines