Add diclaimer of copyright to _osname() manual page.
[unix-history] / gnu / usr.bin / kgdb / defs.h
CommitLineData
04497f0b
NW
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 * @(#)defs.h 6.3 (Berkeley) 5/8/91
9 */
10
11/* Basic definitions for GDB, the GNU debugger.
12 Copyright (C) 1986, 1989 Free Software Foundation, Inc.
13
14This file is part of GDB.
15
16GDB is free software; you can redistribute it and/or modify
17it under the terms of the GNU General Public License as published by
18the Free Software Foundation; either version 1, or (at your option)
19any later version.
20
21GDB is distributed in the hope that it will be useful,
22but WITHOUT ANY WARRANTY; without even the implied warranty of
23MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24GNU General Public License for more details.
25
26You should have received a copy of the GNU General Public License
27along with GDB; see the file COPYING. If not, write to
28the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
29
30#define CORE_ADDR unsigned int
31
32#define min(a, b) ((a) < (b) ? (a) : (b))
33#define max(a, b) ((a) > (b) ? (a) : (b))
34
35extern char *savestring ();
36extern char *concat ();
37extern char *xmalloc (), *xrealloc ();
38extern int parse_escape ();
39extern char *reg_names[];
40
41/* Various possibilities for alloca. */
42#ifdef sparc
43#include <alloca.h>
44#else
45#ifdef __GNUC__
46#define alloca __builtin_alloca
47#else
48extern char *alloca ();
49#endif
50#endif
51
52extern int quit_flag;
53
54extern int immediate_quit;
55
56#define QUIT { if (quit_flag) quit (); }
57
58/* Notes on classes: class_alias is for alias commands which are not
59 abbreviations of the original command. */
60
61enum command_class
62{
63 no_class = -1, class_run = 0, class_vars, class_stack,
64 class_files, class_support, class_info, class_breakpoint,
65 class_alias, class_obscure, class_user,
66};
67
68/* the cleanup list records things that have to be undone
69 if an error happens (descriptors to be closed, memory to be freed, etc.)
70 Each link in the chain records a function to call and an
71 argument to give it.
72
73 Use make_cleanup to add an element to the cleanup chain.
74 Use do_cleanups to do all cleanup actions back to a given
75 point in the chain. Use discard_cleanups to remove cleanups
76 from the chain back to a given point, not doing them. */
77
78struct cleanup
79{
80 struct cleanup *next;
81 void (*function) ();
82 int arg;
83};
84
85extern void do_cleanups ();
86extern void discard_cleanups ();
87extern struct cleanup *make_cleanup ();
88extern struct cleanup *save_cleanups ();
89extern void restore_cleanups ();
90extern void free_current_contents ();
91extern void reinitialize_more_filter ();
92extern void fputs_filtered ();
93extern void fprintf_filtered ();
94extern void printf_filtered ();
95extern void print_spaces_filtered ();
96extern char *tilde_expand ();
97
98/* Structure for saved commands lines
99 (for breakpoints, defined commands, etc). */
100
101struct command_line
102{
103 struct command_line *next;
104 char *line;
105 int type; /* statement type */
106#define CL_END 0
107#define CL_NORMAL 1
108#define CL_WHILE 2
109#define CL_IF 3
110#define CL_EXITLOOP 4
111#define CL_NOP 5
112 struct command_line *body; /* body of loop for while, body of if */
113 struct command_line *elsebody; /* body of else part of if */
114};
115
116extern struct command_line *read_command_lines ();
117extern void do_command_lines();
118
119/* String containing the current directory (what getwd would return). */
120
121char *current_directory;
122