386BSD 0.1 development
[unix-history] / usr / src / usr.bin / gdb / inferior.h
CommitLineData
bf5f22d3
WJ
1/*-
2 * This code is derived from software copyrighted by the Free Software
3 * Foundation.
4 *
5 * Modified 1991 by Donn Seeley at UUNET Technologies, Inc.
6 * Modified 1990 by Van Jacobson at Lawrence Berkeley Laboratory.
7 *
8 * @(#)inferior.h 6.3 (Berkeley) 5/8/91
9 */
10
11/* Variables that describe the inferior process running under GDB:
12 Where it is, why it stopped, and how to step it.
13 Copyright (C) 1986, 1989 Free Software Foundation, Inc.
14
15This file is part of GDB.
16
17GDB is free software; you can redistribute it and/or modify
18it under the terms of the GNU General Public License as published by
19the Free Software Foundation; either version 1, or (at your option)
20any later version.
21
22GDB is distributed in the hope that it will be useful,
23but WITHOUT ANY WARRANTY; without even the implied warranty of
24MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25GNU General Public License for more details.
26
27You should have received a copy of the GNU General Public License
28along with GDB; see the file COPYING. If not, write to
29the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
30
31/*
32 * Structure in which to save the status of the inferior. Save
33 * through "save_inferior_status", restore through
34 * "restore_inferior_status".
35 * This pair of routines should be called around any transfer of
36 * control to the inferior which you don't want showing up in your
37 * control variables.
38 */
39struct inferior_status {
40 int pc_changed;
41 int stop_signal;
42 int stop_pc;
43 int stop_frame_address;
44 int stop_breakpoint;
45 int stop_step;
46 int stop_stack_dummy;
47 int stopped_by_random_signal;
48 int trap_expected;
49 CORE_ADDR step_range_start;
50 CORE_ADDR step_range_end;
51 FRAME_ADDR step_frame_address;
52 int step_over_calls;
53 CORE_ADDR step_resume_break_address;
54 int stop_after_trap;
55 int stop_after_attach;
56 FRAME_ADDR selected_frame_address;
57 int selected_level;
58 struct command_line *breakpoint_commands;
59 char register_context[REGISTER_BYTES];
60 int restore_stack_info;
61};
62
63void save_inferior_status (), restore_inferior_status ();
64
65/* File name for default use for standard in/out in the inferior. */
66
67extern char *inferior_io_terminal;
68
69/* Pid of our debugged inferior, or 0 if no inferior now. */
70
71extern int inferior_pid;
72
73/* Nonzero if debugging a remote machine via a serial link or ethernet. */
74extern int remote_debugging;
75
76/* Routines for use in remote debugging. Documented in remote.c. */
77int remote_read_inferior_memory ();
78int remote_write_inferior_memory ();
79
80/* Last signal that the inferior received (why it stopped). */
81
82extern int stop_signal;
83
84/* Address at which inferior stopped. */
85
86extern CORE_ADDR stop_pc;
87
88/* Stack frame when program stopped. */
89
90extern FRAME_ADDR stop_frame_address;
91
92/* Number of breakpoint it stopped at, or 0 if none. */
93
94extern int stop_breakpoint;
95
96/* Nonzero if stopped due to a step command. */
97
98extern int stop_step;
99
100/* Nonzero if stopped due to completion of a stack dummy routine. */
101
102extern int stop_stack_dummy;
103
104/* Nonzero if program stopped due to a random (unexpected) signal in
105 inferior process. */
106
107extern int stopped_by_random_signal;
108
109/* Range to single step within.
110 If this is nonzero, respond to a single-step signal
111 by continuing to step if the pc is in this range. */
112
113extern CORE_ADDR step_range_start; /* Inclusive */
114extern CORE_ADDR step_range_end; /* Exclusive */
115
116/* Stack frame address as of when stepping command was issued.
117 This is how we know when we step into a subroutine call,
118 and how to set the frame for the breakpoint used to step out. */
119
120extern FRAME_ADDR step_frame_address;
121
122/* 1 means step over all subroutine calls.
123 -1 means step over calls to undebuggable functions. */
124
125extern int step_over_calls;
126
127/* If stepping, nonzero means step count is > 1
128 so don't print frame next time inferior stops
129 if it stops due to stepping. */
130
131extern int step_multi;
132
133/* Save register contents here when about to pop a stack dummy frame. */
134
135extern char stop_registers[REGISTER_BYTES];
136
137/* Nonzero if pc has been changed by the debugger
138 since the inferior stopped. */
139
140extern int pc_changed;
141
142long read_memory_integer ();