Add '#define HAVE_PROCFS', move '#include "fopen-same.h" to end of file
[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.
3 Copyright (C) 1986, 1989 Free Software Foundation, Inc.
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
RP
20
21/* For bpstat. */
22#include "breakpoint.h"
23
24/* For FRAME_ADDR. */
25#include "frame.h"
26
27/*
28 * Structure in which to save the status of the inferior. Save
29 * through "save_inferior_status", restore through
30 * "restore_inferior_status".
31 * This pair of routines should be called around any transfer of
32 * control to the inferior which you don't want showing up in your
33 * control variables.
34 */
35struct inferior_status {
36 int pc_changed;
37 int stop_signal;
38 int stop_pc;
39 FRAME_ADDR stop_frame_address;
40 bpstat stop_bpstat;
41 int stop_step;
42 int stop_stack_dummy;
43 int stopped_by_random_signal;
44 int trap_expected;
45 CORE_ADDR step_range_start;
46 CORE_ADDR step_range_end;
47 FRAME_ADDR step_frame_address;
48 int step_over_calls;
49 CORE_ADDR step_resume_break_address;
50 int stop_after_trap;
51 int stop_soon_quietly;
52 FRAME_ADDR selected_frame_address;
53 int selected_level;
54 char stop_registers[REGISTER_BYTES];
55 int breakpoint_proceeded;
56 int restore_stack_info;
57 int proceed_to_finish;
58};
59
60void save_inferior_status (), restore_inferior_status ();
61
62/* File name for default use for standard in/out in the inferior. */
63
64extern char *inferior_io_terminal;
65
66/* Pid of our debugged inferior, or 0 if no inferior now. */
67
68extern int inferior_pid;
69
70/* Character array containing an image of the inferior programs' registers. */
71
72extern char registers[];
73
74extern void clear_proceed_status ();
75extern void start_inferior ();
76extern void proceed ();
77extern void kill_inferior ();
78extern void kill_inferior_fast ();
79extern void generic_mourn_inferior ();
80extern void terminal_ours ();
81extern void detach ();
82extern void run_stack_dummy ();
83extern CORE_ADDR read_pc ();
84extern void write_pc ();
85extern void wait_for_inferior ();
86extern void init_wait_for_inferior ();
87extern void close_exec_file ();
88extern void reopen_exec_file ();
89
bdbd5f50
JG
90/* From infcmd.c */
91void attach_command (
92#ifdef __STDC__
93 char *arg, int from_tty
94#endif
95 );
96
bd5635a1
RP
97/* Last signal that the inferior received (why it stopped). */
98
99extern int stop_signal;
100
101/* Address at which inferior stopped. */
102
103extern CORE_ADDR stop_pc;
104
105/* Stack frame when program stopped. */
106
107extern FRAME_ADDR stop_frame_address;
108
109/* Chain containing status of breakpoint(s) that we have stopped at. */
110
111extern bpstat stop_bpstat;
112
113/* Flag indicating that a command has proceeded the inferior past the
114 current breakpoint. */
115
116extern int breakpoint_proceeded;
117
118/* Nonzero if stopped due to a step command. */
119
120extern int stop_step;
121
122/* Nonzero if stopped due to completion of a stack dummy routine. */
123
124extern int stop_stack_dummy;
125
126/* Nonzero if program stopped due to a random (unexpected) signal in
127 inferior process. */
128
129extern int stopped_by_random_signal;
130
131/* Range to single step within.
132 If this is nonzero, respond to a single-step signal
133 by continuing to step if the pc is in this range. */
134
135extern CORE_ADDR step_range_start; /* Inclusive */
136extern CORE_ADDR step_range_end; /* Exclusive */
137
138/* Stack frame address as of when stepping command was issued.
139 This is how we know when we step into a subroutine call,
140 and how to set the frame for the breakpoint used to step out. */
141
142extern FRAME_ADDR step_frame_address;
143
144/* 1 means step over all subroutine calls.
145 -1 means step over calls to undebuggable functions. */
146
147extern int step_over_calls;
148
149/* If stepping, nonzero means step count is > 1
150 so don't print frame next time inferior stops
151 if it stops due to stepping. */
152
153extern int step_multi;
154
bdbd5f50
JG
155/* Nonzero means expecting a trap and caller will handle it themselves.
156 It is used after attach, due to attaching to a process;
157 when running in the shell before the child program has been exec'd;
158 and when running some kinds of remote stuff (FIXME?). */
159
160int stop_soon_quietly;
161
bd5635a1
RP
162/* Nonzero if proceed is being used for a "finish" command or a similar
163 situation when stop_registers should be saved. */
164
165extern int proceed_to_finish;
166
167/* Save register contents here when about to pop a stack dummy frame,
168 if-and-only-if proceed_to_finish is set.
169 Thus this contains the return value from the called function (assuming
170 values are returned in a register). */
171
172extern char stop_registers[REGISTER_BYTES];
173
174/* Nonzero if pc has been changed by the debugger
175 since the inferior stopped. */
176
177extern int pc_changed;
178
179/* Nonzero if the child process in inferior_pid was attached rather
180 than forked. */
181
182int attach_flag;
183\f
184/* Possible values for CALL_DUMMY_LOCATION. */
185#define ON_STACK 1
186#define BEFORE_TEXT_END 2
187#define AFTER_TEXT_END 3
188
189#if !defined (CALL_DUMMY_LOCATION)
bd5635a1 190#define CALL_DUMMY_LOCATION ON_STACK
bd5635a1
RP
191#endif /* No CALL_DUMMY_LOCATION. */
192
193/* Are we in a call dummy? The code below which allows DECR_PC_AFTER_BREAK
194 below is for infrun.c, which may give the macro a pc without that
195 subtracted out. */
196#if !defined (PC_IN_CALL_DUMMY)
197#if CALL_DUMMY_LOCATION == BEFORE_TEXT_END
198#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
199 ((pc) >= text_end - CALL_DUMMY_LENGTH \
200 && (pc) < text_end + DECR_PC_AFTER_BREAK)
201#else /* Not before text_end. */
202#if CALL_DUMMY_LOCATION == AFTER_TEXT_END
203#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
204 ((pc) >= text_end \
205 && (pc) < text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK)
206#else /* On stack. */
207#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
208 ((sp) INNER_THAN (pc) && (pc) INNER_THAN (frame_address))
209#endif /* On stack. */
210#endif /* Not before text_end. */
211#endif /* No PC_IN_CALL_DUMMY. */
This page took 0.066606 seconds and 4 git commands to generate.