Reports the information associated with a pthread.
pthread debug library (libpthdebug.a)
#include <sys/pthdebug.h> int pthdb_pthread_arg (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_addr_t *argp) int pthdb_pthread_cancelpend (pthdb_session_t session, pthdb_pthread_t pthread, int *cancelpendp) int pthdb_pthread_cancelstate (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_cancelstate_t *cancelstatep) int pthdb_pthread_canceltype (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_canceltype_t *canceltypep) int pthdb_pthread_detachstate (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_detachstate_t *detachstatep) int pthdb_pthread_error (pthdb_session_t session, pthdb_pthread_t pthread, int *errorp) int pthdb_pthread_exit (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_addr_t *exitp) int pthdb_pthread_func (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_addr_t *funcp) int pthdb_pthread_ptid (pthdb_session_t session, pthdb_pthread_t pthread, pthread_t *ptidp) int pthdb_pthread_schedparam (pthdb_session_t session, pthdb_pthread_t pthread, struct sched_param *schedparamp); int pthdb_pthread_schedpolicy (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_schedpolicy_t *schedpolicyp) int pthdb_pthread_schedpriority (pthdb_session_t session, pthdb_pthread_t pthread, int *schedpriorityp) int pthdb_pthread_scope (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_scope_t *scopep) int pthdb_pthread_state (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_state_t *statep) int pthdb_pthread_suspendstate (pthdb_session_t session, pthdb_pthread_t pthread, pthdb_suspendstate_t *suspendstatep)
pthdb_pthread_arg reports the initial argument passed to the pthread's start function.
pthdb_pthread_cancelpend reports non-zero if cancellation is pending on the pthread; if not, it reports zero.
pthdb_pthread_cancelstate reports whether cancellation is enabled (PCS_ENABLE) or disabled (PCS_DISABLE). PCS_NOTSUP is reserved for unexpected results.
pthdb_pthread_canceltype reports whether cancellation is deferred (PCT_DEFERRED) or asynchronous (PCT_ASYNCHRONOUS). PCT_NOTSUP is reserved for unexpected results.
pthdb_pthread_detachstate reports whether the pthread is detached (PDS_DETACHED) or joinable (PDS_JOINABLE). PDS_NOTSUP is reserved for unexpected results.
pthdb_pthread_error reports the value of the thread errno for the pthread.
pthdb_pthread_exit reports the exit status returned by the pthread via pthread_exit. This is only valid if the pthread has exited (PST_TERM).
pthdb_pthread_func reports the address of the pthread's start function.
pthdb_pthread_ptid reports the pthread identifier (pthread_t) associated with the pthread.
pthdb_pthread_schedparam reports the pthread's scheduling parameters. This currently includes policy and priority.
pthdb_pthread_schedpolicy reports whether the pthread's scheduling policy is other (SP_OTHER), first in first out (SP_FIFO), or round robin (SP_RR). SP_NOTSUP is reserved for unexpected results.
pthdb_pthread_schedpriority reports the pthread's scheduling priority.
pthdb_pthread_scope reports whether the pthread has process scope (PS_PROCESS) or system scope (PS_SYSTEM). PS_NOTSUP is reserved for unexpected results.
pthdb_pthread_state reports whether the pthread is being created (PST_IDLE), currently running (PST_RUN), waiting on an event (PST_SLEEP), waiting on a cpu (PST_READY), or waiting on a join or detach (PST_TERM). PST_NOTSUP is reserved for unexpected results.
pthdb_pthread_suspendstate reports whether the pthread is suspended (PSS_SUSPENDED) or not (PSS_UNSUSPENDED). PSS_NOTSUP is reserved for unexpected results.
If successful, these functions return PTHDB_SUCCESS, else an error code is returned.
Error Codes
PTHDB_BAD_SESSION | Invalid session handle. |
PTHDB_BAD_PTHREAD | Invalid pthread handle. |
PTHDB_BAD_POINTER | Invalid buffer pointer. |
PTHDB_CALLBACK | Debugger call back error. |
PTHDB_NOTSUP | Not supported. |
PTHDB_INTERNAL | Error in library. |
These subroutines are part of Base Operating System (BOS) Runtime.
The pthdebug.h file.