OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [sys/] [linux/] [linuxthreads/] [thread_dbP.h] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/* Private header for thread debug library.  */
2
#ifndef _THREAD_DBP_H
3
#define _THREAD_DBP_H   1
4
 
5
#include <string.h>
6
#include "proc_service.h"
7
#include "thread_db.h"
8
#include "internals.h"
9
 
10
 
11
/* Indeces for the symbol names.  */
12
enum
13
  {
14
    PTHREAD_THREADS_EVENTS = 0,
15
    PTHREAD_LAST_EVENT,
16
    PTHREAD_HANDLES_NUM,
17
    PTHREAD_HANDLES,
18
    PTHREAD_KEYS,
19
    LINUXTHREADS_PTHREAD_THREADS_MAX,
20
    LINUXTHREADS_PTHREAD_KEYS_MAX,
21
    LINUXTHREADS_PTHREAD_SIZEOF_DESCR,
22
    LINUXTHREADS_CREATE_EVENT,
23
    LINUXTHREADS_DEATH_EVENT,
24
    LINUXTHREADS_REAP_EVENT,
25
    NUM_MESSAGES
26
  };
27
 
28
 
29
/* Comment out the following for less verbose output.  */
30
#ifndef NDEBUG
31
# define LOG(c) if (__td_debug) __libc_write (2, c "\n", strlen (c "\n"))
32
extern int __td_debug;
33
#else
34
# define LOG(c)
35
#endif
36
 
37
 
38
/* Handle for a process.  This type is opaque.  */
39
struct td_thragent
40
{
41
  /* Delivered by the debugger and we have to pass it back in the
42
     proc callbacks.  */
43
  struct ps_prochandle *ph;
44
 
45
  /* Some cached information.  */
46
 
47
  /* Address of the `__pthread_handles' array.  */
48
  struct pthread_handle_struct *handles;
49
 
50
  /* Address of the `pthread_kyes' array.  */
51
  struct pthread_key_struct *keys;
52
 
53
  /* Maximum number of threads.  */
54
  int pthread_threads_max;
55
 
56
  /* Maximum number of thread-local data keys.  */
57
  int pthread_keys_max;
58
 
59
  /* Size of 2nd level array for thread-local data keys.  */
60
  int pthread_key_2ndlevel_size;
61
 
62
  /* Sizeof struct _pthread_descr_struct.  */
63
  int sizeof_descr;
64
 
65
  /* Pointer to the `__pthread_threads_events' variable in the target.  */
66
  psaddr_t pthread_threads_eventsp;
67
 
68
  /* Pointer to the `__pthread_last_event' variable in the target.  */
69
  psaddr_t pthread_last_event;
70
 
71
  /* Pointer to the `__pthread_handles_num' variable.  */
72
  psaddr_t pthread_handles_num;
73
};
74
 
75
 
76
/* Type used internally to keep track of thread agent descriptors.  */
77
struct agent_list
78
{
79
  td_thragent_t *ta;
80
  struct agent_list *next;
81
};
82
 
83
/* List of all known descriptors.  */
84
extern struct agent_list *__td_agent_list;
85
 
86
/* Function used to test for correct thread agent pointer.  */
87
static inline int
88
ta_ok (const td_thragent_t *ta)
89
{
90
  struct agent_list *runp = __td_agent_list;
91
 
92
  if (ta == NULL)
93
    return 0;
94
 
95
  while (runp != NULL && runp->ta != ta)
96
    runp = runp->next;
97
 
98
  return runp != NULL;
99
}
100
 
101
 
102
/* Internal wrapper around ps_pglobal_lookup.  */
103
extern int td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr);
104
 
105
#endif /* thread_dbP.h */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.