198944Sobrien#ifdef HAVE_THREAD_DB_H
298944Sobrien#include <thread_db.h>
398944Sobrien#else
498944Sobrien
598944Sobrien#ifdef HAVE_STDINT_H
698944Sobrien#include <stdint.h>
798944Sobrientypedef uint32_t gdb_uint32_t;
898944Sobrien#define GDB_UINT32_C(c)	UINT32_C(c)
998944Sobrien#else
1098944Sobrientypedef unsigned int gdb_uint32_t;
1198944Sobrien#define GDB_UINT32_C(c)	c ## U
1298944Sobrien#endif
1398944Sobrien
1498944Sobrien/* Copyright 1999, 2000 Free Software Foundation, Inc.
1598944Sobrien   This file is part of the GNU C Library.
1698944Sobrien
1798944Sobrien   The GNU C Library is free software; you can redistribute it and/or
1898944Sobrien   modify it under the terms of the GNU Library General Public License as
1998944Sobrien   published by the Free Software Foundation; either version 2 of the
2098944Sobrien   License, or (at your option) any later version.
2198944Sobrien
2298944Sobrien   The GNU C Library is distributed in the hope that it will be useful,
2398944Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
2498944Sobrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2598944Sobrien   Library General Public License for more details.
2698944Sobrien
2798944Sobrien   You should have received a copy of the GNU Library General Public
2898944Sobrien   License along with the GNU C Library; see the file COPYING.LIB.  If not,
2998944Sobrien   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3098944Sobrien   Boston, MA 02111-1307, USA.  */
3198944Sobrien
3298944Sobrien#ifndef _THREAD_DB_H
3398944Sobrien#define _THREAD_DB_H	1
3498944Sobrien
3598944Sobrien/* This is the debugger interface for the LinuxThreads library.  It is
3698944Sobrien   modelled closely after the interface with same names in Solaris with
3798944Sobrien   the goal to share the same code in the debugger.  */
3898944Sobrien#include <pthread.h>
3998944Sobrien#include <sys/types.h>
4098944Sobrien#include <sys/procfs.h>
4198944Sobrien
4298944Sobrien
4398944Sobrien/* Error codes of the library.  */
4498944Sobrientypedef enum
4598944Sobrien{
4698944Sobrien  TD_OK,	  /* No error.  */
4798944Sobrien  TD_ERR,	  /* No further specified error.  */
4898944Sobrien  TD_NOTHR,	  /* No matching thread found.  */
4998944Sobrien  TD_NOSV,	  /* No matching synchronization handle found.  */
5098944Sobrien  TD_NOLWP,	  /* No matching light-weighted process found.  */
5198944Sobrien  TD_BADPH,	  /* Invalid process handle.  */
5298944Sobrien  TD_BADTH,	  /* Invalid thread handle.  */
5398944Sobrien  TD_BADSH,	  /* Invalid synchronization handle.  */
5498944Sobrien  TD_BADTA,	  /* Invalid thread agent.  */
5598944Sobrien  TD_BADKEY,	  /* Invalid key.  */
5698944Sobrien  TD_NOMSG,	  /* No event available.  */
5798944Sobrien  TD_NOFPREGS,	  /* No floating-point register content available.  */
5898944Sobrien  TD_NOLIBTHREAD, /* Application not linked with thread library.  */
5998944Sobrien  TD_NOEVENT,	  /* Requested event is not supported.  */
6098944Sobrien  TD_NOCAPAB,	  /* Capability not available.  */
6198944Sobrien  TD_DBERR,	  /* Internal debug library error.  */
6298944Sobrien  TD_NOAPLIC,	  /* Operation is not applicable.  */
6398944Sobrien  TD_NOTSD,	  /* No thread-specific data available.  */
6498944Sobrien  TD_MALLOC,	  /* Out of memory.  */
6598944Sobrien  TD_PARTIALREG,  /* Not entire register set was read or written.  */
66130803Smarcel  TD_NOXREGS,	  /* X register set not available for given thread.  */
67130803Smarcel  TD_NOTALLOC	  /* TLS memory not yet allocated.  */
6898944Sobrien} td_err_e;
6998944Sobrien
7098944Sobrien
7198944Sobrien/* Possible thread states.  TD_THR_ANY_STATE is a pseudo-state used to
7298944Sobrien   select threads regardless of state in td_ta_thr_iter().  */
7398944Sobrientypedef enum
7498944Sobrien{
7598944Sobrien  TD_THR_ANY_STATE,
7698944Sobrien  TD_THR_UNKNOWN,
7798944Sobrien  TD_THR_STOPPED,
7898944Sobrien  TD_THR_RUN,
7998944Sobrien  TD_THR_ACTIVE,
8098944Sobrien  TD_THR_ZOMBIE,
8198944Sobrien  TD_THR_SLEEP,
8298944Sobrien  TD_THR_STOPPED_ASLEEP
8398944Sobrien} td_thr_state_e;
8498944Sobrien
8598944Sobrien/* Thread type: user or system.  TD_THR_ANY_TYPE is a pseudo-type used
8698944Sobrien   to select threads regardless of type in td_ta_thr_iter().  */
8798944Sobrientypedef enum
8898944Sobrien{
8998944Sobrien  TD_THR_ANY_TYPE,
9098944Sobrien  TD_THR_USER,
9198944Sobrien  TD_THR_SYSTEM
9298944Sobrien} td_thr_type_e;
9398944Sobrien
9498944Sobrien
9598944Sobrien/* Types of the debugging library.  */
9698944Sobrien
9798944Sobrien/* Handle for a process.  This type is opaque.  */
9898944Sobrientypedef struct td_thragent td_thragent_t;
9998944Sobrien
10098944Sobrien/* The actual thread handle type.  This is also opaque.  */
10198944Sobrientypedef struct td_thrhandle
10298944Sobrien{
10398944Sobrien  td_thragent_t *th_ta_p;
10498944Sobrien  psaddr_t th_unique;
10598944Sobrien} td_thrhandle_t;
10698944Sobrien
10798944Sobrien
10898944Sobrien/* Flags for `td_ta_thr_iter'.  */
10998944Sobrien#define TD_THR_ANY_USER_FLAGS	0xffffffff
11098944Sobrien#define TD_THR_LOWEST_PRIORITY	-20
11198944Sobrien#define TD_SIGNO_MASK		NULL
11298944Sobrien
11398944Sobrien
11498944Sobrien#define TD_EVENTSIZE	2
11598944Sobrien#define BT_UISHIFT	5 /* log base 2 of BT_NBIPUI, to extract word index */
11698944Sobrien#define BT_NBIPUI	(1 << BT_UISHIFT)       /* n bits per uint */
11798944Sobrien#define BT_UIMASK	(BT_NBIPUI - 1)         /* to extract bit index */
11898944Sobrien
11998944Sobrien/* Bitmask of enabled events. */
12098944Sobrientypedef struct td_thr_events
12198944Sobrien{
12298944Sobrien  gdb_uint32_t event_bits[TD_EVENTSIZE];
12398944Sobrien} td_thr_events_t;
12498944Sobrien
12598944Sobrien/* Event set manipulation macros. */
12698944Sobrien#define __td_eventmask(n) \
12798944Sobrien  (GDB_UINT32_C (1) << (((n) - 1) & BT_UIMASK))
12898944Sobrien#define __td_eventword(n) \
12998944Sobrien  ((GDB_UINT32_C ((n) - 1)) >> BT_UISHIFT)
13098944Sobrien
13198944Sobrien#define td_event_emptyset(setp) \
13298944Sobrien  do {									      \
13398944Sobrien    int __i;								      \
13498944Sobrien    for (__i = TD_EVENTSIZE; __i > 0; --__i)				      \
13598944Sobrien      (setp)->event_bits[__i - 1] = 0;					      \
13698944Sobrien  } while (0)
13798944Sobrien
13898944Sobrien#define td_event_fillset(setp) \
13998944Sobrien  do {									      \
14098944Sobrien    int __i;								      \
14198944Sobrien    for (__i = TD_EVENTSIZE; __i > 0; --__i)				      \
14298944Sobrien      (setp)->event_bits[__i - 1] = GDB_UINT32_C (0xffffffff);		      \
14398944Sobrien  } while (0)
14498944Sobrien
14598944Sobrien#define td_event_addset(setp, n) \
14698944Sobrien  (((setp)->event_bits[__td_eventword (n)]) |= __td_eventmask (n))
14798944Sobrien#define td_event_delset(setp, n) \
14898944Sobrien  (((setp)->event_bits[__td_eventword (n)]) &= ~__td_eventmask (n))
14998944Sobrien#define td_eventismember(setp, n) \
15098944Sobrien  (__td_eventmask (n) & ((setp)->event_bits[__td_eventword (n)]))
15198944Sobrien#if TD_EVENTSIZE == 2
15298944Sobrien# define td_eventisempty(setp) \
15398944Sobrien  (!((setp)->event_bits[0]) && !((setp)->event_bits[1]))
15498944Sobrien#else
15598944Sobrien# error "td_eventisempty must be changed to match TD_EVENTSIZE"
15698944Sobrien#endif
15798944Sobrien
15898944Sobrien/* Events reportable by the thread implementation.  */
15998944Sobrientypedef enum
16098944Sobrien{
16198944Sobrien  TD_ALL_EVENTS,		 /* Pseudo-event number.  */
16298944Sobrien  TD_EVENT_NONE = TD_ALL_EVENTS, /* Depends on context.  */
16398944Sobrien  TD_READY,			 /* Is executable now. */
16498944Sobrien  TD_SLEEP,			 /* Blocked in a synchronization obj.  */
16598944Sobrien  TD_SWITCHTO,			 /* Now assigned to a process.  */
16698944Sobrien  TD_SWITCHFROM,		 /* Not anymore assigned to a process.  */
16798944Sobrien  TD_LOCK_TRY,			 /* Trying to get an unavailable lock.  */
16898944Sobrien  TD_CATCHSIG,			 /* Signal posted to the thread.  */
16998944Sobrien  TD_IDLE,			 /* Process getting idle.  */
17098944Sobrien  TD_CREATE,			 /* New thread created.  */
17198944Sobrien  TD_DEATH,			 /* Thread terminated.  */
17298944Sobrien  TD_PREEMPT,			 /* Preempted.  */
17398944Sobrien  TD_PRI_INHERIT,		 /* Inherited elevated priority.  */
17498944Sobrien  TD_REAP,			 /* Reaped.  */
17598944Sobrien  TD_CONCURRENCY,		 /* Number of processes changing.  */
17698944Sobrien  TD_TIMEOUT,			 /* Conditional variable wait timed out.  */
17798944Sobrien  TD_MIN_EVENT_NUM = TD_READY,
17898944Sobrien  TD_MAX_EVENT_NUM = TD_TIMEOUT,
17998944Sobrien  TD_EVENTS_ENABLE = 31		/* Event reporting enabled.  */
18098944Sobrien} td_event_e;
18198944Sobrien
18298944Sobrien/* Values representing the different ways events are reported.  */
18398944Sobrientypedef enum
18498944Sobrien{
18598944Sobrien  NOTIFY_BPT,			/* User must insert breakpoint at u.bptaddr. */
18698944Sobrien  NOTIFY_AUTOBPT,		/* Breakpoint at u.bptaddr is automatically
18798944Sobrien				   inserted.  */
18898944Sobrien  NOTIFY_SYSCALL		/* System call u.syscallno will be invoked.  */
18998944Sobrien} td_notify_e;
19098944Sobrien
19198944Sobrien/* Description how event type is reported.  */
19298944Sobrientypedef struct td_notify
19398944Sobrien{
19498944Sobrien  td_notify_e type;		/* Way the event is reported.  */
19598944Sobrien  union
19698944Sobrien  {
19798944Sobrien    psaddr_t bptaddr;		/* Address of breakpoint.  */
19898944Sobrien    int syscallno;		/* Number of system call used.  */
19998944Sobrien  } u;
20098944Sobrien} td_notify_t;
20198944Sobrien
202130803Smarcel/* Some people still have libc5 or old glibc with no uintptr_t.
203130803Smarcel   They lose.  glibc 2.1.3 was released on 2000-02-25, and it has
204130803Smarcel   uintptr_t, so it's reasonable to force these people to upgrade.  */
205130803Smarcel
206130803Smarcel#ifndef HAVE_UINTPTR_T
207130803Smarcel#error No uintptr_t available; your C library is too old.
208130803Smarcel/* Inhibit further compilation errors after this error.  */
209130803Smarcel#define uintptr_t void *
210130803Smarcel#endif
211130803Smarcel
21298944Sobrien/* Structure used to report event.  */
21398944Sobrientypedef struct td_event_msg
21498944Sobrien{
21598944Sobrien  td_event_e event;		/* Event type being reported.  */
21698944Sobrien  const td_thrhandle_t *th_p;	/* Thread reporting the event.  */
21798944Sobrien  union
21898944Sobrien  {
21998944Sobrien#if 0
22098944Sobrien    td_synchandle_t *sh;	/* Handle of synchronization object.  */
22198944Sobrien#endif
22298944Sobrien    uintptr_t data;		/* Event specific data.  */
22398944Sobrien  } msg;
22498944Sobrien} td_event_msg_t;
22598944Sobrien
22698944Sobrien/* Structure containing event data available in each thread structure.  */
22798944Sobrientypedef struct
22898944Sobrien{
22998944Sobrien  td_thr_events_t eventmask;	/* Mask of enabled events.  */
23098944Sobrien  td_event_e eventnum;		/* Number of last event.  */
23198944Sobrien  void *eventdata;		/* Data associated with event.  */
23298944Sobrien} td_eventbuf_t;
23398944Sobrien
23498944Sobrien
23598944Sobrien/* Gathered statistics about the process.  */
23698944Sobrientypedef struct td_ta_stats
23798944Sobrien{
23898944Sobrien  int nthreads;       		/* Total number of threads in use.  */
23998944Sobrien  int r_concurrency;		/* Concurrency level requested by user.  */
24098944Sobrien  int nrunnable_num;		/* Average runnable threads, numerator.  */
24198944Sobrien  int nrunnable_den;		/* Average runnable threads, denominator.  */
24298944Sobrien  int a_concurrency_num;	/* Achieved concurrency level, numerator.  */
24398944Sobrien  int a_concurrency_den;	/* Achieved concurrency level, denominator.  */
24498944Sobrien  int nlwps_num;		/* Average number of processes in use,
24598944Sobrien				   numerator.  */
24698944Sobrien  int nlwps_den;		/* Average number of processes in use,
24798944Sobrien				   denominator.  */
24898944Sobrien  int nidle_num;		/* Average number of idling processes,
24998944Sobrien				   numerator.  */
25098944Sobrien  int nidle_den;		/* Average number of idling processes,
25198944Sobrien				   denominator.  */
25298944Sobrien} td_ta_stats_t;
25398944Sobrien
25498944Sobrien
25598944Sobrien/* Since Sun's library is based on Solaris threads we have to define a few
25698944Sobrien   types to map them to POSIX threads.  */
25798944Sobrientypedef pthread_t thread_t;
25898944Sobrientypedef pthread_key_t thread_key_t;
25998944Sobrien
26098944Sobrien
26198944Sobrien/* Callback for iteration over threads.  */
26298944Sobrientypedef int td_thr_iter_f (const td_thrhandle_t *, void *);
26398944Sobrien
26498944Sobrien/* Callback for iteration over thread local data.  */
26598944Sobrientypedef int td_key_iter_f (thread_key_t, void (*) (void *), void *);
26698944Sobrien
26798944Sobrien
26898944Sobrien
26998944Sobrien/* Forward declaration.  This has to be defined by the user.  */
27098944Sobrienstruct ps_prochandle;
27198944Sobrien
27298944Sobrien
27398944Sobrien/* Information about the thread.  */
27498944Sobrientypedef struct td_thrinfo
27598944Sobrien{
27698944Sobrien  td_thragent_t *ti_ta_p;		/* Process handle.  */
27798944Sobrien  unsigned int ti_user_flags;		/* Unused.  */
27898944Sobrien  thread_t ti_tid;			/* Thread ID returned by
27998944Sobrien					   pthread_create().  */
28098944Sobrien  char *ti_tls;				/* Pointer to thread-local data.  */
28198944Sobrien  psaddr_t ti_startfunc;		/* Start function passed to
28298944Sobrien					   pthread_create().  */
28398944Sobrien  psaddr_t ti_stkbase;			/* Base of thread's stack.  */
28498944Sobrien  long int ti_stksize;			/* Size of thread's stack.  */
28598944Sobrien  psaddr_t ti_ro_area;			/* Unused.  */
28698944Sobrien  int ti_ro_size;			/* Unused.  */
28798944Sobrien  td_thr_state_e ti_state;		/* Thread state.  */
28898944Sobrien  unsigned char ti_db_suspended;	/* Nonzero if suspended by debugger. */
28998944Sobrien  td_thr_type_e ti_type;		/* Type of the thread (system vs
29098944Sobrien					   user thread).  */
29198944Sobrien  intptr_t ti_pc;			/* Unused.  */
29298944Sobrien  intptr_t ti_sp;			/* Unused.  */
29398944Sobrien  short int ti_flags;			/* Unused.  */
29498944Sobrien  int ti_pri;				/* Thread priority.  */
29598944Sobrien  lwpid_t ti_lid;			/* Unused.  */
29698944Sobrien  sigset_t ti_sigmask;			/* Signal mask.  */
29798944Sobrien  unsigned char ti_traceme;		/* Nonzero if event reporting
29898944Sobrien					   enabled.  */
29998944Sobrien  unsigned char ti_preemptflag;		/* Unused.  */
30098944Sobrien  unsigned char ti_pirecflag;		/* Unused.  */
30198944Sobrien  sigset_t ti_pending;			/* Set of pending signals.  */
30298944Sobrien  td_thr_events_t ti_events;		/* Set of enabled events.  */
30398944Sobrien} td_thrinfo_t;
30498944Sobrien
30598944Sobrien
30698944Sobrien
30798944Sobrien/* Prototypes for exported library functions.  */
30898944Sobrien
30998944Sobrien/* Initialize the thread debug support library.  */
31098944Sobrienextern td_err_e td_init (void);
31198944Sobrien
31298944Sobrien/* Historical relict.  Should not be used anymore.  */
31398944Sobrienextern td_err_e td_log (void);
31498944Sobrien
31598944Sobrien/* Generate new thread debug library handle for process PS.  */
31698944Sobrienextern td_err_e td_ta_new (struct ps_prochandle *__ps, td_thragent_t **__ta);
31798944Sobrien
31898944Sobrien/* Free resources allocated for TA.  */
31998944Sobrienextern td_err_e td_ta_delete (td_thragent_t *__ta);
32098944Sobrien
32198944Sobrien/* Get number of currently running threads in process associated with TA.  */
32298944Sobrienextern td_err_e td_ta_get_nthreads (const td_thragent_t *__ta, int *__np);
32398944Sobrien
32498944Sobrien/* Return process handle passed in `td_ta_new' for process associated with
32598944Sobrien   TA.  */
32698944Sobrienextern td_err_e td_ta_get_ph (const td_thragent_t *__ta,
32798944Sobrien			      struct ps_prochandle **__ph);
32898944Sobrien
32998944Sobrien/* Map thread library handle PT to thread debug library handle for process
33098944Sobrien   associated with TA and store result in *TH.  */
33198944Sobrienextern td_err_e td_ta_map_id2thr (const td_thragent_t *__ta, pthread_t __pt,
33298944Sobrien				  td_thrhandle_t *__th);
33398944Sobrien
33498944Sobrien/* Map process ID LWPID to thread debug library handle for process
33598944Sobrien   associated with TA and store result in *TH.  */
33698944Sobrienextern td_err_e td_ta_map_lwp2thr (const td_thragent_t *__ta, lwpid_t __lwpid,
33798944Sobrien				   td_thrhandle_t *__th);
33898944Sobrien
33998944Sobrien
34098944Sobrien/* Call for each thread in a process associated with TA the callback function
34198944Sobrien   CALLBACK.  */
34298944Sobrienextern td_err_e td_ta_thr_iter (const td_thragent_t *__ta,
34398944Sobrien				td_thr_iter_f *__callback, void *__cbdata_p,
34498944Sobrien				td_thr_state_e __state, int __ti_pri,
34598944Sobrien				sigset_t *__ti_sigmask_p,
34698944Sobrien				unsigned int __ti_user_flags);
34798944Sobrien
34898944Sobrien/* Call for each defined thread local data entry the callback function KI.  */
34998944Sobrienextern td_err_e td_ta_tsd_iter (const td_thragent_t *__ta, td_key_iter_f *__ki,
35098944Sobrien				void *__p);
35198944Sobrien
35298944Sobrien
35398944Sobrien/* Get event address for EVENT.  */
35498944Sobrienextern td_err_e td_ta_event_addr (const td_thragent_t *__ta,
35598944Sobrien				  td_event_e __event, td_notify_t *__ptr);
35698944Sobrien
35798944Sobrien/* Enable EVENT in global mask.  */
35898944Sobrienextern td_err_e td_ta_set_event (const td_thragent_t *__ta,
35998944Sobrien				 td_thr_events_t *__event);
36098944Sobrien
36198944Sobrien/* Disable EVENT in global mask.  */
36298944Sobrienextern td_err_e td_ta_clear_event (const td_thragent_t *__ta,
36398944Sobrien				   td_thr_events_t *__event);
36498944Sobrien
36598944Sobrien/* Return information about last event.  */
36698944Sobrienextern td_err_e td_ta_event_getmsg (const td_thragent_t *__ta,
36798944Sobrien				    td_event_msg_t *msg);
36898944Sobrien
36998944Sobrien
37098944Sobrien/* Set suggested concurrency level for process associated with TA.  */
37198944Sobrienextern td_err_e td_ta_setconcurrency (const td_thragent_t *__ta, int __level);
37298944Sobrien
37398944Sobrien
37498944Sobrien/* Enable collecting statistics for process associated with TA.  */
37598944Sobrienextern td_err_e td_ta_enable_stats (const td_thragent_t *__ta, int __enable);
37698944Sobrien
37798944Sobrien/* Reset statistics.  */
37898944Sobrienextern td_err_e td_ta_reset_stats (const td_thragent_t *__ta);
37998944Sobrien
38098944Sobrien/* Retrieve statistics from process associated with TA.  */
38198944Sobrienextern td_err_e td_ta_get_stats (const td_thragent_t *__ta,
38298944Sobrien				 td_ta_stats_t *__statsp);
38398944Sobrien
38498944Sobrien
38598944Sobrien/* Validate that TH is a thread handle.  */
38698944Sobrienextern td_err_e td_thr_validate (const td_thrhandle_t *__th);
38798944Sobrien
38898944Sobrien/* Return information about thread TH.  */
38998944Sobrienextern td_err_e td_thr_get_info (const td_thrhandle_t *__th,
39098944Sobrien				 td_thrinfo_t *__infop);
39198944Sobrien
39298944Sobrien/* Retrieve floating-point register contents of process running thread TH.  */
39398944Sobrienextern td_err_e td_thr_getfpregs (const td_thrhandle_t *__th,
39498944Sobrien				  prfpregset_t *__regset);
39598944Sobrien
39698944Sobrien/* Retrieve general register contents of process running thread TH.  */
39798944Sobrienextern td_err_e td_thr_getgregs (const td_thrhandle_t *__th,
39898944Sobrien				 prgregset_t __gregs);
39998944Sobrien
40098944Sobrien/* Retrieve extended register contents of process running thread TH.  */
40198944Sobrienextern td_err_e td_thr_getxregs (const td_thrhandle_t *__th, void *__xregs);
40298944Sobrien
40398944Sobrien/* Get size of extended register set of process running thread TH.  */
40498944Sobrienextern td_err_e td_thr_getxregsize (const td_thrhandle_t *__th, int *__sizep);
40598944Sobrien
40698944Sobrien/* Set floating-point register contents of process running thread TH.  */
40798944Sobrienextern td_err_e td_thr_setfpregs (const td_thrhandle_t *__th,
40898944Sobrien				  const prfpregset_t *__fpregs);
40998944Sobrien
41098944Sobrien/* Set general register contents of process running thread TH.  */
41198944Sobrienextern td_err_e td_thr_setgregs (const td_thrhandle_t *__th,
41298944Sobrien				 prgregset_t __gregs);
41398944Sobrien
41498944Sobrien/* Set extended register contents of process running thread TH.  */
41598944Sobrienextern td_err_e td_thr_setxregs (const td_thrhandle_t *__th,
41698944Sobrien				 const void *__addr);
41798944Sobrien
41898944Sobrien
41998944Sobrien/* Enable reporting for EVENT for thread TH.  */
42098944Sobrienextern td_err_e td_thr_event_enable (const td_thrhandle_t *__th, int __event);
42198944Sobrien
42298944Sobrien/* Enable EVENT for thread TH.  */
42398944Sobrienextern td_err_e td_thr_set_event (const td_thrhandle_t *__th,
42498944Sobrien				  td_thr_events_t *__event);
42598944Sobrien
42698944Sobrien/* Disable EVENT for thread TH.  */
42798944Sobrienextern td_err_e td_thr_clear_event (const td_thrhandle_t *__th,
42898944Sobrien				    td_thr_events_t *__event);
42998944Sobrien
43098944Sobrien/* Get event message for thread TH.  */
43198944Sobrienextern td_err_e td_thr_event_getmsg (const td_thrhandle_t *__th,
43298944Sobrien				     td_event_msg_t *__msg);
43398944Sobrien
43498944Sobrien
43598944Sobrien/* Set priority of thread TH.  */
43698944Sobrienextern td_err_e td_thr_setprio (const td_thrhandle_t *__th, int __prio);
43798944Sobrien
43898944Sobrien
43998944Sobrien/* Set pending signals for thread TH.  */
44098944Sobrienextern td_err_e td_thr_setsigpending (const td_thrhandle_t *__th,
44198944Sobrien				      unsigned char __n, const sigset_t *__ss);
44298944Sobrien
44398944Sobrien/* Set signal mask for thread TH.  */
44498944Sobrienextern td_err_e td_thr_sigsetmask (const td_thrhandle_t *__th,
44598944Sobrien				   const sigset_t *__ss);
44698944Sobrien
44798944Sobrien
44898944Sobrien/* Return thread local data associated with key TK in thread TH.  */
44998944Sobrienextern td_err_e td_thr_tsd (const td_thrhandle_t *__th,
45098944Sobrien			    const thread_key_t __tk, void **__data);
45198944Sobrien
45298944Sobrien
45398944Sobrien/* Suspend execution of thread TH.  */
45498944Sobrienextern td_err_e td_thr_dbsuspend (const td_thrhandle_t *__th);
45598944Sobrien
45698944Sobrien/* Resume execution of thread TH.  */
45798944Sobrienextern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
45898944Sobrien
45998944Sobrien#endif	/* thread_db.h */
46098944Sobrien
46198944Sobrien#endif /* HAVE_THREAD_DB_H */
462