gdb-3.1
[binutils-gdb.git] / gdb / inferior.h
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 Free Software Foundation, Inc.
4
5 GDB is distributed in the hope that it will be useful, but WITHOUT ANY
6 WARRANTY. No author or distributor accepts responsibility to anyone
7 for the consequences of using it or for whether it serves any
8 particular purpose or works at all, unless he says so in writing.
9 Refer to the GDB General Public License for full details.
10
11 Everyone is granted permission to copy, modify and redistribute GDB,
12 but only under the conditions described in the GDB General Public
13 License. A copy of this license is supposed to have been given to you
14 along with GDB so you can know your rights and responsibilities. It
15 should be in a file named COPYING. Among other things, the copyright
16 notice and this notice must be preserved on all copies.
17
18 In other words, go ahead and share GDB, but don't try to stop
19 anyone else from sharing it farther. Help stamp out software hoarding!
20 */
21
22 /*
23 * Structure in which to save the status of the inferior. Save
24 * through "save_inferior_status", restore through
25 * "restore_inferior_status".
26 * This pair of routines should be called around any transfer of
27 * control to the inferior which you don't want showing up in your
28 * control variables.
29 */
30 struct inferior_status {
31 int pc_changed;
32 int stop_signal;
33 int stop_pc;
34 int stop_frame_address;
35 int stop_breakpoint;
36 int stop_step;
37 int stop_stack_dummy;
38 int stopped_by_random_signal;
39 int trap_expected;
40 CORE_ADDR step_range_start;
41 CORE_ADDR step_range_end;
42 FRAME_ADDR step_frame_address;
43 int step_over_calls;
44 CORE_ADDR step_resume_break_address;
45 int stop_after_trap;
46 int stop_after_attach;
47 FRAME_ADDR selected_frame_address;
48 int selected_level;
49 struct command_line *breakpoint_commands;
50 char stop_registers[REGISTER_BYTES];
51 int restore_stack_info;
52 };
53
54 void save_inferior_status (), restore_inferior_status ();
55
56 /* File name for default use for standard in/out in the inferior. */
57
58 extern char *inferior_io_terminal;
59
60 /* Pid of our debugged inferior, or 0 if no inferior now. */
61
62 extern int inferior_pid;
63
64 /* Nonzero if debugging a remote machine via a serial link or ethernet. */
65
66 extern int remote_debugging;
67
68 /* Last signal that the inferior received (why it stopped). */
69
70 extern int stop_signal;
71
72 /* Address at which inferior stopped. */
73
74 extern CORE_ADDR stop_pc;
75
76 /* Stack frame when program stopped. */
77
78 extern FRAME_ADDR stop_frame_address;
79
80 /* Number of breakpoint it stopped at, or 0 if none. */
81
82 extern int stop_breakpoint;
83
84 /* Nonzero if stopped due to a step command. */
85
86 extern int stop_step;
87
88 /* Nonzero if stopped due to completion of a stack dummy routine. */
89
90 extern int stop_stack_dummy;
91
92 /* Nonzero if program stopped due to a random (unexpected) signal in
93 inferior process. */
94
95 extern int stopped_by_random_signal;
96
97 /* Range to single step within.
98 If this is nonzero, respond to a single-step signal
99 by continuing to step if the pc is in this range. */
100
101 extern CORE_ADDR step_range_start; /* Inclusive */
102 extern CORE_ADDR step_range_end; /* Exclusive */
103
104 /* Stack frame address as of when stepping command was issued.
105 This is how we know when we step into a subroutine call,
106 and how to set the frame for the breakpoint used to step out. */
107
108 extern FRAME_ADDR step_frame_address;
109
110 /* 1 means step over all subroutine calls.
111 -1 means step over calls to undebuggable functions. */
112
113 extern int step_over_calls;
114
115 /* If stepping, nonzero means step count is > 1
116 so don't print frame next time inferior stops
117 if it stops due to stepping. */
118
119 extern int step_multi;
120
121 /* Save register contents here when about to pop a stack dummy frame. */
122
123 extern char stop_registers[REGISTER_BYTES];
124
125 /* Nonzero if pc has been changed by the debugger
126 since the inferior stopped. */
127
128 extern int pc_changed;
129
130
131 long read_memory_integer ();