]>
Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Multi-process/thread control defs for GDB, the GNU debugger. |
0d06e24b | 2 | Copyright 1987, 88, 89, 90, 91, 92, 1993, 1998, 1999, 2000 |
c906108c SS |
3 | |
4 | Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. | |
5 | Free Software Foundation, Inc. | |
6 | ||
c5aa993b | 7 | This file is part of GDB. |
c906108c | 8 | |
c5aa993b JM |
9 | This program is free software; you can redistribute it and/or modify |
10 | it under the terms of the GNU General Public License as published by | |
11 | the Free Software Foundation; either version 2 of the License, or | |
12 | (at your option) any later version. | |
c906108c | 13 | |
c5aa993b JM |
14 | This program is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
c906108c | 18 | |
c5aa993b JM |
19 | You should have received a copy of the GNU General Public License |
20 | along with this program; if not, write to the Free Software | |
21 | Foundation, Inc., 59 Temple Place - Suite 330, | |
22 | Boston, MA 02111-1307, USA. */ | |
c906108c SS |
23 | |
24 | #ifndef GDBTHREAD_H | |
25 | #define GDBTHREAD_H | |
26 | ||
27 | /* For bpstat */ | |
28 | #include "breakpoint.h" | |
29 | ||
0d06e24b JM |
30 | struct thread_info |
31 | { | |
32 | struct thread_info *next; | |
33 | int pid; /* "Actual process id"; | |
34 | In fact, this may be overloaded with | |
35 | kernel thread id, etc. */ | |
36 | int num; /* Convenient handle (GDB thread id) */ | |
37 | /* State from wait_for_inferior */ | |
38 | CORE_ADDR prev_pc; | |
39 | CORE_ADDR prev_func_start; | |
40 | char *prev_func_name; | |
41 | struct breakpoint *step_resume_breakpoint; | |
42 | struct breakpoint *through_sigtramp_breakpoint; | |
43 | CORE_ADDR step_range_start; | |
44 | CORE_ADDR step_range_end; | |
45 | CORE_ADDR step_frame_address; | |
46 | int trap_expected; | |
47 | int handling_longjmp; | |
48 | int another_trap; | |
49 | ||
50 | /* This is set TRUE when a catchpoint of a shared library event | |
51 | triggers. Since we don't wish to leave the inferior in the | |
52 | solib hook when we report the event, we step the inferior | |
53 | back to user code before stopping and reporting the event. */ | |
54 | int stepping_through_solib_after_catch; | |
55 | ||
56 | /* When stepping_through_solib_after_catch is TRUE, this is a | |
57 | list of the catchpoints that should be reported as triggering | |
58 | when we finally do stop stepping. */ | |
59 | bpstat stepping_through_solib_catchpoints; | |
60 | ||
61 | /* This is set to TRUE when this thread is in a signal handler | |
62 | trampoline and we're single-stepping through it. */ | |
63 | int stepping_through_sigtramp; | |
64 | ||
65 | /* Private data used by the target vector implementation. */ | |
66 | struct private_thread_info *private; | |
67 | }; | |
68 | ||
69 | /* Create an empty thread list, or empty the existing one. */ | |
70 | extern void init_thread_list (void); | |
71 | ||
72 | /* Add a thread to the thread list. | |
73 | Note that add_thread now returns the handle of the new thread, | |
74 | so that the caller may initialize the private thread data. */ | |
75 | extern struct thread_info *add_thread (int pid); | |
76 | ||
77 | /* Delete an existing thread list entry. */ | |
78 | extern void delete_thread (int); | |
79 | ||
80 | /* Translate the integer thread id (GDB's homegrown id, not the system's) | |
81 | into a "pid" (which may be overloaded with extra thread information). */ | |
82 | extern int thread_id_to_pid (int); | |
83 | ||
84 | /* Translate a 'pid' (which may be overloaded with extra thread information) | |
85 | into the integer thread id (GDB's homegrown id, not the system's). */ | |
86 | extern int pid_to_thread_id (int pid); | |
87 | ||
88 | /* Boolean test for an already-known pid (which may be overloaded with | |
89 | extra thread information). */ | |
90 | extern int in_thread_list (int pid); | |
91 | ||
92 | /* Boolean test for an already-known thread id (GDB's homegrown id, | |
93 | not the system's). */ | |
94 | extern int valid_thread_id (int thread); | |
95 | ||
96 | /* Search function to lookup a thread by 'pid'. */ | |
97 | extern struct thread_info *find_thread_pid (int pid); | |
98 | ||
99 | /* Iterator function to call a user-provided callback function | |
100 | once for each known thread. */ | |
101 | typedef int (*thread_callback_func) (struct thread_info *, void *); | |
102 | extern struct thread_info *iterate_over_threads (thread_callback_func, void *); | |
103 | ||
104 | /* infrun context switch: save the debugger state for the given thread. */ | |
105 | extern void save_infrun_state (int pid, | |
106 | CORE_ADDR prev_pc, | |
107 | CORE_ADDR prev_func_start, | |
108 | char *prev_func_name, | |
109 | int trap_expected, | |
110 | struct breakpoint *step_resume_breakpoint, | |
111 | struct breakpoint *through_sigtramp_breakpoint, | |
112 | CORE_ADDR step_range_start, | |
113 | CORE_ADDR step_range_end, | |
114 | CORE_ADDR step_frame_address, | |
115 | int handling_longjmp, | |
116 | int another_trap, | |
117 | int stepping_through_solib_after_catch, | |
118 | bpstat stepping_through_solib_catchpoints, | |
119 | int stepping_through_sigtramp); | |
120 | ||
121 | /* infrun context switch: load the debugger state previously saved | |
122 | for the given thread. */ | |
123 | extern void load_infrun_state (int pid, | |
124 | CORE_ADDR *prev_pc, | |
125 | CORE_ADDR *prev_func_start, | |
126 | char **prev_func_name, | |
127 | int *trap_expected, | |
128 | struct breakpoint **step_resume_breakpoint, | |
129 | struct breakpoint **through_sigtramp_breakpoint, | |
130 | CORE_ADDR *step_range_start, | |
131 | CORE_ADDR *step_range_end, | |
132 | CORE_ADDR *step_frame_address, | |
133 | int *handling_longjmp, | |
134 | int *another_trap, | |
135 | int *stepping_through_solib_affter_catch, | |
136 | bpstat *stepping_through_solib_catchpoints, | |
137 | int *stepping_through_sigtramp); | |
c906108c SS |
138 | |
139 | /* Commands with a prefix of `thread'. */ | |
140 | extern struct cmd_list_element *thread_cmd_list; | |
141 | ||
c5aa993b | 142 | #endif /* GDBTHREAD_H */ |