2003-05-30 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / defs.h
index 230364517900fd6cf6cda8efaa994f72f2042ad7..a90ef9ef7c0fcb58eef961b3efa461f0a4145208 100644 (file)
@@ -1,7 +1,7 @@
 /* *INDENT-OFF* */ /* ATTR_FORMAT confuses indent, avoid running it for now */
 /* Basic, host-specific, and target-specific definitions for GDB.
    Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001, 2002
+   1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 #ifndef DEFS_H
 #define DEFS_H
 
-#include "config.h"            /* Generated by configure */
+#include "config.h"            /* Generated by configure.  */
+
 #include <stdio.h>
-#include <errno.h>             /* System call error return status */
+#include <errno.h>             /* System call error return status */
 #include <limits.h>
 
 #ifdef HAVE_STDDEF_H
 #include <stddef.h>
 #else
-#include <sys/types.h>         /* for size_t */
+#include <sys/types.h>         /* For size_t.  */
 #endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
+/* First include ansidecl.h so we can use the various macro definitions
+   here and in all subsequent file inclusions.  */
+
+#include "ansidecl.h"
+
+#include "gdb_locale.h"
+
 /* For ``enum target_signal''.  */
 #include "gdb/signals.h"
 
-/* Just in case they're not defined in stdio.h. */
+/* Just in case they're not defined in stdio.h.  */
 
 #ifndef SEEK_SET
 #define SEEK_SET 0
 #define SEEK_CUR 1
 #endif
 
-/* First include ansidecl.h so we can use the various macro definitions
-   here and in all subsequent file inclusions.  */
-
-#include "ansidecl.h"
-
-#include <stdarg.h>            /* for va_list */
+#include <stdarg.h>            /* For va_list.  */
 
 #include "libiberty.h"
 
@@ -154,22 +157,18 @@ typedef bfd_vma CORE_ADDR;
 #define STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
 #define STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
 
-/* The character GNU C++ uses to build identifiers that must be unique from
-   the program's identifiers (such as $this and $$vptr).  */
-#define CPLUS_MARKER '$'       /* May be overridden to '.' for SysV */
-
 /* Check if a character is one of the commonly used C++ marker characters.  */
 extern int is_cplus_marker (int);
 
-/* use tui interface if non-zero */
-extern int tui_version;
-
 /* enable xdb commands if set */
 extern int xdb_commands;
 
 /* enable dbx commands if set */
 extern int dbx_commands;
 
+/* System root path, used to find libraries etc.  */
+extern char *gdb_sysroot;
+
 extern int quit_flag;
 extern int immediate_quit;
 extern int sevenbit_strings;
@@ -206,13 +205,14 @@ enum language
     language_auto,             /* Placeholder for automatic setting */
     language_c,                        /* C */
     language_cplus,            /* C++ */
+    language_objc,             /* Objective-C */
     language_java,             /* Java */
-    language_chill,            /* Chill */
     language_fortran,          /* Fortran */
     language_m2,               /* Modula-2 */
     language_asm,              /* Assembly language */
     language_scm,              /* Scheme / Guile */
-    language_pascal            /* Pascal */
+    language_pascal,           /* Pascal */
+    language_minimal           /* All other languages, minimal support only */
   };
 
 enum precision_type
@@ -222,6 +222,14 @@ enum precision_type
     unspecified_precision
   };
 
+/* A generic, not quite boolean, enumeration.  */
+enum auto_boolean
+{
+  AUTO_BOOLEAN_TRUE,
+  AUTO_BOOLEAN_FALSE,
+  AUTO_BOOLEAN_AUTO
+};
+
 /* the cleanup list records things that have to be undone
    if an error happens (descriptors to be closed, memory to be freed, etc.)
    Each link in the chain records a function to call and an
@@ -235,8 +243,8 @@ enum precision_type
 struct cleanup
   {
     struct cleanup *next;
-    void (*function) (PTR);
-    PTR arg;
+    void (*function) (void *);
+    void *arg;
   };
 
 
@@ -290,10 +298,6 @@ extern int inside_entry_file (CORE_ADDR addr);
 
 extern int inside_main_func (CORE_ADDR pc);
 
-/* From ch-lang.c, for the moment. (FIXME) */
-
-extern char *chill_demangle (const char *);
-
 /* From utils.c */
 
 extern void initialize_utils (void);
