1 /* Basic definitions for GDB, the GNU debugger.
2 Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
4 This file is part of GDB.
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)
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.
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. */
20 /* An address in the program being debugged. Host byte order. */
21 typedef unsigned int CORE_ADDR
;
23 #define min(a, b) ((a) < (b) ? (a) : (b))
24 #define max(a, b) ((a) > (b) ? (a) : (b))
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 */
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.
38 # define const __const__
39 # define volatile __volatile__
41 # define const /*nothing*/
42 # define volatile /*nothing*/
46 extern char *savestring ();
47 extern char *strsave ();
48 extern char *concat ();
50 extern void *xmalloc (), *xrealloc ();
52 extern char *xmalloc (), *xrealloc ();
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();
60 /* Various possibilities for alloca. */
62 # define alloca __builtin_alloca
67 extern char *alloca ();
70 extern int errno
; /* System call error return status */
73 extern int immediate_quit
;
76 #define QUIT { if (quit_flag) quit (); }
78 /* Notes on classes: class_alias is for alias commands which are not
79 abbreviations of the original command. */
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
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
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. */
103 struct cleanup
*next
;
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 ();
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 ();
132 /* From printcmd.c */
133 extern void print_address_symbolic ();
134 extern void print_address ();
136 /* From readline (but not in any readline .h files). */
137 extern char *tilde_expand ();
139 /* Structure for saved commands lines
140 (for breakpoints, defined commands, etc). */
144 struct command_line
*next
;
148 extern struct command_line
*read_command_lines ();
149 extern void free_command_lines ();
151 /* String containing the current directory (what getwd would return). */
153 char *current_directory
;
155 /* Default radixes for input and output. Only some values supported. */
156 extern unsigned input_radix
;
157 extern unsigned output_radix
;
159 /* Baud rate specified for communication with serial target systems. */
162 #if !defined (UINT_MAX)
163 #define UINT_MAX 0xffffffff
166 #if !defined (LONG_MAX)
167 #define LONG_MAX 0x7fffffff
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