xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/defs.h (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1 /* *INDENT-OFF* */ /* ATTRIBUTE_PRINTF confuses indent, avoid running it
2 		      for now.  */
3 /* Basic, host-specific, and target-specific definitions for GDB.
4    Copyright (C) 1986-2016 Free Software Foundation, Inc.
5 
6    This file is part of GDB.
7 
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20 
21 #ifndef DEFS_H
22 #define DEFS_H
23 
24 #ifdef GDBSERVER
25 #  error gdbserver should not include gdb/defs.h
26 #endif
27 
28 #include "common-defs.h"
29 
30 #include <sys/types.h>
31 #include <limits.h>
32 
33 /* The libdecnumber library, on which GDB depends, includes a header file
34    called gstdint.h instead of relying directly on stdint.h.  GDB, on the
35    other hand, includes stdint.h directly, relying on the fact that gnulib
36    generates a copy if the system doesn't provide one or if it is missing
37    some features.  Unfortunately, gstdint.h and stdint.h cannot be included
38    at the same time, which may happen when we include a file from
39    libdecnumber.
40 
41    The following macro definition effectively prevents the inclusion of
42    gstdint.h, as all the definitions it provides are guarded against
43    the GCC_GENERATED_STDINT_H macro.  We already have gnulib/stdint.h
44    included, so it's ok to blank out gstdint.h.  */
45 #define GCC_GENERATED_STDINT_H 1
46 
47 #include <unistd.h>
48 
49 #include <fcntl.h>
50 
51 #include "gdb_wchar.h"
52 
53 #include "ui-file.h"
54 
55 #include "host-defs.h"
56 #include "common/enum-flags.h"
57 
58 /* Scope types enumerator.  List the types of scopes the compiler will
59    accept.  */
60 
61 enum compile_i_scope_types
62   {
63     COMPILE_I_INVALID_SCOPE,
64 
65     /* A simple scope.  Wrap an expression into a simple scope that
66        takes no arguments, returns no value, and uses the generic
67        function name "_gdb_expr". */
68 
69     COMPILE_I_SIMPLE_SCOPE,
70 
71     /* Do not wrap the expression,
72        it has to provide function "_gdb_expr" on its own.  */
73     COMPILE_I_RAW_SCOPE,
74 
75     /* A printable expression scope.  Wrap an expression into a scope
76        suitable for the "compile print" command.  It uses the generic
77        function name "_gdb_expr".  COMPILE_I_PRINT_ADDRESS_SCOPE variant
78        is the usual one, taking address of the object.
79        COMPILE_I_PRINT_VALUE_SCOPE is needed for arrays where the array
80        name already specifies its address.  See get_out_value_type.  */
81     COMPILE_I_PRINT_ADDRESS_SCOPE,
82     COMPILE_I_PRINT_VALUE_SCOPE,
83   };
84 
85 /* Just in case they're not defined in stdio.h.  */
86 
87 #ifndef SEEK_SET
88 #define SEEK_SET 0
89 #endif
90 #ifndef SEEK_CUR
91 #define SEEK_CUR 1
92 #endif
93 
94 /* The O_BINARY flag is defined in fcntl.h on some non-Posix platforms.
95    It is used as an access modifier in calls to open(), where it acts
96    similarly to the "b" character in fopen()'s MODE argument.  On Posix
97    platforms it should be a no-op, so it is defined as 0 here.  This
98    ensures that the symbol may be used freely elsewhere in gdb.  */
99 
100 #ifndef O_BINARY
101 #define O_BINARY 0
102 #endif
103 
104 #include "hashtab.h"
105 
106 #ifndef min
107 #define min(a, b) ((a) < (b) ? (a) : (b))
108 #endif
109 #ifndef max
110 #define max(a, b) ((a) > (b) ? (a) : (b))
111 #endif
112 
113 /* * Enable dbx commands if set.  */
114 extern int dbx_commands;
115 
116 /* * System root path, used to find libraries etc.  */
117 extern char *gdb_sysroot;
118 
119 /* * GDB datadir, used to store data files.  */
120 extern char *gdb_datadir;
121 
122 /* * If non-NULL, the possibly relocated path to python's "lib" directory
123    specified with --with-python.  */
124 extern char *python_libdir;
125 
126 /* * Search path for separate debug files.  */
127 extern char *debug_file_directory;
128 
129 /* GDB's SIGINT handler basically sets a flag; code that might take a
130    long time before it gets back to the event loop, and which ought to
131    be interruptible, checks this flag using the QUIT macro, which, if
132    GDB has the terminal, throws a quit exception.
133 
134    In addition to setting a flag, the SIGINT handler also marks a
135    select/poll-able file descriptor as read-ready.  That is used by
136    interruptible_select in order to support interrupting blocking I/O
137    in a race-free manner.
138 
139    These functions use the extension_language_ops API to allow extension
140    language(s) and GDB SIGINT handling to coexist seamlessly.  */
141 
142 /* * Evaluate to non-zero if the quit flag is set, zero otherwise.  This
143    will clear the quit flag as a side effect.  */
144 extern int check_quit_flag (void);
145 /* * Set the quit flag.  */
146 extern void set_quit_flag (void);
147 
148 /* The current quit handler (and its type).  This is called from the
149    QUIT macro.  See default_quit_handler below for default behavior.
150    Parts of GDB temporarily override this to e.g., completely suppress
151    Ctrl-C because it would not be safe to throw.  E.g., normally, you
152    wouldn't want to quit between a RSP command and its response, as
153    that would break the communication with the target, but you may
154    still want to intercept the Ctrl-C and offer to disconnect if the
155    user presses Ctrl-C multiple times while the target is stuck
156    waiting for the wedged remote stub.  */
157 typedef void (quit_handler_ftype) (void);
158 extern quit_handler_ftype *quit_handler;
159 
160 /* Override the current quit handler.  Sets NEW_QUIT_HANDLER as
161    current quit handler, and installs a cleanup that when run restores
162    the previous quit handler.  */
163 struct cleanup *
164   make_cleanup_override_quit_handler (quit_handler_ftype *new_quit_handler);
165 
166 /* The default quit handler.  Checks whether Ctrl-C was pressed, and
167    if so:
168 
169      - If GDB owns the terminal, throws a quit exception.
170 
171      - If GDB does not own the terminal, forwards the Ctrl-C to the
172        target.
173 */
174 extern void default_quit_handler (void);
175 
176 /* Flag that function quit should call quit_force.  */
177 extern volatile int sync_quit_force_run;
178 
179 extern void quit (void);
180 
181 /* Helper for the QUIT macro.  */
182 
183 extern void maybe_quit (void);
184 
185 /* Check whether a Ctrl-C was typed, and if so, call the current quit
186    handler.  */
187 #define QUIT maybe_quit ()
188 
189 /* Set the serial event associated with the quit flag.  */
190 extern void quit_serial_event_set (void);
191 
192 /* Clear the serial event associated with the quit flag.  */
193 extern void quit_serial_event_clear (void);
194 
195 /* * Languages represented in the symbol table and elsewhere.
196    This should probably be in language.h, but since enum's can't
197    be forward declared to satisfy opaque references before their
198    actual definition, needs to be here.
199 
200    The constants here are in priority order.  In particular,
201    demangling is attempted according to this order.
202 
203    Note that there's ambiguity between the mangling schemes of some of
204    these languages, so some symbols could be successfully demangled by
205    several languages.  For that reason, the constants here are sorted
206    in the order we'll attempt demangling them.  For example: Java and
207    Rust use C++ mangling, so must come after C++; Ada must come last
208    (see ada_sniff_from_mangled_name).  */
209 
210 enum language
211   {
212     language_unknown,		/* Language not known */
213     language_auto,		/* Placeholder for automatic setting */
214     language_c,			/* C */
215     language_objc,		/* Objective-C */
216     language_cplus,		/* C++ */
217     language_java,		/* Java */
218     language_d,			/* D */
219     language_go,		/* Go */
220     language_fortran,		/* Fortran */
221     language_m2,		/* Modula-2 */
222     language_asm,		/* Assembly language */
223     language_pascal,		/* Pascal */
224     language_opencl,		/* OpenCL */
225     language_rust,		/* Rust */
226     language_minimal,		/* All other languages, minimal support only */
227     language_ada,		/* Ada */
228     nr_languages
229   };
230 
231 /* The number of bits needed to represent all languages, with enough
232    padding to allow for reasonable growth.  */
233 #define LANGUAGE_BITS 5
234 gdb_static_assert (nr_languages <= (1 << LANGUAGE_BITS));
235 
236 enum precision_type
237   {
238     single_precision,
239     double_precision,
240     unspecified_precision
241   };
242 
243 /* * A generic, not quite boolean, enumeration.  This is used for
244    set/show commands in which the options are on/off/automatic.  */
245 enum auto_boolean
246 {
247   AUTO_BOOLEAN_TRUE,
248   AUTO_BOOLEAN_FALSE,
249   AUTO_BOOLEAN_AUTO
250 };
251 
252 /* * Potential ways that a function can return a value of a given
253    type.  */
254 
255 enum return_value_convention
256 {
257   /* * Where the return value has been squeezed into one or more
258      registers.  */
259   RETURN_VALUE_REGISTER_CONVENTION,
260   /* * Commonly known as the "struct return convention".  The caller
261      passes an additional hidden first parameter to the caller.  That
262      parameter contains the address at which the value being returned
263      should be stored.  While typically, and historically, used for
264      large structs, this is convention is applied to values of many
265      different types.  */
266   RETURN_VALUE_STRUCT_CONVENTION,
267   /* * Like the "struct return convention" above, but where the ABI
268      guarantees that the called function stores the address at which
269      the value being returned is stored in a well-defined location,
270      such as a register or memory slot in the stack frame.  Don't use
271      this if the ABI doesn't explicitly guarantees this.  */
272   RETURN_VALUE_ABI_RETURNS_ADDRESS,
273   /* * Like the "struct return convention" above, but where the ABI
274      guarantees that the address at which the value being returned is
275      stored will be available in a well-defined location, such as a
276      register or memory slot in the stack frame.  Don't use this if
277      the ABI doesn't explicitly guarantees this.  */
278   RETURN_VALUE_ABI_PRESERVES_ADDRESS,
279 };
280 
281 /* Needed for various prototypes */
282 
283 struct symtab;
284 struct breakpoint;
285 struct frame_info;
286 struct gdbarch;
287 struct value;
288 
289 /* From main.c.  */
290 
291 /* This really belong in utils.c (path-utils.c?), but it references some
292    globals that are currently only available to main.c.  */
293 extern char *relocate_gdb_directory (const char *initial, int flag);
294 
295 
296 /* Annotation stuff.  */
297 
298 extern int annotation_level;	/* in stack.c */
299 
300 
301 /* From regex.c or libc.  BSD 4.4 declares this with the argument type as
302    "const char *" in unistd.h, so we can't declare the argument
303    as "char *".  */
304 
305 EXTERN_C char *re_comp (const char *);
306 
307 /* From symfile.c */
308 
309 extern void symbol_file_command (char *, int);
310 
311 /* * Remote targets may wish to use this as their load function.  */
312 extern void generic_load (const char *name, int from_tty);
313 
314 /* * Report on STREAM the performance of memory transfer operation,
315    such as 'load'.
316    @param DATA_COUNT is the number of bytes transferred.
317    @param WRITE_COUNT is the number of separate write operations, or 0,
318    if that information is not available.
319    @param START_TIME is the time at which an operation was started.
320    @param END_TIME is the time at which an operation ended.  */
321 struct timeval;
322 extern void print_transfer_performance (struct ui_file *stream,
323 					unsigned long data_count,
324 					unsigned long write_count,
325 					const struct timeval *start_time,
326 					const struct timeval *end_time);
327 
328 /* From top.c */
329 
330 typedef void initialize_file_ftype (void);
331 
332 extern char *gdb_readline_wrapper (const char *);
333 
334 extern char *command_line_input (const char *, int, char *);
335 
336 extern void print_prompt (void);
337 
338 struct ui;
339 
340 extern int input_interactive_p (struct ui *);
341 
342 extern int info_verbose;
343 
344 /* From printcmd.c */
345 
346 extern void set_next_address (struct gdbarch *, CORE_ADDR);
347 
348 extern int print_address_symbolic (struct gdbarch *, CORE_ADDR,
349 				   struct ui_file *, int, char *);
350 
351 extern int build_address_symbolic (struct gdbarch *,
352 				   CORE_ADDR addr,
353 				   int do_demangle,
354 				   char **name,
355 				   int *offset,
356 				   char **filename,
357 				   int *line,
358 				   int *unmapped);
359 
360 extern void print_address (struct gdbarch *, CORE_ADDR, struct ui_file *);
361 extern const char *pc_prefix (CORE_ADDR);
362 
363 /* From source.c */
364 
365 /* See openp function definition for their description.  */
366 #define OPF_TRY_CWD_FIRST     0x01
367 #define OPF_SEARCH_IN_PATH    0x02
368 #define OPF_RETURN_REALPATH   0x04
369 
370 extern int openp (const char *, int, const char *, int, char **);
371 
372 extern int source_full_path_of (const char *, char **);
373 
374 extern void mod_path (char *, char **);
375 
376 extern void add_path (char *, char **, int);
377 
378 extern void directory_switch (char *, int);
379 
380 extern char *source_path;
381 
382 extern void init_source_path (void);
383 
384 /* From exec.c */
385 
386 /* * Process memory area starting at ADDR with length SIZE.  Area is
387    readable iff READ is non-zero, writable if WRITE is non-zero,
388    executable if EXEC is non-zero.  Area is possibly changed against
389    its original file based copy if MODIFIED is non-zero.  DATA is
390    passed without changes from a caller.  */
391 
392 typedef int (*find_memory_region_ftype) (CORE_ADDR addr, unsigned long size,
393 					 int read, int write, int exec,
394 					 int modified, void *data);
395 
396 /* * Possible lvalue types.  Like enum language, this should be in
397    value.h, but needs to be here for the same reason.  */
398 
399 enum lval_type
400   {
401     /* * Not an lval.  */
402     not_lval,
403     /* * In memory.  */
404     lval_memory,
405     /* * In a register.  Registers are relative to a frame.  */
406     lval_register,
407     /* * In a gdb internal variable.  */
408     lval_internalvar,
409     /* * Value encapsulates a callable defined in an extension language.  */
410     lval_xcallable,
411     /* * Part of a gdb internal variable (structure field).  */
412     lval_internalvar_component,
413     /* * Value's bits are fetched and stored using functions provided
414        by its creator.  */
415     lval_computed
416   };
417 
418 /* * Control types for commands.  */
419 
420 enum misc_command_type
421   {
422     ok_command,
423     end_command,
424     else_command,
425     nop_command
426   };
427 
428 enum command_control_type
429   {
430     simple_control,
431     break_control,
432     continue_control,
433     while_control,
434     if_control,
435     commands_control,
436     python_control,
437     compile_control,
438     guile_control,
439     while_stepping_control,
440     invalid_control
441   };
442 
443 /* * Structure for saved commands lines (for breakpoints, defined
444    commands, etc).  */
445 
446 struct command_line
447   {
448     struct command_line *next;
449     char *line;
450     enum command_control_type control_type;
451     union
452       {
453 	struct
454 	  {
455 	    enum compile_i_scope_types scope;
456 	    void *scope_data;
457 	  }
458 	compile;
459       }
460     control_u;
461     /* * The number of elements in body_list.  */
462     int body_count;
463     /* * For composite commands, the nested lists of commands.  For
464        example, for "if" command this will contain the then branch and
465        the else branch, if that is available.  */
466     struct command_line **body_list;
467   };
468 
469 extern struct command_line *read_command_lines (char *, int, int,
470 						void (*)(char *, void *),
471 						void *);
472 extern struct command_line *read_command_lines_1 (char * (*) (void), int,
473 						  void (*)(char *, void *),
474 						  void *);
475 
476 extern void free_command_lines (struct command_line **);
477 
478 /* * Parameters of the "info proc" command.  */
479 
480 enum info_proc_what
481   {
482     /* * Display the default cmdline, cwd and exe outputs.  */
483     IP_MINIMAL,
484 
485     /* * Display `info proc mappings'.  */
486     IP_MAPPINGS,
487 
488     /* * Display `info proc status'.  */
489     IP_STATUS,
490 
491     /* * Display `info proc stat'.  */
492     IP_STAT,
493 
494     /* * Display `info proc cmdline'.  */
495     IP_CMDLINE,
496 
497     /* * Display `info proc exe'.  */
498     IP_EXE,
499 
500     /* * Display `info proc cwd'.  */
501     IP_CWD,
502 
503     /* * Display all of the above.  */
504     IP_ALL
505   };
506 
507 /* * String containing the current directory (what getwd would return).  */
508 
509 extern char *current_directory;
510 
511 /* * Default radixes for input and output.  Only some values supported.  */
512 extern unsigned input_radix;
513 extern unsigned output_radix;
514 
515 /* * Possibilities for prettyformat parameters to routines which print
516    things.  Like enum language, this should be in value.h, but needs
517    to be here for the same reason.  FIXME:  If we can eliminate this
518    as an arg to LA_VAL_PRINT, then we can probably move it back to
519    value.h.  */
520 
521 enum val_prettyformat
522   {
523     Val_no_prettyformat = 0,
524     Val_prettyformat,
525     /* * Use the default setting which the user has specified.  */
526     Val_prettyformat_default
527   };
528 
529 /* * Optional native machine support.  Non-native (and possibly pure
530    multi-arch) targets do not need a "nm.h" file.  This will be a
531    symlink to one of the nm-*.h files, built by the `configure'
532    script.  */
533 
534 #ifdef GDB_NM_FILE
535 #include "nm.h"
536 #endif
537 
538 /* Assume that fopen accepts the letter "b" in the mode string.
539    It is demanded by ISO C9X, and should be supported on all
540    platforms that claim to have a standard-conforming C library.  On
541    true POSIX systems it will be ignored and have no effect.  There
542    may still be systems without a standard-conforming C library where
543    an ISO C9X compiler (GCC) is available.  Known examples are SunOS
544    4.x and 4.3BSD.  This assumption means these systems are no longer
545    supported.  */
546 #ifndef FOPEN_RB
547 # include "fopen-bin.h"
548 #endif
549 
550 /* Defaults for system-wide constants (if not defined by xm.h, we fake it).
551    FIXME: Assumes 2's complement arithmetic.  */
552 
553 #if !defined (UINT_MAX)
554 #define	UINT_MAX ((unsigned int)(~0))	    /* 0xFFFFFFFF for 32-bits */
555 #endif
556 
557 #if !defined (INT_MAX)
558 #define	INT_MAX ((int)(UINT_MAX >> 1))	    /* 0x7FFFFFFF for 32-bits */
559 #endif
560 
561 #if !defined (INT_MIN)
562 #define INT_MIN ((int)((int) ~0 ^ INT_MAX)) /* 0x80000000 for 32-bits */
563 #endif
564 
565 #if !defined (ULONG_MAX)
566 #define	ULONG_MAX ((unsigned long)(~0L))    /* 0xFFFFFFFF for 32-bits */
567 #endif
568 
569 #if !defined (LONG_MAX)
570 #define	LONG_MAX ((long)(ULONG_MAX >> 1))   /* 0x7FFFFFFF for 32-bits */
571 #endif
572 
573 #if !defined (ULONGEST_MAX)
574 #define	ULONGEST_MAX (~(ULONGEST)0)        /* 0xFFFFFFFFFFFFFFFF for 64-bits */
575 #endif
576 
577 #if !defined (LONGEST_MAX)                 /* 0x7FFFFFFFFFFFFFFF for 64-bits */
578 #define	LONGEST_MAX ((LONGEST)(ULONGEST_MAX >> 1))
579 #endif
580 
581 /* * Convert a LONGEST to an int.  This is used in contexts (e.g. number of
582    arguments to a function, number in a value history, register number, etc.)
583    where the value must not be larger than can fit in an int.  */
584 
585 extern int longest_to_int (LONGEST);
586 
587 /* * List of known OS ABIs.  If you change this, make sure to update the
588    table in osabi.c.  */
589 enum gdb_osabi
590 {
591   GDB_OSABI_UNINITIALIZED = -1, /* For struct gdbarch_info.  */
592 
593   GDB_OSABI_UNKNOWN = 0,	/* keep this zero */
594 
595   GDB_OSABI_SVR4,
596   GDB_OSABI_HURD,
597   GDB_OSABI_SOLARIS,
598   GDB_OSABI_LINUX,
599   GDB_OSABI_FREEBSD_AOUT,
600   GDB_OSABI_FREEBSD_ELF,
601   GDB_OSABI_NETBSD_AOUT,
602   GDB_OSABI_NETBSD_ELF,
603   GDB_OSABI_OPENBSD_ELF,
604   GDB_OSABI_WINCE,
605   GDB_OSABI_GO32,
606   GDB_OSABI_IRIX,
607   GDB_OSABI_HPUX_ELF,
608   GDB_OSABI_HPUX_SOM,
609   GDB_OSABI_QNXNTO,
610   GDB_OSABI_CYGWIN,
611   GDB_OSABI_AIX,
612   GDB_OSABI_DICOS,
613   GDB_OSABI_DARWIN,
614   GDB_OSABI_SYMBIAN,
615   GDB_OSABI_OPENVMS,
616   GDB_OSABI_LYNXOS178,
617   GDB_OSABI_NEWLIB,
618   GDB_OSABI_SDE,
619 
620   GDB_OSABI_INVALID		/* keep this last */
621 };
622 
623 /* Global functions from other, non-gdb GNU thingies.
624    Libiberty thingies are no longer declared here.  We include libiberty.h
625    above, instead.  */
626 
627 /* From other system libraries */
628 
629 #ifndef atof
630 extern double atof (const char *);	/* X3.159-1989  4.10.1.1 */
631 #endif
632 
633 /* Enumerate the requirements a symbol has in order to be evaluated.
634    These are listed in order of "strength" -- a later entry subsumes
635    earlier ones.  This fine-grained distinction is important because
636    it allows for the evaluation of a TLS symbol during unwinding --
637    when unwinding one has access to registers, but not the frame
638    itself, because that is being constructed.  */
639 
640 enum symbol_needs_kind
641 {
642   /* No special requirements -- just memory.  */
643   SYMBOL_NEEDS_NONE,
644 
645   /* The symbol needs registers.  */
646   SYMBOL_NEEDS_REGISTERS,
647 
648   /* The symbol needs a frame.  */
649   SYMBOL_NEEDS_FRAME
650 };
651 
652 /* Dynamic target-system-dependent parameters for GDB.  */
653 #include "gdbarch.h"
654 
655 /* * Maximum size of a register.  Something small, but large enough for
656    all known ISAs.  If it turns out to be too small, make it bigger.  */
657 
658 enum { MAX_REGISTER_SIZE = 64 };
659 
660 /* In findvar.c.  */
661 
662 extern LONGEST extract_signed_integer (const gdb_byte *, int,
663 				       enum bfd_endian);
664 
665 extern ULONGEST extract_unsigned_integer (const gdb_byte *, int,
666 					  enum bfd_endian);
667 
668 extern int extract_long_unsigned_integer (const gdb_byte *, int,
669 					  enum bfd_endian, LONGEST *);
670 
671 extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
672 					struct type *type);
673 
674 extern void store_signed_integer (gdb_byte *, int,
675 				  enum bfd_endian, LONGEST);
676 
677 extern void store_unsigned_integer (gdb_byte *, int,
678 				    enum bfd_endian, ULONGEST);
679 
680 extern void store_typed_address (gdb_byte *buf, struct type *type,
681 				 CORE_ADDR addr);
682 
683 
684 /* From valops.c */
685 
686 extern int watchdog;
687 
688 /* Hooks for alternate command interfaces.  */
689 
690 /* * The name of the interpreter if specified on the command line.  */
691 extern char *interpreter_p;
692 
693 struct target_waitstatus;
694 struct cmd_list_element;
695 
696 extern void (*deprecated_pre_add_symbol_hook) (const char *);
697 extern void (*deprecated_post_add_symbol_hook) (void);
698 extern void (*selected_frame_level_changed_hook) (int);
699 extern int (*deprecated_ui_loop_hook) (int signo);
700 extern void (*deprecated_show_load_progress) (const char *section,
701 					      unsigned long section_sent,
702 					      unsigned long section_size,
703 					      unsigned long total_sent,
704 					      unsigned long total_size);
705 extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
706 							 int line,
707 							 int stopline,
708 							 int noerror);
709 extern int (*deprecated_query_hook) (const char *, va_list)
710      ATTRIBUTE_FPTR_PRINTF(1,0);
711 extern void (*deprecated_warning_hook) (const char *, va_list)
712      ATTRIBUTE_FPTR_PRINTF(1,0);
713 extern void (*deprecated_interactive_hook) (void);
714 extern void (*deprecated_readline_begin_hook) (char *, ...)
715      ATTRIBUTE_FPTR_PRINTF_1;
716 extern char *(*deprecated_readline_hook) (const char *);
717 extern void (*deprecated_readline_end_hook) (void);
718 extern void (*deprecated_context_hook) (int);
719 extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
720 					      struct target_waitstatus *status,
721 					      int options);
722 
723 extern void (*deprecated_attach_hook) (void);
724 extern void (*deprecated_detach_hook) (void);
725 extern void (*deprecated_call_command_hook) (struct cmd_list_element * c,
726 					     char *cmd, int from_tty);
727 
728 extern int (*deprecated_ui_load_progress_hook) (const char *section,
729 						unsigned long num);
730 
731 /* If this definition isn't overridden by the header files, assume
732    that isatty and fileno exist on this system.  */
733 #ifndef ISATTY
734 #define ISATTY(FP)	(isatty (fileno (FP)))
735 #endif
736 
737 /* * A width that can achieve a better legibility for GDB MI mode.  */
738 #define GDB_MI_MSG_WIDTH  80
739 
740 /* From progspace.c */
741 
742 extern void initialize_progspace (void);
743 extern void initialize_inferiors (void);
744 
745 /* * Special block numbers */
746 
747 enum block_enum
748 {
749   GLOBAL_BLOCK = 0,
750   STATIC_BLOCK = 1,
751   FIRST_LOCAL_BLOCK = 2
752 };
753 
754 /* User selection used in observer.h and multiple print functions.  */
755 
756 enum user_selected_what_flag
757   {
758     /* Inferior selected.  */
759     USER_SELECTED_INFERIOR = 1 << 1,
760 
761     /* Thread selected.  */
762     USER_SELECTED_THREAD = 1 << 2,
763 
764     /* Frame selected.  */
765     USER_SELECTED_FRAME = 1 << 3
766   };
767 DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what);
768 
769 #include "utils.h"
770 
771 #endif /* #ifndef DEFS_H */
772