SVR4 names don't have underscores, according to the ABI.
[deliverable/binutils-gdb.git] / gdb / inferior.h
CommitLineData
bd5635a1
RP
1/* Variables that describe the inferior process running under GDB:
2 Where it is, why it stopped, and how to step it.
cc221e76 3 Copyright 1986, 1989, 1992 Free Software Foundation, Inc.
bd5635a1
RP
4
5This file is part of GDB.
6
bdbd5f50 7This program is free software; you can redistribute it and/or modify
bd5635a1 8it under the terms of the GNU General Public License as published by
bdbd5f50
JG
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
bd5635a1 11
bdbd5f50 12This program is distributed in the hope that it will be useful,
bd5635a1
RP
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
bdbd5f50
JG
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
bd5635a1 20
cc221e76
FF
21#if !defined (INFERIOR_H)
22#define INFERIOR_H 1
23
24/* For symtab_and_line */
25#include "symtab.h"
26
bd5635a1
RP
27/* For bpstat. */
28#include "breakpoint.h"
29
30/* For FRAME_ADDR. */
31#include "frame.h"
32
33/*
34 * Structure in which to save the status of the inferior. Save
35 * through "save_inferior_status", restore through
36 * "restore_inferior_status".
37 * This pair of routines should be called around any transfer of
38 * control to the inferior which you don't want showing up in your
39 * control variables.
40 */
41struct inferior_status {
42 int pc_changed;
43 int stop_signal;
44 int stop_pc;
45 FRAME_ADDR stop_frame_address;
46 bpstat stop_bpstat;
47 int stop_step;
48 int stop_stack_dummy;
49 int stopped_by_random_signal;
50 int trap_expected;
51 CORE_ADDR step_range_start;
52 CORE_ADDR step_range_end;
53 FRAME_ADDR step_frame_address;
54 int step_over_calls;
55 CORE_ADDR step_resume_break_address;
56 int stop_after_trap;
57 int stop_soon_quietly;
58 FRAME_ADDR selected_frame_address;
59 int selected_level;
60 char stop_registers[REGISTER_BYTES];
61 int breakpoint_proceeded;
62 int restore_stack_info;
63 int proceed_to_finish;
64};
65
cc221e76
FF
66extern void
67save_inferior_status PARAMS ((struct inferior_status *, int));
68
69extern void
70restore_inferior_status PARAMS ((struct inferior_status *));
bd5635a1
RP
71
72/* File name for default use for standard in/out in the inferior. */
73
74extern char *inferior_io_terminal;
75
76/* Pid of our debugged inferior, or 0 if no inferior now. */
77
78extern int inferior_pid;
79
80/* Character array containing an image of the inferior programs' registers. */
81
82extern char registers[];
83
cc221e76
FF
84extern void
85clear_proceed_status PARAMS ((void));
86
87extern void
88proceed PARAMS ((CORE_ADDR, int, int));
89
90extern void
91kill_inferior PARAMS ((void));
92
93extern void
94kill_inferior_fast PARAMS ((void));
95
96extern void
97generic_mourn_inferior PARAMS ((void));
98
99extern void
100terminal_ours PARAMS ((void));
101
102extern void
103run_stack_dummy PARAMS ((CORE_ADDR, char [REGISTER_BYTES]));
104
105extern CORE_ADDR
106read_pc PARAMS ((void));
107
108extern void
109write_pc PARAMS ((CORE_ADDR));
110
111extern void
112wait_for_inferior PARAMS ((void));
113
114extern void
115init_wait_for_inferior PARAMS ((void));
116
117extern void
118close_exec_file PARAMS ((void));
119
120extern void
121reopen_exec_file PARAMS ((void));
122
123/* From misc files */
124
125extern void
126store_inferior_registers PARAMS ((int));
127
128extern void
129fetch_inferior_registers PARAMS ((int));
130
131extern void
132solib_create_inferior_hook PARAMS ((void));
133
134extern void
135child_mourn_inferior PARAMS ((void));
136
137extern void
138child_terminal_info PARAMS ((char *, int));
139
140extern void
141term_info PARAMS ((char *, int));
142
143extern void
144terminal_ours_for_output PARAMS ((void));
145
146extern void
147terminal_inferior PARAMS ((void));
148
149extern void
150terminal_init_inferior PARAMS ((void));
151
152/* From infptrace.c or procfs.c */
153
154extern int
155attach PARAMS ((int));
156
157void
158detach PARAMS ((int));
159
160extern void
161child_resume PARAMS ((int, int));
162
163/* From procfs.c */
164
165#ifdef USE_PROC_FS
166
167extern int
168proc_iterate_over_mappings PARAMS ((int (*) (int, CORE_ADDR)));
169
170extern int
171proc_wait PARAMS ((int *));
172
173extern void
174inferior_proc_init PARAMS ((int));
175
176extern void
177proc_signal_handling_change PARAMS ((void));
178
179extern void
180proc_set_exec_trap PARAMS ((void));
bd5635a1 181
bdbd5f50 182#endif
cc221e76
FF
183
184/* From inflow.c */
185
186extern void
187new_tty_prefork PARAMS ((char *));
188
189/* From infrun.c */
190
191extern void
192start_remote PARAMS ((void));
193
194extern void
195child_create_inferior PARAMS ((char *, char *, char **));
196
197extern void
198child_attach PARAMS ((char *, int));
199
200extern void
201normal_stop PARAMS ((void));
202
203extern int
204signal_stop_state PARAMS ((int));
205
206extern int
207signal_print_state PARAMS ((int));
208
209extern int
210signal_pass_state PARAMS ((int));
211
212/* From infcmd.c */
213
214extern void
215tty_command PARAMS ((char *, int));
216
217extern void
218attach_command PARAMS ((char *, int));
219
bd5635a1
RP
220/* Last signal that the inferior received (why it stopped). */
221
222extern int stop_signal;
223
224/* Address at which inferior stopped. */
225
226extern CORE_ADDR stop_pc;
227
228/* Stack frame when program stopped. */
229
230extern FRAME_ADDR stop_frame_address;
231
232/* Chain containing status of breakpoint(s) that we have stopped at. */
233
234extern bpstat stop_bpstat;
235
236/* Flag indicating that a command has proceeded the inferior past the
237 current breakpoint. */
238
239extern int breakpoint_proceeded;
240
241/* Nonzero if stopped due to a step command. */
242
243extern int stop_step;
244
245/* Nonzero if stopped due to completion of a stack dummy routine. */
246
247extern int stop_stack_dummy;
248
249/* Nonzero if program stopped due to a random (unexpected) signal in
250 inferior process. */
251
252extern int stopped_by_random_signal;
253
254/* Range to single step within.
255 If this is nonzero, respond to a single-step signal
256 by continuing to step if the pc is in this range. */
257
258extern CORE_ADDR step_range_start; /* Inclusive */
259extern CORE_ADDR step_range_end; /* Exclusive */
260
261/* Stack frame address as of when stepping command was issued.
262 This is how we know when we step into a subroutine call,
263 and how to set the frame for the breakpoint used to step out. */
264
265extern FRAME_ADDR step_frame_address;
266
267/* 1 means step over all subroutine calls.
268 -1 means step over calls to undebuggable functions. */
269
270extern int step_over_calls;
271
272/* If stepping, nonzero means step count is > 1
273 so don't print frame next time inferior stops
274 if it stops due to stepping. */
275
276extern int step_multi;
277
bdbd5f50
JG
278/* Nonzero means expecting a trap and caller will handle it themselves.
279 It is used after attach, due to attaching to a process;
280 when running in the shell before the child program has been exec'd;
281 and when running some kinds of remote stuff (FIXME?). */
282
cc221e76 283extern int stop_soon_quietly;
bdbd5f50 284
bd5635a1
RP
285/* Nonzero if proceed is being used for a "finish" command or a similar
286 situation when stop_registers should be saved. */
287
288extern int proceed_to_finish;
289
290/* Save register contents here when about to pop a stack dummy frame,
291 if-and-only-if proceed_to_finish is set.
292 Thus this contains the return value from the called function (assuming
293 values are returned in a register). */
294
295extern char stop_registers[REGISTER_BYTES];
296
297/* Nonzero if pc has been changed by the debugger
298 since the inferior stopped. */
299
300extern int pc_changed;
301
302/* Nonzero if the child process in inferior_pid was attached rather
303 than forked. */
304
cc221e76 305extern int attach_flag;
bd5635a1
RP
306\f
307/* Possible values for CALL_DUMMY_LOCATION. */
308#define ON_STACK 1
309#define BEFORE_TEXT_END 2
310#define AFTER_TEXT_END 3
311
312#if !defined (CALL_DUMMY_LOCATION)
bd5635a1 313#define CALL_DUMMY_LOCATION ON_STACK
bd5635a1
RP
314#endif /* No CALL_DUMMY_LOCATION. */
315
316/* Are we in a call dummy? The code below which allows DECR_PC_AFTER_BREAK
317 below is for infrun.c, which may give the macro a pc without that
318 subtracted out. */
319#if !defined (PC_IN_CALL_DUMMY)
320#if CALL_DUMMY_LOCATION == BEFORE_TEXT_END
cc221e76 321extern CORE_ADDR text_end;
bd5635a1
RP
322#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
323 ((pc) >= text_end - CALL_DUMMY_LENGTH \
324 && (pc) < text_end + DECR_PC_AFTER_BREAK)
325#else /* Not before text_end. */
326#if CALL_DUMMY_LOCATION == AFTER_TEXT_END
cc221e76 327extern CORE_ADDR text_end;
bd5635a1
RP
328#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
329 ((pc) >= text_end \
330 && (pc) < text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK)
331#else /* On stack. */
332#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
333 ((sp) INNER_THAN (pc) && (pc) INNER_THAN (frame_address))
334#endif /* On stack. */
335#endif /* Not before text_end. */
336#endif /* No PC_IN_CALL_DUMMY. */
cc221e76
FF
337
338#endif /* !defined (INFERIOR_H) */
This page took 0.089548 seconds and 4 git commands to generate.