@@ -302,6 +306,10 @@ extern void notice_quit (void);
 
 extern int strcmp_iw (const char *, const char *);
 
+extern int strcmp_iw_ordered (const char *, const char *);
+
+extern int streq (const char *, const char *);
+
 extern int subset_compare (char *, char *);
 
 extern char *safe_strerror (int);
@@ -368,10 +376,11 @@ extern int query (const char *, ...) ATTR_FORMAT (printf, 1, 2);
 
 extern void init_page_info (void);
 
-extern CORE_ADDR host_pointer_to_address (void *ptr);
-extern void *address_to_host_pointer (CORE_ADDR addr);
-
 extern char *gdb_realpath (const char *);
+extern char *xfullpath (const char *);
+
+extern unsigned long gnu_debuglink_crc32 (unsigned long crc,
+                                          unsigned char *buf, size_t len);
 
 /* From demangle.c */
 
@@ -383,7 +392,6 @@ struct type;
 typedef int (use_struct_convention_fn) (int gcc_p, struct type * value_type);
 extern use_struct_convention_fn generic_use_struct_convention;
 
-typedef unsigned char *(breakpoint_from_pc_fn) (CORE_ADDR * pcptr, int *lenptr);
 \f
 /* Annotation stuff.  */
 
@@ -435,6 +443,8 @@ extern void puts_filtered (const char *);
 
 extern void puts_unfiltered (const char *);
 
+extern void puts_filtered_tabular (char *string, int width, int right);
+
 extern void puts_debug (char *prefix, char *string, char *suffix);
 
 extern void vprintf_filtered (const char *, va_list) ATTR_FORMAT (printf, 1, 0);
