|
0
|
1 #if !defined(DBG_THREADS_API_INCLUDED) |
|
|
2 #define DBG_THREADS_API_INCLUDED 1 |
|
|
3 /* These are the calls used to extract operating system specific information |
|
|
4 used in supporting thread aware debugging. |
|
|
5 The Operating Environment being debugged needs to supply these functions. |
|
|
6 */ |
|
|
7 |
|
|
8 /* |
|
|
9 * Copyright (c) 1998 Cygnus Support |
|
|
10 * |
|
|
11 * The authors hereby grant permission to use, copy, modify, distribute, |
|
|
12 * and license this software and its documentation for any purpose, provided |
|
|
13 * that existing copyright notices are retained in all copies and that this |
|
|
14 * notice is included verbatim in any distributions. No written agreement, |
|
|
15 * license, or royalty fee is required for any of the authorized uses. |
|
|
16 * Modifications to this software may be copyrighted by their authors |
|
|
17 * and need not follow the licensing terms described here, provided that |
|
|
18 * the new terms are clearly indicated on the first page of each file where |
|
|
19 * they apply. |
|
|
20 */ |
|
|
21 |
|
|
22 #define has_thread_void 0 |
|
|
23 #define has_thread_current 1 |
|
|
24 #define has_thread_registers 2 |
|
|
25 #define has_thread_reg_change 4 |
|
|
26 #define has_thread_list 8 |
|
|
27 #define has_thread_info 16 |
|
|
28 |
|
|
29 typedef unsigned char threadref[8] ; |
|
|
30 |
|
|
31 struct dbg_capabilities |
|
|
32 { |
|
|
33 unsigned long mask1 ; |
|
|
34 } ; |
|
|
35 |
|
|
36 |
|
|
37 /* fill in the list of thread aware capabilities */ |
|
|
38 extern int dbg_thread_capabilities(struct dbg_capabilities * cbp) ; |
|
|
39 |
|
|
40 |
|
|
41 /* Fillin the identifier of the current thread */ |
|
|
42 /* return 1 if defined, 0 if not defined */ |
|
|
43 extern int dbg_currthread(threadref * varparm) ; |
|
|
44 |
|
|
45 /* Return the unique ID number of the current thread. */ |
|
|
46 extern int dbg_currthread_id(void); |
|
|
47 |
|
|
48 /* get the first or next member of the list of known threads */ |
|
|
49 extern int dbg_threadlist(int startflag, |
|
|
50 threadref * lastthreadid, |
|
|
51 threadref * next_thread |
|
|
52 ) ; |
|
|
53 |
|
|
54 /* return 1 if next_threadid has been filled in with a value */ |
|
|
55 /* return 0 if there are none or no more */ |
|
|
56 |
|
|
57 /* The O.S can fill in the following information about a thread when queried. |
|
|
58 The structure of thise strings is determined by the O.S. |
|
|
59 It is display oriented, so figure out what the users need to see. |
|
|
60 Nulls are OK but GDB will fill some not so meaningful data. |
|
|
61 These pointers may be in the calles private structures, the info will |
|
|
62 get copied immediatly after the call to retreive it. |
|
|
63 */ |
|
|
64 struct cygmon_thread_debug_info |
|
|
65 { |
|
|
66 threadref thread_id ; |
|
|
67 int context_exists ; /* To the point where examining its state, |
|
|
68 registers and stack makes sense to GDB */ |
|
|
69 char * thread_display ; /* As shown in thread status window, name, state */ |
|
|
70 char * unique_thread_name ; /* human readable identifier, window label */ |
|
|
71 char * more_display ; /* more detailed info about thread. |
|
|
72 priority, queuedepth, state, stack usage, statistics */ |
|
|
73 } ; |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 extern int dbg_threadinfo( |
|
|
79 threadref * threadid, |
|
|
80 struct cygmon_thread_debug_info * info) ; |
|
|
81 |
|
|
82 /* Return 1 if threadid is defined and info copied, 0 otherwise */ |
|
|
83 |
|
|
84 /* The O.S should fillin the array of registers using values from the |
|
|
85 saves context. The array MUST be in GDB register save order even if |
|
|
86 the saved context is different or smaller. Do not alter the values of |
|
|
87 registers which are NOT in the O.S. thread context. Their default values |
|
|
88 have already been assigned. |
|
|
89 */ |
|
|
90 |
|
|
91 extern int dbg_getthreadreg( |
|
|
92 threadref * osthreadid, |
|
|
93 int regcount, /* count of registers in the array */ |
|
|
94 void * regval) ; /* fillin this array */ |
|
|
95 |
|
|
96 |
|
|
97 /* The O.S. should scan through this list of registers which are in |
|
|
98 GDB order and the O.S. should replace the values of all registers |
|
|
99 which are defined in the saved context of thread or process identified |
|
|
100 by osthreadid. Return 0 if the threadis does not map to a known |
|
|
101 process or other error. Return 1 if the setting is successful. */ |
|
|
102 |
|
|
103 extern int dbg_setthreadreg( |
|
|
104 threadref * osthreadid, |
|
|
105 int regcount , /* number of registers */ |
|
|
106 void * regval) ; |
|
|
107 |
|
|
108 #endif /* DBG_THREADS_API_INCLUDED */ |