Rename inferior_list_entry uses from "head" to "entry" for consistency.
[deliverable/binutils-gdb.git] / gdb / gdbserver / inferiors.h
CommitLineData
270c6aea 1/* Inferior process information for the remote server for GDB.
ecd75fc8 2 Copyright (C) 1993-2014 Free Software Foundation, Inc.
270c6aea
PA
3
4 This file is part of GDB.
5
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.
10
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.
15
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/>. */
18
19#ifndef INFERIORS_H
20#define INFERIORS_H
21
22/* Generic information for tracking a list of ``inferiors'' - threads,
23 processes, etc. */
24struct inferior_list
25{
26 struct inferior_list_entry *head;
27 struct inferior_list_entry *tail;
28};
29struct inferior_list_entry
30{
31 ptid_t id;
32 struct inferior_list_entry *next;
33};
34
35struct thread_info;
36struct target_desc;
37struct sym_cache;
38struct breakpoint;
39struct raw_breakpoint;
40struct fast_tracepoint_jump;
41struct process_info_private;
42
43struct process_info
44{
80894984
DE
45 /* This must appear first.
46 The list iterator functions assume it. */
47 struct inferior_list_entry entry;
270c6aea
PA
48
49 /* Nonzero if this child process was attached rather than
50 spawned. */
51 int attached;
52
53 /* True if GDB asked us to detach from this process, but we remained
54 attached anyway. */
55 int gdb_detached;
56
57 /* The symbol cache. */
58 struct sym_cache *symbol_cache;
59
60 /* The list of memory breakpoints. */
61 struct breakpoint *breakpoints;
62
63 /* The list of raw memory breakpoints. */
64 struct raw_breakpoint *raw_breakpoints;
65
66 /* The list of installed fast tracepoints. */
67 struct fast_tracepoint_jump *fast_tracepoint_jumps;
68
69 const struct target_desc *tdesc;
70
71 /* Private target data. */
72 struct process_info_private *private;
73};
74
75/* Return a pointer to the process that corresponds to the current
76 thread (current_inferior). It is an error to call this if there is
77 no current thread selected. */
78
79struct process_info *current_process (void);
80struct process_info *get_thread_process (struct thread_info *);
81
82extern struct inferior_list all_processes;
83
84void add_inferior_to_list (struct inferior_list *list,
85 struct inferior_list_entry *new_inferior);
86void for_each_inferior (struct inferior_list *list,
87 void (*action) (struct inferior_list_entry *));
88
89extern struct thread_info *current_inferior;
90void remove_inferior (struct inferior_list *list,
91 struct inferior_list_entry *entry);
92
93struct process_info *add_process (int pid, int attached);
94void remove_process (struct process_info *process);
95struct process_info *find_process_pid (int pid);
96int have_started_inferiors_p (void);
97int have_attached_inferiors_p (void);
98
270c6aea
PA
99ptid_t thread_to_gdb_id (struct thread_info *);
100ptid_t gdb_id_to_thread_id (ptid_t);
101
102void clear_inferiors (void);
103struct inferior_list_entry *find_inferior
104 (struct inferior_list *,
105 int (*func) (struct inferior_list_entry *,
106 void *),
107 void *arg);
108struct inferior_list_entry *find_inferior_id (struct inferior_list *list,
109 ptid_t id);
80894984 110
270c6aea
PA
111void *inferior_target_data (struct thread_info *);
112void set_inferior_target_data (struct thread_info *, void *);
113void *inferior_regcache_data (struct thread_info *);
114void set_inferior_regcache_data (struct thread_info *, void *);
115
116#endif /* INFERIORS_H */
This page took 0.071091 seconds and 4 git commands to generate.