@@ -470,7 +480,7 @@ extern void fputstr_unfiltered (const char *str, int quotr, struct ui_file * str
 extern void fputstrn_unfiltered (const char *str, int n, int quotr, struct ui_file * stream);
 
 /* Display the host ADDR on STREAM formatted as ``0x%x''. */
-extern void gdb_print_host_address (void *addr, struct ui_file *stream);
+extern void gdb_print_host_address (const void *addr, struct ui_file *stream);
 
 /* Convert a CORE_ADDR into a HEX string.  paddr() is like %08lx.
    paddr_nz() is like %lx.  paddr_u() is like %lu. paddr_width() is
@@ -525,6 +535,8 @@ extern char *skip_quoted (char *);
 
 extern char *gdb_readline (char *);
 
+extern char *gdb_readline_wrapper (char *);
+
 extern char *command_line_input (char *, int, char *);
 
 extern void print_prompt (void);
@@ -560,10 +572,16 @@ extern int source_full_path_of (char *, char **);
 
 extern void mod_path (char *, char **);
 
+extern void add_path (char *, char **, int);
+
 extern void directory_command (char *, int);
 
+extern char *source_path;
+
 extern void init_source_path (void);
 
+extern void init_last_source_visited (void);
+
 extern char *symtab_to_filename (struct symtab *);
 
 /* From exec.c */
@@ -579,10 +597,6 @@ extern void exec_set_find_memory_regions (int (*) (int (*) (CORE_ADDR,
                                                            void *),
                                                   void *));
 
-/* From findvar.c */
-
-extern int read_relative_register_raw_bytes (int, char *);
-
 /* Possible lvalue types.  Like enum language, this should be in
    value.h, but needs to be here for the same reason. */
 
@@ -606,10 +620,6 @@ enum lval_type
 
 struct frame_info;
 
-/* From readline (but not in any readline .h files).  */
-
-extern char *tilde_expand (char *);
-
 /* Control types for commands */
 
 enum misc_command_type
@@ -840,6 +850,12 @@ extern void xmfree (void *md, void *ptr);
    "libiberty.h". */
 extern void xfree (void *);
 
+/* Utility macros to allocate typed memory.  Avoids errors like
+   ``struct foo *foo = xmalloc (sizeof bar)'' and ``struct foo *foo =
+   (struct foo *) xmalloc (sizeof bar)''.  */
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+#define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE)))
+
 /* Like asprintf/vasprintf but get an internal_error if the call
    fails. */
 extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
@@ -861,7 +877,7 @@ extern char *warning_pre_print;
 
 extern NORETURN void verror (const char *fmt, va_list ap) ATTR_NORETURN;
 
-extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN;
+extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
 
 extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
 
@@ -875,6 +891,12 @@ extern NORETURN void internal_verror (const char *file, int line,
 extern NORETURN void internal_error (const char *file, int line,
                                     const char *, ...) ATTR_NORETURN ATTR_FORMAT (printf, 3, 4);
 
+extern void internal_vwarning (const char *file, int line,
+                              const char *, va_list ap);
+
+extern void internal_warning (const char *file, int line,
+                             const char *, ...) ATTR_FORMAT (printf, 3, 4);
+
 extern NORETURN void nomem (long) ATTR_NORETURN;
 
 /* Reasons for calling throw_exception().  NOTE: all reason values
@@ -947,8 +969,8 @@ extern int catch_exceptions (struct ui_out *uiout,
 
    This function is superseeded by catch_exceptions().  */
 
-typedef int (catch_errors_ftype) (PTR);
-extern int catch_errors (catch_errors_ftype *, PTR, char *, return_mask);
+typedef int (catch_errors_ftype) (void *);
+extern int catch_errors (catch_errors_ftype *, void *, char *, return_mask);
 
 /* Template to catch_errors() that wraps calls to command
    functions. */
@@ -960,6 +982,42 @@ extern void warning (const char *, ...) ATTR_FORMAT (printf, 1, 2);
 
 extern void vwarning (const char *, va_list args);
 
+/* List of known OS ABIs.  If you change this, make sure to update the
+   table in osabi.c.  */
+enum gdb_osabi
+{
+  GDB_OSABI_UNINITIALIZED = -1, /* For struct gdbarch_info.  */
+
+  GDB_OSABI_UNKNOWN = 0,       /* keep this zero */
+
+  GDB_OSABI_SVR4,
+  GDB_OSABI_HURD,
+  GDB_OSABI_SOLARIS,
+  GDB_OSABI_OSF1,
+  GDB_OSABI_LINUX,
+  GDB_OSABI_FREEBSD_AOUT,
+  GDB_OSABI_FREEBSD_ELF,
+  GDB_OSABI_NETBSD_AOUT,
+  GDB_OSABI_NETBSD_ELF,
+  GDB_OSABI_WINCE,
+  GDB_OSABI_GO32,
+  GDB_OSABI_NETWARE,
+  GDB_OSABI_IRIX,
+  GDB_OSABI_LYNXOS,
+  GDB_OSABI_INTERIX,
+  GDB_OSABI_HPUX_ELF,
+  GDB_OSABI_HPUX_SOM,
+
+  GDB_OSABI_ARM_EABI_V1,
+  GDB_OSABI_ARM_EABI_V2,
+  GDB_OSABI_ARM_APCS,
+  GDB_OSABI_QNXNTO,
+
+  GDB_OSABI_CYGWIN,
+
+  GDB_OSABI_INVALID            /* keep this last */
+};
+
 /* Global functions from other, non-gdb GNU thingies.
    Libiberty thingies are no longer declared here.  We include libiberty.h
    above, instead.  */
@@ -1028,6 +1086,11 @@ extern void *alloca ();
 #include "arch-utils.h"
 #endif
 
+/* Maximum size of a register.  Something small, but large enough for
+   all known ISAs.  If it turns out to be too small, make it bigger.  */
+
+enum { MAX_REGISTER_SIZE = 16 };
+
 /* Static target-system-dependent parameters for GDB. */
 
 /* Number of bits in a char or unsigned char for the target machine.
@@ -1057,22 +1120,20 @@ extern void *alloca ();
 
 /* In findvar.c.  */
 
-extern LONGEST extract_signed_integer (void *, int);
+extern LONGEST extract_signed_integer (const void *, int);
 
-extern ULONGEST extract_unsigned_integer (void *, int);
+extern ULONGEST extract_unsigned_integer (const void *, int);
 
-extern int extract_long_unsigned_integer (void *, int, LONGEST *);
+extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
 
-extern CORE_ADDR extract_address (void *, int);
+extern CORE_ADDR extract_address (const void *, int);
 
-extern CORE_ADDR extract_typed_address (void *buf, struct type *type);
+extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
 
 extern void store_signed_integer (void *, int, LONGEST);
 
 extern void store_unsigned_integer (void *, int, ULONGEST);
 
-extern void store_address (void *, int, LONGEST);
-
 extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
 
 \f
This page took 0.030587 seconds and 4 git commands to generate.