1 /* Inferior process information for the remote server for GDB.
2 Copyright (C) 1993-2017 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
30 struct raw_breakpoint
;
31 struct fast_tracepoint_jump
;
32 struct process_info_private
;
36 /* This process' pid. */
39 /* Nonzero if this child process was attached rather than
43 /* True if GDB asked us to detach from this process, but we remained
47 /* The symbol cache. */
48 struct sym_cache
*symbol_cache
;
50 /* The list of memory breakpoints. */
51 struct breakpoint
*breakpoints
;
53 /* The list of raw memory breakpoints. */
54 struct raw_breakpoint
*raw_breakpoints
;
56 /* The list of installed fast tracepoints. */
57 struct fast_tracepoint_jump
*fast_tracepoint_jumps
;
59 /* The list of syscalls to report, or just a single element, ANY_SYSCALL,
60 for unfiltered syscall reporting. */
61 VEC (int) *syscalls_to_catch
;
63 const struct target_desc
*tdesc
;
65 /* Private target data. */
66 struct process_info_private
*priv
;
69 /* Get the pid of PROC. */
72 pid_of (const process_info
*proc
)
77 /* Return a pointer to the process that corresponds to the current
78 thread (current_thread). It is an error to call this if there is
79 no current thread selected. */
81 struct process_info
*current_process (void);
82 struct process_info
*get_thread_process (const struct thread_info
*);
84 extern std::list
<process_info
*> all_processes
;
86 /* Invoke FUNC for each process. */
88 template <typename Func
>
90 for_each_process (Func func
)
92 std::list
<process_info
*>::iterator next
, cur
= all_processes
.begin ();
94 while (cur
!= all_processes
.end ())
103 /* Find the first process for which FUNC returns true. Return NULL if no
104 process satisfying FUNC is found. */
106 template <typename Func
>
107 static process_info
*
108 find_process (Func func
)
110 std::list
<process_info
*>::iterator next
, cur
= all_processes
.begin ();
112 while (cur
!= all_processes
.end ())
126 extern struct thread_info
*current_thread
;
128 /* Return the first process in the processes list. */
129 struct process_info
*get_first_process (void);
131 struct process_info
*add_process (int pid
, int attached
);
132 void remove_process (struct process_info
*process
);
133 struct process_info
*find_process_pid (int pid
);
134 int have_started_inferiors_p (void);
135 int have_attached_inferiors_p (void);
137 void clear_inferiors (void);
139 thread_info
*find_inferior (std::list
<thread_info
*> *thread_list
,
140 int (*func
) (thread_info
*, void *), void *arg
);
141 thread_info
*find_inferior_id (std::list
<thread_info
*> *thread_list
,
143 thread_info
*find_inferior_in_random (std::list
<thread_info
*> *thread_list
,
144 int (*func
) (thread_info
*, void *),
146 void for_each_inferior (std::list
<thread_info
*> *thread_list
,
147 void (*action
) (thread_info
*));
148 void for_each_inferior_with_data (std::list
<thread_info
*> *thread_list
,
149 void (*action
) (thread_info
*, void *),
152 void *thread_target_data (struct thread_info
*);
153 struct regcache
*thread_regcache_data (struct thread_info
*);
154 void set_thread_regcache_data (struct thread_info
*, struct regcache
*);
156 #endif /* INFERIORS_H */
This page took 0.035385 seconds and 4 git commands to generate.