This commit was generated by cvs2svn to track changes on a CVS vendor
[binutils-gdb.git] / gdb / defs.h
1 /* Basic definitions for GDB, the GNU debugger.
2 Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 GDB is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 1, or (at your option)
9 any later version.
10
11 GDB is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GDB; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 /* An address in the program being debugged. Host byte order. */
21 typedef unsigned int CORE_ADDR;
22
23 #define min(a, b) ((a) < (b) ? (a) : (b))
24 #define max(a, b) ((a) > (b) ? (a) : (b))
25
26 /* The character C++ uses to build identifiers that must be unique from
27 the program's identifiers (such as $this and $$vptr). */
28 #define CPLUS_MARKER '$' /* May be overridden to '.' for SysV */
29
30 /*
31 * Allow things in gdb to be declared "const". If compiling ANSI, it
32 * just works. If compiling with gcc but non-ansi, redefine to __const__.
33 * If non-ansi, non-gcc, then eliminate "const" entirely, making those
34 * objects be read-write rather than read-only.
35 */
36 #ifndef __STDC__
37 # ifdef __GNUC__
38 # define const __const__
39 # define volatile __volatile__
40 # else
41 # define const /*nothing*/
42 # define volatile /*nothing*/
43 # endif /* GNUC */
44 #endif /* STDC */
45
46 extern char *savestring ();
47 extern char *strsave ();
48 extern char *concat ();
49 #ifdef __STDC__
50 extern void *xmalloc (), *xrealloc ();
51 #else
52 extern char *xmalloc (), *xrealloc ();
53 #endif
54 extern void free ();
55 extern int parse_escape ();
56 extern char *reg_names[];
57 /* Indicate that these routines do not return to the caller. */
58 extern volatile void error(), fatal();
59
60 /* Various possibilities for alloca. */
61 #ifdef __GNUC__
62 # define alloca __builtin_alloca
63 #else
64 # ifdef sparc
65 # include <alloca.h>
66 # endif
67 extern char *alloca ();
68 # endif
69
70 extern int errno; /* System call error return status */
71
72 extern int quit_flag;
73 extern int immediate_quit;
74 extern void quit ();
75
76 #define QUIT { if (quit_flag) quit (); }
77
78 /* Notes on classes: class_alias is for alias commands which are not
79 abbreviations of the original command. */
80
81 enum command_class
82 {
83 /* Special args to help_list */
84 all_classes = -2, all_commands = -1,
85 /* Classes of commands */
86 no_class = -1, class_run = 0, class_vars, class_stack,
87 class_files, class_support, class_info, class_breakpoint,
88 class_alias, class_obscure, class_user
89 };
90
91 /* the cleanup list records things that have to be undone
92 if an error happens (descriptors to be closed, memory to be freed, etc.)
93 Each link in the chain records a function to call and an
94 argument to give it.
95
96 Use make_cleanup to add an element to the cleanup chain.
97 Use do_cleanups to do all cleanup actions back to a given
98 point in the chain. Use discard_cleanups to remove cleanups
99 from the chain back to a given point, not doing them. */
100
101 struct cleanup
102 {
103 struct cleanup *next;
104 void (*function) ();
105 int arg;
106 };
107
108 /* From utils.c. */
109 extern void do_cleanups ();
110 extern void discard_cleanups ();
111 extern struct cleanup *make_cleanup ();
112 extern struct cleanup *save_cleanups ();
113 extern void restore_cleanups ();
114 extern void free_current_contents ();
115 extern int myread ();
116 extern int query ();
117 extern int lines_to_list ();
118 extern void reinitialize_more_filter ();
119 extern void fputs_filtered ();
120 extern void puts_filtered ();
121 extern void fprintf_filtered ();
122 extern void printf_filtered ();
123 extern void print_spaces ();
124 extern void print_spaces_filtered ();
125 extern char *n_spaces ();
126 extern void printchar ();
127 extern void fprint_symbol ();
128 extern void fputs_demangled ();
129 extern void perror_with_name ();
130 extern void print_sys_errmsg ();
131
132 /* From printcmd.c */
133 extern void print_address_symbolic ();
134 extern void print_address ();
135
136 /* From readline (but not in any readline .h files). */
137 extern char *tilde_expand ();
138
139 /* Structure for saved commands lines
140 (for breakpoints, defined commands, etc). */
141
142 struct command_line
143 {
144 struct command_line *next;
145 char *line;
146 };
147
148 extern struct command_line *read_command_lines ();
149 extern void free_command_lines ();
150
151 /* String containing the current directory (what getwd would return). */
152
153 char *current_directory;
154
155 /* Default radixes for input and output. Only some values supported. */
156 extern unsigned input_radix;
157 extern unsigned output_radix;
158
159 /* Baud rate specified for communication with serial target systems. */
160 char *baud_rate;
161
162 #if !defined (UINT_MAX)
163 #define UINT_MAX 0xffffffff
164 #endif
165
166 #if !defined (LONG_MAX)
167 #define LONG_MAX 0x7fffffff
168 #endif
169
170 /* Just like CHAR_BIT in <limits.h> but describes the target machine. */
171 #if !defined (TARGET_CHAR_BIT)
172 #define TARGET_CHAR_BIT 8
173 #endif