* gdb_thread_db.h [HAVE_THREAD_DB_H]: Include <thread_db.h>.

[!HAVE_THREAD_DB_H]: Update from current glibc thread_db.h.  Deal
with absence of <stdint.h> here.
This commit is contained in:
Mark Kettenis 2000-09-03 12:06:58 +00:00
parent 110be7c974
commit 574dd9a998
2 changed files with 68 additions and 41 deletions

View File

@ -1,5 +1,9 @@
2000-09-03 Mark Kettenis <kettenis@gnu.org> 2000-09-03 Mark Kettenis <kettenis@gnu.org>
* gdb_thread_db.h [HAVE_THREAD_DB_H]: Include <thread_db.h>.
[!HAVE_THREAD_DB_H]: Update from current glibc thread_db.h. Deal
with absence of <stdint.h> here.
* gdb_proc_service.h: Add copyright notice. * gdb_proc_service.h: Add copyright notice.
Protect against multiple inclusion. Protect against multiple inclusion.
Add fix for broken prfpregset_t here. Add fix for broken prfpregset_t here.

View File

@ -1,3 +1,16 @@
#ifdef HAVE_THREAD_DB_H
#include <thread_db.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
typedef uint32_t gdb_uint32_t;
#define GDB_UINT32_C(c) UINT32_C(c)
#else
typedef unsigned int gdb_uint32_t;
#define GDB_UINT32_C(c) c ## U
#endif
/* Copyright (C) 1999 Free Software Foundation, Inc. /* Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -23,9 +36,8 @@
modelled closely after the interface with same names in Solaris with modelled closely after the interface with same names in Solaris with
the goal to share the same code in the debugger. */ the goal to share the same code in the debugger. */
#include <pthread.h> #include <pthread.h>
#include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
/*#include <sys/ucontext.h>*/ #include <sys/procfs.h>
/* Error codes of the library. */ /* Error codes of the library. */
@ -81,9 +93,6 @@ typedef enum
/* Types of the debugging library. */ /* Types of the debugging library. */
/* Addresses. */
/*typedef void *psaddr_t;*/
/* Handle for a process. This type is opaque. */ /* Handle for a process. This type is opaque. */
typedef struct td_thragent td_thragent_t; typedef struct td_thragent td_thragent_t;
@ -109,14 +118,14 @@ typedef struct td_thrhandle
/* Bitmask of enabled events. */ /* Bitmask of enabled events. */
typedef struct td_thr_events typedef struct td_thr_events
{ {
uint32_t event_bits[TD_EVENTSIZE]; gdb_uint32_t event_bits[TD_EVENTSIZE];
} td_thr_events_t; } td_thr_events_t;
/* Event set manipulation macros. */ /* Event set manipulation macros. */
#define __td_eventmask(n) \ #define __td_eventmask(n) \
(UINT32_C (1) << (((n) - 1) & BT_UIMASK)) (GDB_UINT32_C (1) << (((n) - 1) & BT_UIMASK))
#define __td_eventword(n) \ #define __td_eventword(n) \
((UINT32_C ((n) - 1)) >> BT_UISHIFT) ((GDB_UINT32_C ((n) - 1)) >> BT_UISHIFT)
#define td_event_emptyset(setp) \ #define td_event_emptyset(setp) \
do { \ do { \
@ -129,7 +138,7 @@ typedef struct td_thr_events
do { \ do { \
int __i; \ int __i; \
for (__i = TD_EVENTSIZE; __i > 0; --__i) \ for (__i = TD_EVENTSIZE; __i > 0; --__i) \
(setp)->event_bits[__i - 1] = UINT32_C (0xffffffff); \ (setp)->event_bits[__i - 1] = GDB_UINT32_C (0xffffffff); \
} while (0) } while (0)
#define td_event_addset(setp, n) \ #define td_event_addset(setp, n) \
@ -203,6 +212,14 @@ typedef struct td_event_msg
} msg; } msg;
} td_event_msg_t; } td_event_msg_t;
/* Structure containing event data available in each thread structure. */
typedef struct
{
td_thr_events_t eventmask; /* Mask of enabled events. */
td_event_e eventnum; /* Number of last event. */
void *eventdata; /* Data associated with event. */
} td_eventbuf_t;
/* Gathered statistics about the process. */ /* Gathered statistics about the process. */
typedef struct td_ta_stats typedef struct td_ta_stats
@ -229,26 +246,18 @@ typedef struct td_ta_stats
typedef pthread_t thread_t; typedef pthread_t thread_t;
typedef pthread_key_t thread_key_t; typedef pthread_key_t thread_key_t;
/* Linux has different names for the register set types. */
/*typedef gregset_t prgregset_t;*/
/*typedef fpregset_t prfpregset_t;*/
/* Callback for iteration over threads. */ /* Callback for iteration over threads. */
typedef int td_thr_iter_f __P ((const td_thrhandle_t *, void *)); typedef int td_thr_iter_f (const td_thrhandle_t *, void *);
/* Callback for iteration over thread local data. */ /* Callback for iteration over thread local data. */
typedef int td_key_iter_f __P ((thread_key_t, void (*) (void *), void *)); typedef int td_key_iter_f (thread_key_t, void (*) (void *), void *);
/* Forward declaration. This has to be defined by the user. */ /* Forward declaration. This has to be defined by the user. */
struct ps_prochandle; struct ps_prochandle;
/* We don't have any differences between processes and threads, therefore
have only one PID type. */
/*typedef pid_t lwpid_t;*/
/* Information about the thread. */ /* Information about the thread. */
typedef struct td_thrinfo typedef struct td_thrinfo
@ -334,6 +343,18 @@ extern td_err_e td_ta_tsd_iter (const td_thragent_t *__ta, td_key_iter_f *__ki,
extern td_err_e td_ta_event_addr (const td_thragent_t *__ta, extern td_err_e td_ta_event_addr (const td_thragent_t *__ta,
td_event_e __event, td_notify_t *__ptr); td_event_e __event, td_notify_t *__ptr);
/* Enable EVENT in global mask. */
extern td_err_e td_ta_set_event (const td_thragent_t *__ta,
td_thr_events_t *__event);
/* Disable EVENT in global mask. */
extern td_err_e td_ta_clear_event (const td_thragent_t *__ta,
td_thr_events_t *__event);
/* Return information about last event. */
extern td_err_e td_ta_event_getmsg (const td_thragent_t *__ta,
td_event_msg_t *msg);
/* Set suggested concurrency level for process associated with TA. */ /* Set suggested concurrency level for process associated with TA. */
extern td_err_e td_ta_setconcurrency (const td_thragent_t *__ta, int __level); extern td_err_e td_ta_setconcurrency (const td_thragent_t *__ta, int __level);
@ -425,3 +446,5 @@ extern td_err_e td_thr_dbsuspend (const td_thrhandle_t *__th);
extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th); extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th);
#endif /* thread_db.h */ #endif /* thread_db.h */
#endif /* HAVE_THREAD_DB_H */