xref: /original-bsd/contrib/gdb-4.7.LBL/gdb/defs.h (revision a0411884)
1 /* Basic, host-specific, and target-specific definitions for GDB.
2    Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
3 
4 This file is part of GDB.
5 
6 This program 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 2 of the License, or
9 (at your option) any later version.
10 
11 This program 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 this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
19 
20 #if !defined (DEFS_H)
21 #define DEFS_H 1
22 
23 #include <limits.h>
24 #include <stdio.h>
25 
26 /* First include ansidecl.h so we can use the various macro definitions
27    here and in all subsequent file inclusions.  */
28 
29 #include "ansidecl.h"
30 
31 /* An address in the program being debugged.  Host byte order.  */
32 typedef unsigned int CORE_ADDR;
33 
34 #define min(a, b) ((a) < (b) ? (a) : (b))
35 #define max(a, b) ((a) > (b) ? (a) : (b))
36 
37 /* The character C++ uses to build identifiers that must be unique from
38    the program's identifiers (such as $this and $$vptr).  */
39 #define CPLUS_MARKER '$'	/* May be overridden to '.' for SysV */
40 
41 #include <errno.h>		/* System call error return status */
42 
43 extern int quit_flag;
44 extern int immediate_quit;
45 
46 extern void
47 quit PARAMS ((void));
48 
49 #define QUIT { if (quit_flag) quit (); }
50 
51 /* Command classes are top-level categories into which commands are broken
52    down for "help" purposes.
53    Notes on classes: class_alias is for alias commands which are not
54    abbreviations of the original command.  class-pseudo is for commands
55    which are not really commands nor help topics ("stop").  */
56 
57 enum command_class
58 {
59   /* Special args to help_list */
60   all_classes = -2, all_commands = -1,
61   /* Classes of commands */
62   no_class = -1, class_run = 0, class_vars, class_stack,
63   class_files, class_support, class_info, class_breakpoint,
64   class_alias, class_obscure, class_user, class_maintenance,
65   class_pseudo
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 
78 struct cleanup
79 {
80   struct cleanup *next;
81   void (*function) PARAMS ((PTR));
82   PTR arg;
83 };
84 
85 /* From blockframe.c */
86 
87 extern int
88 inside_entry_func PARAMS ((CORE_ADDR));
89 
90 extern int
91 inside_entry_file PARAMS ((CORE_ADDR addr));
92 
93 extern int
94 inside_main_func PARAMS ((CORE_ADDR pc));
95 
96 /* From cplus-dem.c */
97 
98 extern char *
99 cplus_demangle PARAMS ((const char *, int));
100 
101 extern char *
102 cplus_mangle_opname PARAMS ((char *, int));
103 
104 /* From libmmalloc.a (memory mapped malloc library) */
105 
106 extern PTR
107 mmalloc_attach PARAMS ((int, PTR));
108 
109 extern PTR
110 mmalloc_detach PARAMS ((PTR));
111 
112 extern PTR
113 mmalloc PARAMS ((PTR, long));
114 
115 extern PTR
116 mrealloc PARAMS ((PTR, PTR, long));
117 
118 extern void
119 mfree PARAMS ((PTR, PTR));
120 
121 extern int
122 mmalloc_setkey PARAMS ((PTR, int, PTR));
123 
124 extern PTR
125 mmalloc_getkey PARAMS ((PTR, int));
126 
127 /* From utils.c */
128 
129 extern char *
130 demangle_and_match PARAMS ((const char *, const char *, int));
131 
132 extern int
133 strcmp_iw PARAMS ((const char *, const char *));
134 
135 extern char *
136 safe_strerror PARAMS ((int));
137 
138 extern char *
139 safe_strsignal PARAMS ((int));
140 
141 extern void
142 init_malloc PARAMS ((PTR));
143 
144 extern void
145 request_quit PARAMS ((int));
146 
147 extern void
148 do_cleanups PARAMS ((struct cleanup *));
149 
150 extern void
151 discard_cleanups PARAMS ((struct cleanup *));
152 
153 /* The bare make_cleanup function is one of those rare beasts that
154    takes almost any type of function as the first arg and anything that
155    will fit in a "void *" as the second arg.
156 
157    Should be, once all calls and called-functions are cleaned up:
158 extern struct cleanup *
159 make_cleanup PARAMS ((void (*function) (PTR), PTR));
160 
161    Until then, lint and/or various type-checking compiler options will
162    complain about make_cleanup calls.  It'd be wrong to just cast things,
163    since the type actually passed when the function is called would be
164    wrong.  */
165 
166 extern struct cleanup *
167 make_cleanup ();
168 
169 extern struct cleanup *
170 save_cleanups PARAMS ((void));
171 
172 extern void
173 restore_cleanups PARAMS ((struct cleanup *));
174 
175 extern void
176 free_current_contents PARAMS ((char **));
177 
178 extern void
179 null_cleanup PARAMS ((char **));
180 
181 extern int
182 myread PARAMS ((int, char *, int));
183 
184 extern int
185 query ();
186 
187 extern void
188 wrap_here PARAMS ((char *));
189 
190 extern void
191 reinitialize_more_filter PARAMS ((void));
192 
193 extern int
194 print_insn PARAMS ((CORE_ADDR, FILE *));
195 
196 extern void
197 fputs_filtered PARAMS ((const char *, FILE *));
198 
199 extern void
200 puts_filtered PARAMS ((char *));
201 
202 extern void
203 vfprintf_filtered ();
204 
205 extern void
206 fprintf_filtered ();
207 
208 extern void
209 fprintfi_filtered ();
210 
211 extern void
212 printf_filtered ();
213 
214 extern void
215 printfi_filtered ();
216 
217 extern void
218 print_spaces PARAMS ((int, FILE *));
219 
220 extern void
221 print_spaces_filtered PARAMS ((int, FILE *));
222 
223 extern char *
224 n_spaces PARAMS ((int));
225 
226 extern void
227 printchar PARAMS ((int, FILE *, int));
228 
229 extern char *
230 strdup_demangled PARAMS ((const char *));
231 
232 extern void
233 fprint_symbol PARAMS ((FILE *, char *));
234 
235 extern void
236 fputs_demangled PARAMS ((char *, FILE *, int));
237 
238 extern void
239 perror_with_name PARAMS ((char *));
240 
241 extern void
242 print_sys_errmsg PARAMS ((char *, int));
243 
244 /* From regex.c */
245 
246 extern char *
247 re_comp PARAMS ((char *));
248 
249 /* From symfile.c */
250 
251 extern void
252 symbol_file_command PARAMS ((char *, int));
253 
254 /* From main.c */
255 
256 extern char *
257 skip_quoted PARAMS ((char *));
258 
259 extern char *
260 gdb_readline PARAMS ((char *));
261 
262 extern char *
263 command_line_input PARAMS ((char *, int));
264 
265 extern void
266 print_prompt PARAMS ((void));
267 
268 extern int
269 batch_mode PARAMS ((void));
270 
271 extern int
272 input_from_terminal_p PARAMS ((void));
273 
274 extern int
275 catch_errors PARAMS ((int (*) (char *), char *, char *));
276 
277 /* From printcmd.c */
278 
279 extern void
280 set_next_address PARAMS ((CORE_ADDR));
281 
282 extern void
283 print_address_symbolic PARAMS ((CORE_ADDR, FILE *, int, char *));
284 
285 extern void
286 print_address PARAMS ((CORE_ADDR, FILE *));
287 
288 /* From source.c */
289 
290 extern int
291 openp PARAMS ((char *, int, char *, int, int, char **));
292 
293 extern void
294 mod_path PARAMS ((char *, char **));
295 
296 extern void
297 directory_command PARAMS ((char *, int));
298 
299 extern void
300 init_source_path PARAMS ((void));
301 
302 /* From findvar.c */
303 
304 extern int
305 read_relative_register_raw_bytes PARAMS ((int, char *));
306 
307 /* From readline (but not in any readline .h files).  */
308 
309 extern char *
310 tilde_expand PARAMS ((char *));
311 
312 /* Structure for saved commands lines
313    (for breakpoints, defined commands, etc).  */
314 
315 struct command_line
316 {
317   struct command_line *next;
318   char *line;
319   int type;                     /* statement type */
320 #define CL_END 0
321 #define CL_NORMAL 1
322 #define CL_WHILE 2
323 #define CL_IF 3
324 #define CL_EXITLOOP 4
325 #define CL_NOP 5
326   struct command_line *body;  /* body of loop for while, body of if */
327   struct command_line *elsebody; /* body of else part of if */
328 };
329 
330 extern struct command_line *
331 read_command_lines PARAMS ((int));
332 
333 extern void
334 free_command_lines PARAMS ((struct command_line *));
335 
336 /* String containing the current directory (what getwd would return).  */
337 
338 extern char *current_directory;
339 
340 /* Default radixes for input and output.  Only some values supported.  */
341 extern unsigned input_radix;
342 extern unsigned output_radix;
343 
344 /* Baud rate specified for communication with serial target systems.  */
345 extern char *baud_rate;
346 
347 /* Languages represented in the symbol table and elsewhere. */
348 
349 enum language
350 {
351    language_unknown, 		/* Language not known */
352    language_auto,		/* Placeholder for automatic setting */
353    language_c, 			/* C */
354    language_cplus, 		/* C++ */
355    language_m2			/* Modula-2 */
356 };
357 
358 /* Return a format string for printf that will print a number in the local
359    (language-specific) hexadecimal format.  Result is static and is
360    overwritten by the next call.  local_hex_format_custom takes printf
361    options like "08" or "l" (to produce e.g. %08x or %lx).  */
362 
363 #define local_hex_format() (current_language->la_hex_format)
364 
365 extern char *
366 local_hex_format_custom PARAMS ((char *));	/* language.c */
367 
368 /* Return a string that contains a number formatted in the local
369    (language-specific) hexadecimal format.  Result is static and is
370    overwritten by the next call.  local_hex_string_custom takes printf
371    options like "08" or "l".  */
372 
373 extern char *
374 local_hex_string PARAMS ((int));		/* language.c */
375 
376 extern char *
377 local_hex_string_custom PARAMS ((int, char *));	/* language.c */
378 
379 
380 /* Host machine definition.  This will be a symlink to one of the
381    xm-*.h files, built by the `configure' script.  */
382 
383 #include "xm.h"
384 
385 /* If the xm.h file did not define the mode string used to open the
386    files, assume that binary files are opened the same way as text
387    files */
388 #ifndef FOPEN_RB
389 #include "fopen-same.h"
390 #endif
391 
392 /*
393  * Allow things in gdb to be declared "const".  If compiling ANSI, it
394  * just works.  If compiling with gcc but non-ansi, redefine to __const__.
395  * If non-ansi, non-gcc, then eliminate "const" entirely, making those
396  * objects be read-write rather than read-only.
397  */
398 
399 #ifndef const
400 #ifndef __STDC__
401 # ifdef __GNUC__
402 #  define const __const__
403 # else
404 #  define const /*nothing*/
405 # endif /* GNUC */
406 #endif /* STDC */
407 #endif /* const */
408 
409 #ifndef volatile
410 #ifndef __STDC__
411 # ifdef __GNUC__
412 #  define volatile __volatile__
413 # else
414 #  define volatile /*nothing*/
415 # endif /* GNUC */
416 #endif /* STDC */
417 #endif /* volatile */
418 
419 /* Some compilers (many AT&T SVR4 compilers for instance), do not accept
420    declarations of functions that never return (exit for instance) as
421    "volatile void".  For such compilers "NORETURN" can be defined away
422    to keep them happy */
423 
424 #ifndef NORETURN
425 # ifdef __lucid
426 #   define NORETURN /*nothing*/
427 # else
428 #   define NORETURN volatile
429 # endif
430 #endif
431 
432 /* Defaults for system-wide constants (if not defined by xm.h, we fake it).  */
433 
434 #if !defined (UINT_MAX)
435 #define UINT_MAX 0xffffffff
436 #endif
437 
438 #if !defined (LONG_MAX)
439 #define LONG_MAX 0x7fffffff
440 #endif
441 
442 #if !defined (INT_MAX)
443 #define INT_MAX 0x7fffffff
444 #endif
445 
446 #if !defined (INT_MIN)
447 /* Two's complement, 32 bit.  */
448 #define INT_MIN -0x80000000
449 #endif
450 
451 /* Number of bits in a char or unsigned char for the target machine.
452    Just like CHAR_BIT in <limits.h> but describes the target machine.  */
453 #if !defined (TARGET_CHAR_BIT)
454 #define TARGET_CHAR_BIT 8
455 #endif
456 
457 /* Number of bits in a short or unsigned short for the target machine. */
458 #if !defined (TARGET_SHORT_BIT)
459 #define TARGET_SHORT_BIT (sizeof (short) * TARGET_CHAR_BIT)
460 #endif
461 
462 /* Number of bits in an int or unsigned int for the target machine. */
463 #if !defined (TARGET_INT_BIT)
464 #define TARGET_INT_BIT (sizeof (int) * TARGET_CHAR_BIT)
465 #endif
466 
467 /* Number of bits in a long or unsigned long for the target machine. */
468 #if !defined (TARGET_LONG_BIT)
469 #define TARGET_LONG_BIT (sizeof (long) * TARGET_CHAR_BIT)
470 #endif
471 
472 /* Number of bits in a long long or unsigned long long for the target machine. */
473 #if !defined (TARGET_LONG_LONG_BIT)
474 #define TARGET_LONG_LONG_BIT (2 * TARGET_LONG_BIT)
475 #endif
476 
477 /* Number of bits in a float for the target machine. */
478 #if !defined (TARGET_FLOAT_BIT)
479 #define TARGET_FLOAT_BIT (sizeof (float) * TARGET_CHAR_BIT)
480 #endif
481 
482 /* Number of bits in a double for the target machine. */
483 #if !defined (TARGET_DOUBLE_BIT)
484 #define TARGET_DOUBLE_BIT (sizeof (double) * TARGET_CHAR_BIT)
485 #endif
486 
487 /* Number of bits in a long double for the target machine. */
488 #if !defined (TARGET_LONG_DOUBLE_BIT)
489 #define TARGET_LONG_DOUBLE_BIT (2 * TARGET_DOUBLE_BIT)
490 #endif
491 
492 /* Number of bits in a "complex" for the target machine. */
493 #if !defined (TARGET_COMPLEX_BIT)
494 #define TARGET_COMPLEX_BIT (2 * TARGET_FLOAT_BIT)
495 #endif
496 
497 /* Number of bits in a "double complex" for the target machine. */
498 #if !defined (TARGET_DOUBLE_COMPLEX_BIT)
499 #define TARGET_DOUBLE_COMPLEX_BIT (2 * TARGET_DOUBLE_BIT)
500 #endif
501 
502 /* Number of bits in a pointer for the target machine */
503 #if !defined (TARGET_PTR_BIT)
504 #define TARGET_PTR_BIT TARGET_INT_BIT
505 #endif
506 
507 /* Convert a LONGEST to an int.  This is used in contexts (e.g. number
508    of arguments to a function, number in a value history, register
509    number, etc.) where the value must not be larger than can fit
510    in an int.  */
511 #if !defined (longest_to_int)
512 #if defined (LONG_LONG)
513 #define longest_to_int(x) (((x) > INT_MAX || (x) < INT_MIN) \
514 			   ? (error ("Value out of range."),0) : (int) (x))
515 #else /* No LONG_LONG.  */
516 /* Assume sizeof (int) == sizeof (long).  */
517 #define longest_to_int(x) ((int) (x))
518 #endif /* No LONG_LONG.  */
519 #endif /* No longest_to_int.  */
520 
521 /* This should not be a typedef, because "unsigned LONGEST" needs
522    to work. LONG_LONG is defined if the host has "long long".  */
523 
524 #ifndef LONGEST
525 # ifdef LONG_LONG
526 #  define LONGEST long long
527 # else
528 #  define LONGEST long
529 # endif
530 #endif
531 
532 /* Assorted functions we can declare, now that const and volatile are
533    defined.  */
534 
535 extern char *
536 savestring PARAMS ((const char *, int));
537 
538 extern char *
539 msavestring PARAMS ((void *, const char *, int));
540 
541 extern char *
542 strsave PARAMS ((const char *));
543 
544 extern char *
545 mstrsave PARAMS ((void *, const char *));
546 
547 extern char *
548 concat PARAMS ((char *, ...));
549 
550 extern PTR
551 xmalloc PARAMS ((long));
552 
553 extern PTR
554 xrealloc PARAMS ((PTR, long));
555 
556 extern PTR
557 xmmalloc PARAMS ((PTR, long));
558 
559 extern PTR
560 xmrealloc PARAMS ((PTR, PTR, long));
561 
562 extern PTR
563 mmalloc PARAMS ((PTR, long));
564 
565 extern PTR
566 mrealloc PARAMS ((PTR, PTR, long));
567 
568 extern void
569 mfree PARAMS ((PTR, PTR));
570 
571 extern int
572 mmcheck PARAMS ((PTR, void (*) (void)));
573 
574 extern int
575 mmtrace PARAMS ((void));
576 
577 extern int
578 parse_escape PARAMS ((char **));
579 
580 extern const char * const reg_names[];
581 
582 extern NORETURN void			/* Does not return to the caller.  */
583 error ();
584 
585 extern NORETURN void			/* Does not return to the caller.  */
586 fatal ();
587 
588 extern NORETURN void			/* Not specified as volatile in ... */
589 exit PARAMS ((int));			/* 4.10.4.3 */
590 
591 extern NORETURN void			/* Does not return to the caller.  */
592 nomem PARAMS ((long));
593 
594 extern NORETURN void			/* Does not return to the caller.  */
595 return_to_top_level PARAMS ((void));
596 
597 extern void
598 warning_setup PARAMS ((void));
599 
600 extern void
601 warning ();
602 
603 /* Global functions from other, non-gdb GNU thingies (libiberty for
604    instance) */
605 
606 extern char *
607 basename PARAMS ((char *));
608 
609 extern char *
610 getenv PARAMS ((const char *));
611 
612 extern char **
613 buildargv PARAMS ((char *));
614 
615 extern void
616 freeargv PARAMS ((char **));
617 
618 extern char *
619 strerrno PARAMS ((int));
620 
621 extern char *
622 strsigno PARAMS ((int));
623 
624 extern int
625 errno_max PARAMS ((void));
626 
627 extern int
628 signo_max PARAMS ((void));
629 
630 extern int
631 strtoerrno PARAMS ((char *));
632 
633 extern int
634 strtosigno PARAMS ((char *));
635 
636 extern char *
637 strsignal PARAMS ((int));
638 
639 /* From other system libraries */
640 
641 #ifndef PSIGNAL_IN_SIGNAL_H
642 extern void
643 psignal PARAMS ((unsigned, const char *));
644 #endif
645 
646 /* For now, we can't include <stdlib.h> because it conflicts with
647    "../include/getopt.h".  (FIXME)
648 
649    However, if a function is defined in the ANSI C standard and a prototype
650    for that function is defined and visible in any header file in an ANSI
651    conforming environment, then that prototype must match the definition in
652    the ANSI standard.  So we can just duplicate them here without conflict,
653    since they must be the same in all conforming ANSI environments.  If
654    these cause problems, then the environment is not ANSI conformant. */
655 
656 #ifdef __STDC__
657 #include <stddef.h>
658 #endif
659 
660 extern int
661 fclose PARAMS ((FILE *stream));				/* 4.9.5.1 */
662 
663 extern void
664 perror PARAMS ((const char *));				/* 4.9.10.4 */
665 
666 extern double
667 atof PARAMS ((const char *nptr));			/* 4.10.1.1 */
668 
669 extern int
670 atoi PARAMS ((const char *));				/* 4.10.1.2 */
671 
672 #ifndef MALLOC_INCOMPATIBLE
673 
674 extern PTR
675 malloc PARAMS ((size_t size));                          /* 4.10.3.3 */
676 
677 extern PTR
678 realloc PARAMS ((void *ptr, size_t size));              /* 4.10.3.4 */
679 
680 extern void
681 free PARAMS ((void *));					/* 4.10.3.2 */
682 
683 #endif	/* MALLOC_INCOMPATIBLE */
684 
685 extern void
686 qsort PARAMS ((void *base, size_t nmemb,		/* 4.10.5.2 */
687 	       size_t size,
688 	       int (*comp)(const void *, const void *)));
689 
690 #ifndef	MEM_FNS_DECLARED	/* Some non-ANSI use void *, not char *.  */
691 extern PTR
692 memcpy PARAMS ((void *, const void *, size_t));		/* 4.11.2.1 */
693 #endif
694 
695 extern int
696 memcmp PARAMS ((const void *, const void *, size_t));	/* 4.11.4.1 */
697 
698 extern char *
699 strchr PARAMS ((const char *, int));			/* 4.11.5.2 */
700 
701 extern char *
702 strrchr PARAMS ((const char *, int));			/* 4.11.5.5 */
703 
704 extern char *
705 strstr PARAMS ((const char *, const char *));		/* 4.11.5.7 */
706 
707 extern char *
708 strtok PARAMS ((char *, const char *));			/* 4.11.5.8 */
709 
710 #ifndef	MEM_FNS_DECLARED	/* Some non-ANSI use void *, not char *.  */
711 extern PTR
712 memset PARAMS ((void *, int, size_t));			/* 4.11.6.1 */
713 #endif
714 
715 extern char *
716 strerror PARAMS ((int));				/* 4.11.6.2 */
717 
718 /* Various possibilities for alloca.  */
719 #ifndef alloca
720 # ifdef notdef /*XXX*/
721 #  define alloca __builtin_alloca
722 # else
723 #  if defined(sparc) && !defined(__GNUC__)
724 #   include <alloca.h>		/* NOTE:  Doesn't declare alloca() */
725 #  endif
726 #  ifdef __STDC__
727    extern void *alloca (size_t);
728 #  else /* __STDC__ */
729    extern char *alloca ();
730 #  endif
731 # endif
732 #endif
733 
734 /* TARGET_BYTE_ORDER and HOST_BYTE_ORDER must be defined to one of these.  */
735 
736 #if !defined (BIG_ENDIAN)
737 #define BIG_ENDIAN 4321
738 #endif
739 
740 #if !defined (LITTLE_ENDIAN)
741 #define LITTLE_ENDIAN 1234
742 #endif
743 
744 /* Target-system-dependent parameters for GDB.
745 
746    The standard thing is to include defs.h.  However, files that are
747    specific to a particular target can define TM_FILE_OVERRIDE before
748    including defs.h, then can include any particular tm-file they desire.  */
749 
750 /* Target machine definition.  This will be a symlink to one of the
751    tm-*.h files, built by the `configure' script.  */
752 
753 #ifndef TM_FILE_OVERRIDE
754 #include "tm.h"
755 #endif
756 
757 /* The bit byte-order has to do just with numbering of bits in
758    debugging symbols and such.  Conceptually, it's quite separate
759    from byte/word byte order.  */
760 
761 #if !defined (BITS_BIG_ENDIAN)
762 #if TARGET_BYTE_ORDER == BIG_ENDIAN
763 #define BITS_BIG_ENDIAN 1
764 #endif /* Big endian.  */
765 
766 #if TARGET_BYTE_ORDER == LITTLE_ENDIAN
767 #define BITS_BIG_ENDIAN 0
768 #endif /* Little endian.  */
769 #endif /* BITS_BIG_ENDIAN not defined.  */
770 
771 /* Swap LEN bytes at BUFFER between target and host byte-order.  */
772 #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
773 #define SWAP_TARGET_AND_HOST(buffer,len)
774 #else /* Target and host byte order differ.  */
775 #define SWAP_TARGET_AND_HOST(buffer,len) \
776   {	       	       	       	       	       	       	       	       	 \
777     char tmp;								 \
778     char *p = (char *)(buffer);						 \
779     char *q = ((char *)(buffer)) + len - 1;		   		 \
780     for (; p < q; p++, q--)				 		 \
781       {									 \
782         tmp = *q;							 \
783         *q = *p;							 \
784         *p = tmp;							 \
785       }									 \
786   }
787 #endif /* Target and host byte order differ.  */
788 
789 /* On some machines there are bits in addresses which are not really
790    part of the address, but are used by the kernel, the hardware, etc.
791    for special purposes.  ADDR_BITS_REMOVE takes out any such bits
792    so we get a "real" address such as one would find in a symbol
793    table.  ADDR_BITS_SET sets those bits the way the system wants
794    them.  */
795 #if !defined (ADDR_BITS_REMOVE)
796 #define ADDR_BITS_REMOVE(addr) (addr)
797 #define ADDR_BITS_SET(addr) (addr)
798 #endif /* No ADDR_BITS_REMOVE.  */
799 
800 /* If this definition isn't overridden by the header files, assume
801    that isatty and fileno exist on this system.  */
802 #ifndef ISATTY
803 #define ISATTY(FP)    (isatty(fileno(FP)))
804 #endif
805 
806 /* From valops.c */
807 
808 extern CORE_ADDR
809 push_bytes PARAMS ((CORE_ADDR, char *, int));
810 
811 /* In some modules, we don't have a definition of REGISTER_TYPE yet, so we
812    must avoid prototyping this function for now.  FIXME.  Should be:
813 extern CORE_ADDR
814 push_word PARAMS ((CORE_ADDR, REGISTER_TYPE));
815  */
816 extern CORE_ADDR
817 push_word ();
818 
819 /* Some parts of gdb might be considered optional, in the sense that they
820    are not essential for being able to build a working, usable debugger
821    for a specific environment.  For example, the maintenance commands
822    are there for the benefit of gdb maintainers.  As another example,
823    some environments really don't need gdb's that are able to read N
824    different object file formats.  In order to make it possible (but
825    not necessarily recommended) to build "stripped down" versions of
826    gdb, the following defines control selective compilation of those
827    parts of gdb which can be safely left out when necessary.  Note that
828    the default is to include everything. */
829 
830 #ifndef MAINTENANCE_CMDS
831 #define MAINTENANCE_CMDS 1
832 #endif
833 
834 #endif /* !defined (DEFS_H) */
835