7b4ac7e1 |
1 | /* Basic definitions for GDB, the GNU debugger. |
4187119d |
2 | Copyright (C) 1986, 1989 Free Software Foundation, Inc. |
7b4ac7e1 |
3 | |
4187119d |
4 | This file is part of GDB. |
7b4ac7e1 |
5 | |
4187119d |
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. |
7b4ac7e1 |
10 | |
4187119d |
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. */ |
7b4ac7e1 |
19 | |
20 | #define CORE_ADDR unsigned int |
21 | |
22 | #define min(a, b) ((a) < (b) ? (a) : (b)) |
23 | #define max(a, b) ((a) > (b) ? (a) : (b)) |
24 | |
25 | extern char *savestring (); |
26 | extern char *concat (); |
27 | extern char *xmalloc (), *xrealloc (); |
28 | extern int parse_escape (); |
29 | extern char *reg_names[]; |
30 | |
4187119d |
31 | /* Various possibilities for alloca. */ |
32 | #ifdef __GNUC__ |
33 | #define alloca __builtin_alloca |
34 | #else |
35 | #ifdef sparc |
36 | #include <alloca.h> |
37 | #else |
38 | extern char *alloca (); |
39 | #endif |
40 | #endif |
41 | |
7b4ac7e1 |
42 | extern int quit_flag; |
43 | |
44 | extern int immediate_quit; |
45 | |
46 | #define QUIT { if (quit_flag) quit (); } |
47 | |
4187119d |
48 | /* Notes on classes: class_alias is for alias commands which are not |
49 | abbreviations of the original command. */ |
50 | |
7b4ac7e1 |
51 | enum command_class |
52 | { |
e91b87a3 |
53 | no_class = -1, class_run = 0, class_vars, class_stack, |
54 | class_files, class_support, class_info, class_breakpoint, |
55 | class_alias, class_obscure, class_user, |
7b4ac7e1 |
56 | }; |
57 | |
58 | /* the cleanup list records things that have to be undone |
59 | if an error happens (descriptors to be closed, memory to be freed, etc.) |
60 | Each link in the chain records a function to call and an |
61 | argument to give it. |
62 | |
63 | Use make_cleanup to add an element to the cleanup chain. |
64 | Use do_cleanups to do all cleanup actions back to a given |
65 | point in the chain. Use discard_cleanups to remove cleanups |
66 | from the chain back to a given point, not doing them. */ |
67 | |
68 | struct cleanup |
69 | { |
70 | struct cleanup *next; |
71 | void (*function) (); |
72 | int arg; |
73 | }; |
74 | |
75 | extern void do_cleanups (); |
76 | extern void discard_cleanups (); |
77 | extern struct cleanup *make_cleanup (); |
e91b87a3 |
78 | extern struct cleanup *save_cleanups (); |
79 | extern void restore_cleanups (); |
7b4ac7e1 |
80 | extern void free_current_contents (); |
4187119d |
81 | extern void reinitialize_more_filter (); |
82 | extern void fputs_filtered (); |
83 | extern void fprintf_filtered (); |
84 | extern void printf_filtered (); |
85 | extern void print_spaces_filtered (); |
86 | extern char *tilde_expand (); |
7b4ac7e1 |
87 | |
88 | /* Structure for saved commands lines |
89 | (for breakpoints, defined commands, etc). */ |
90 | |
91 | struct command_line |
92 | { |
93 | struct command_line *next; |
94 | char *line; |
95 | }; |
96 | |
97 | struct command_line *read_command_lines (); |
632ea0cc |
98 | |
99 | /* String containing the current directory (what getwd would return). */ |
100 | |
101 | char *current_directory; |
bb7592f0 |
102 | |