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