home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / gdb / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-08  |  3.4 KB  |  123 lines

  1. /*-
  2.  * This code is derived from software copyrighted by the Free Software
  3.  * Foundation.
  4.  *
  5.  * Modified 1991 by Donn Seeley at UUNET Technologies, Inc.
  6.  * Modified 1990 by Van Jacobson at Lawrence Berkeley Laboratory.
  7.  *
  8.  *    @(#)defs.h    6.3 (Berkeley) 5/8/91
  9.  */
  10.  
  11. /* Basic definitions for GDB, the GNU debugger.
  12.    Copyright (C) 1986, 1989 Free Software Foundation, Inc.
  13.  
  14. This file is part of GDB.
  15.  
  16. GDB is free software; you can redistribute it and/or modify
  17. it under the terms of the GNU General Public License as published by
  18. the Free Software Foundation; either version 1, or (at your option)
  19. any later version.
  20.  
  21. GDB is distributed in the hope that it will be useful,
  22. but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24. GNU General Public License for more details.
  25.  
  26. You should have received a copy of the GNU General Public License
  27. along with GDB; see the file COPYING.  If not, write to
  28. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  29.  
  30. #define CORE_ADDR unsigned int
  31.  
  32. #define min(a, b) ((a) < (b) ? (a) : (b))
  33. #define max(a, b) ((a) > (b) ? (a) : (b))
  34.  
  35. extern char *savestring ();
  36. extern char *concat ();
  37. extern char *xmalloc (), *xrealloc ();
  38. extern int parse_escape ();
  39. extern char *reg_names[];
  40.  
  41. /* Various possibilities for alloca.  */
  42. #ifdef sparc
  43. #include <alloca.h>
  44. #else
  45. #ifdef __GNUC__
  46. #define alloca __builtin_alloca
  47. #else
  48. extern char *alloca ();
  49. #endif
  50. #endif
  51.  
  52. extern int quit_flag;
  53.  
  54. extern int immediate_quit;
  55.  
  56. #define QUIT { if (quit_flag) quit (); }
  57.  
  58. /* Notes on classes: class_alias is for alias commands which are not
  59.    abbreviations of the original command.  */
  60.  
  61. enum command_class
  62. {
  63.   no_class = -1, class_run = 0, class_vars, class_stack,
  64.   class_files, class_support, class_info, class_breakpoint,
  65.   class_alias, class_obscure, class_user,
  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) ();
  82.   int arg;
  83. };
  84.  
  85. extern void do_cleanups ();
  86. extern void discard_cleanups ();
  87. extern struct cleanup *make_cleanup ();
  88. extern struct cleanup *save_cleanups ();
  89. extern void restore_cleanups ();
  90. extern void free_current_contents ();
  91. extern void reinitialize_more_filter ();
  92. extern void fputs_filtered ();
  93. extern void fprintf_filtered ();
  94. extern void printf_filtered ();
  95. extern void print_spaces_filtered ();
  96. extern char *tilde_expand ();
  97.  
  98. /* Structure for saved commands lines
  99.    (for breakpoints, defined commands, etc).  */
  100.  
  101. struct command_line
  102. {
  103.   struct command_line *next;
  104.   char *line;
  105.   int type;            /* statement type */
  106. #define CL_END 0
  107. #define CL_NORMAL 1
  108. #define CL_WHILE 2
  109. #define CL_IF 3
  110. #define CL_EXITLOOP 4
  111. #define CL_NOP 5
  112.   struct command_line *body;  /* body of loop for while, body of if */
  113.   struct command_line *elsebody; /* body of else part of if */
  114. };
  115.  
  116. extern struct command_line *read_command_lines ();
  117. extern void do_command_lines();
  118.  
  119. /* String containing the current directory (what getwd would return).  */
  120.  
  121. char *current_directory;
  122.  
  123.