* language.c (local_hex_format_custom): Remove.
[deliverable/binutils-gdb.git] / gdb / defs.h
index 9db0af2cdc2e4005499584eb67c1ea6a7104a1fa..ff5a4d5c2c3011e44d4f98ff72503a1d77cc5794 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, 2003
+   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "libiberty.h"
 
-#include "progress.h"
-
 /* For BFD64 and bfd_vma.  */
 #include "bfd.h"
 
-
-/* The target is partially multi-arched.  Both "tm.h" and the
-   multi-arch vector provide definitions.  "tm.h" normally overrides
-   the multi-arch vector (but there are a few exceptions).  */
-
-#define GDB_MULTI_ARCH_PARTIAL 1
-
-/* The target is partially multi-arched. Both the multi-arch vector
-   and "tm.h" provide definitions. "tm.h" cannot override a definition
-   provided by the multi-arch vector.  It is detected as a compilation
-   error.
-
-   This setting is only useful during a multi-arch conversion. */
-
-#define GDB_MULTI_ARCH_TM 2
-
-/* The target is pure multi-arch.  The MULTI-ARCH vector provides all
-   definitions.  "tm.h" is linked to an empty file. */
-
-#define GDB_MULTI_ARCH_PURE 3
-
-
-
 /* An address in the program being debugged.  Host byte order.  Rather
    than duplicate all the logic in BFD which figures out what type
    this is (long, long long, etc.) and whether it needs to be 64
@@ -200,8 +175,7 @@ extern void quit (void);
 #else
 #define QUIT { \
   if (quit_flag) quit (); \
-  if (interactive_hook) interactive_hook (); \
-  PROGRESS (1); \
+  if (deprecated_interactive_hook) deprecated_interactive_hook (); \
 }
 #endif
 
@@ -223,7 +197,8 @@ enum language
     language_asm,              /* Assembly language */
     language_scm,              /* Scheme / Guile */
     language_pascal,           /* Pascal */
-    language_minimal           /* All other languages, minimal support only */
+    language_minimal,          /* All other languages, minimal support only */
+    nr_languages
   };
 
 enum precision_type
@@ -253,7 +228,19 @@ enum return_value_convention
      should be stored.  While typically, and historically, used for
      large structs, this is convention is applied to values of many
      different types.  */
-  RETURN_VALUE_STRUCT_CONVENTION
+  RETURN_VALUE_STRUCT_CONVENTION,
+  /* Like the "struct return convention" above, but where the ABI
+     guarantees that the called function stores the address at which
+     the value being returned is stored in a well-defined location,
+     such as a register or memory slot in the stack frame.  Don't use
+     this if the ABI doesn't explicitly guarantees this.  */
+  RETURN_VALUE_ABI_RETURNS_ADDRESS,
+  /* Like the "struct return convention" above, but where the ABI
+     guarantees that the address at which the value being returned is
+     stored will be available in a well-defined location, such as a
+     register or memory slot in the stack frame.  Don't use this if
+     the ABI doesn't explicitly guarantees this.  */
+  RETURN_VALUE_ABI_PRESERVES_ADDRESS,
 };
 
 /* the cleanup list records things that have to be undone
@@ -324,14 +311,11 @@ struct cleanup
 
 struct symtab;
 struct breakpoint;
+struct frame_info;
 
 /* From blockframe.c */
 
-extern int inside_entry_func (CORE_ADDR);
-
-extern int deprecated_inside_entry_file (CORE_ADDR addr);
-
-extern int inside_main_func (CORE_ADDR pc);
+extern int inside_entry_func (struct frame_info *this_frame);
 
 /* From utils.c */
 
@@ -349,13 +333,10 @@ extern int subset_compare (char *, char *);
 
 extern char *safe_strerror (int);
 
-extern void init_malloc (void *);
-
 extern void request_quit (int);
 
 extern void do_cleanups (struct cleanup *);
 extern void do_final_cleanups (struct cleanup *);
-extern void do_my_cleanups (struct cleanup **, struct cleanup *);
 extern void do_run_cleanups (struct cleanup *);
 extern void do_exec_cleanups (struct cleanup *);
 extern void do_exec_error_cleanups (struct cleanup *);
@@ -379,6 +360,10 @@ extern struct cleanup *make_cleanup_freeargv (char **);
 struct ui_file;
 extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *);
 
+struct section_addr_info;
+extern struct cleanup *(make_cleanup_free_section_addr_info 
+                        (struct section_addr_info *));
+
 extern struct cleanup *make_cleanup_close (int fd);
 
 extern struct cleanup *make_cleanup_bfd_close (bfd *abfd);
@@ -408,6 +393,8 @@ extern void null_cleanup (void *);
 extern int myread (int, char *, int);
 
 extern int query (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern int nquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
+extern int yquery (const char *, ...) ATTR_FORMAT (printf, 1, 2);
 
 extern void init_page_info (void);
 
@@ -445,22 +432,18 @@ extern struct ui_file *gdb_stdin;
 /* Serious error notifications */
 extern struct ui_file *gdb_stderr;
 /* Log/debug/trace messages that should bypass normal stdout/stderr
-   filtering.  For momement, always call this stream using
+   filtering.  For moment, always call this stream using
    *_unfiltered. In the very near future that restriction shall be
    removed - either call shall be unfiltered. (cagney 1999-06-13). */
 extern struct ui_file *gdb_stdlog;
 /* Target output that should bypass normal stdout/stderr filtering.
-   For momement, always call this stream using *_unfiltered. In the
+   For moment, always call this stream using *_unfiltered. In the
    very near future that restriction shall be removed - either call
    shall be unfiltered. (cagney 1999-07-02). */
 extern struct ui_file *gdb_stdtarg;
 extern struct ui_file *gdb_stdtargerr;
 extern struct ui_file *gdb_stdtargin;
 
-#if defined(TUI)
-#include "tui.h"
-#endif
-
 #include "ui-file.h"
 
 /* More generic printf like operations.  Filtered versions may return
@@ -532,6 +515,7 @@ extern char *paddr_d (LONGEST addr);
 
 extern char *phex (ULONGEST l, int sizeof_l);
 extern char *phex_nz (ULONGEST l, int sizeof_l);
+extern char *int_string (LONGEST, int, int, int, int);
 
 /* Like paddr() only print/scan raw CORE_ADDR.  The output from
    core_addr_to_string() can be passed direct to
@@ -605,6 +589,9 @@ extern void print_address (CORE_ADDR, struct ui_file *);
 
 /* From source.c */
 
+#define OPF_TRY_CWD_FIRST     0x01
+#define OPF_SEARCH_IN_PATH    0x02
+
 extern int openp (const char *, int, const char *, int, int, char **);
 
 extern int source_full_path_of (char *, char **);
@@ -621,8 +608,6 @@ extern void init_source_path (void);
 
 extern void init_last_source_visited (void);
 
-extern char *symtab_to_filename (struct symtab *);
-
 /* From exec.c */
 
 extern void exec_set_section_offsets (bfd_signed_vma text_off,
@@ -657,8 +642,6 @@ enum lval_type
     lval_reg_frame_relative
   };
 
-struct frame_info;
-
 /* Control types for commands */
 
 enum misc_command_type
@@ -868,13 +851,6 @@ extern char *msavestring (void *, const char *, size_t);
 
 extern char *mstrsave (void *, const char *);
 
-/* Robust versions of same.  Throw an internal error when no memory,
-   guard against stray NULL arguments. */
-extern void *xmmalloc (void *md, size_t size);
-extern void *xmrealloc (void *md, void *ptr, size_t size);
-extern void *xmcalloc (void *md, size_t number, size_t size);
-extern void xmfree (void *md, void *ptr);
-
 /* xmalloc(), xrealloc() and xcalloc() have already been declared in
    "libiberty.h". */
 extern void xfree (void *);
@@ -891,8 +867,10 @@ extern void xfree (void *);
 extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
 extern void xvasprintf (char **ret, const char *format, va_list ap);
 
-/* Like asprintf, but return the string, throw an error if no memory.  */
+/* Like asprintf and vasprintf, but return the string, throw an error
+   if no memory.  */
 extern char *xstrprintf (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
+extern char *xstrvprintf (const char *format, va_list ap);
 
 extern int parse_escape (char **);
 
@@ -912,6 +890,8 @@ extern NORETURN void verror (const char *fmt, va_list ap) ATTR_NORETURN;
 
 extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
 
+extern NORETURN void error_silent (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
+
 extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
 
 /* Initialize the error buffer.  */
@@ -921,6 +901,9 @@ extern void error_init (void);
    message.  */
 extern char *error_last_message (void);
 
+/* Output arbitrary error message.  */
+extern void error_output_message (char *pre_print, char *msg);
+
 extern NORETURN void internal_verror (const char *file, int line,
                                      const char *, va_list ap) ATTR_NORETURN;
 
@@ -983,6 +966,11 @@ extern NORETURN void throw_exception (enum return_reason) ATTR_NORETURN;
    new cleanup_chain is established.  The old values are restored
    before catch_exceptions() returns.
 
+   The variant catch_exceptions_with_msg() is the same as
+   catch_exceptions() but adds the ability to return an allocated
+   copy of the gdb error message.  This is used when a silent error is 
+   issued and the caller wants to manually issue the error message.
+
    FIXME; cagney/2001-08-13: The need to override the global UIOUT
    builder variable should just go away.
 
@@ -995,6 +983,11 @@ typedef int (catch_exceptions_ftype) (struct ui_out *ui_out, void *args);
 extern int catch_exceptions (struct ui_out *uiout,
                             catch_exceptions_ftype *func, void *func_args,
                             char *errstring, return_mask mask);
+extern int catch_exceptions_with_msg (struct ui_out *uiout,
+                                     catch_exceptions_ftype *func, 
+                                     void *func_args,
+                                     char *errstring, char **gdberrmsg,
+                                     return_mask mask);
 
 /* If CATCH_ERRORS_FTYPE throws an error, catch_errors() returns zero
    otherwize the result from CATCH_ERRORS_FTYPE is returned. It is
@@ -1035,6 +1028,7 @@ enum gdb_osabi
   GDB_OSABI_FREEBSD_ELF,
   GDB_OSABI_NETBSD_AOUT,
   GDB_OSABI_NETBSD_ELF,
+  GDB_OSABI_OPENBSD_ELF,
   GDB_OSABI_WINCE,
   GDB_OSABI_GO32,
   GDB_OSABI_NETWARE,
@@ -1058,10 +1052,6 @@ enum gdb_osabi
    Libiberty thingies are no longer declared here.  We include libiberty.h
    above, instead.  */
 
-#ifndef GETENV_PROVIDED
-extern char *getenv (const char *);
-#endif
-
 /* From other system libraries */
 
 #ifdef HAVE_STDDEF_H
@@ -1079,15 +1069,6 @@ extern char *getenv (const char *);
 #endif
 
 
-/* We take the address of fclose later, but some stdio's forget
-   to declare this.  We can't always declare it since there's
-   no way to declare the parameters without upsetting some compiler
-   somewhere. */
-
-#ifndef FCLOSE_PROVIDED
-extern int fclose (FILE *);
-#endif
-
 #ifndef atof
 extern double atof (const char *);     /* X3.159-1989  4.10.1.1 */
 #endif
@@ -1113,15 +1094,6 @@ extern void *alloca ();
 #endif /* Not GNU C */
 #endif /* alloca not defined */
 
-/* Is GDB multi-arch?  If there's a "tm.h" file, it is not.  */
-#ifndef GDB_MULTI_ARCH
-#ifdef GDB_TM_FILE
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-#else
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PURE
-#endif
-#endif
-
 /* Dynamic target-system-dependent parameters for GDB. */
 #include "gdbarch.h"
 
@@ -1188,57 +1160,66 @@ extern int watchdog;
 extern char *interpreter_p;
 
 /* If a given interpreter matches INTERPRETER_P then it should update
-   command_loop_hook and init_ui_hook with the per-interpreter
-   implementation. */
-/* FIXME: command_loop_hook and init_ui_hook should be moved here. */
+   deprecated_command_loop_hook and deprecated_init_ui_hook with the
+   per-interpreter implementation.  */
+/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook
+   should be moved here. */
 
 struct target_waitstatus;
 struct cmd_list_element;
 
 /* Should the asynchronous variant of the interpreter (using the
-   event-loop) be enabled? */
-extern int event_loop_p;
-
-extern void (*init_ui_hook) (char *argv0);
-extern void (*command_loop_hook) (void);
-extern void (*show_load_progress) (const char *section,
-                                  unsigned long section_sent, 
-                                  unsigned long section_size, 
-                                  unsigned long total_sent, 
-                                  unsigned long total_size);
-extern void (*print_frame_info_listing_hook) (struct symtab * s,
-                                             int line, int stopline,
-                                             int noerror);
+   event-loop) be enabled?  */
+/* NOTE: cagney/2004-06-10: GDB changed to always uses the event-loop.
+   A follow-on cleanup is to eliminate references to
+   "event_loop_p".  */
+#define event_loop_p 1
+
+extern void (*deprecated_pre_add_symbol_hook) (const char *);
+extern void (*deprecated_post_add_symbol_hook) (void);
+extern void (*selected_frame_level_changed_hook) (int);
+extern int (*deprecated_ui_loop_hook) (int signo);
+extern void (*deprecated_init_ui_hook) (char *argv0);
+extern void (*deprecated_command_loop_hook) (void);
+extern void (*deprecated_show_load_progress) (const char *section,
+                                             unsigned long section_sent, 
+                                             unsigned long section_size, 
+                                             unsigned long total_sent, 
+                                             unsigned long total_size);
+extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
+                                                        int line, int stopline,
+                                                        int noerror);
 extern struct frame_info *parse_frame_specification (char *frame_exp);
-extern int (*query_hook) (const char *, va_list);
-extern void (*warning_hook) (const char *, va_list);
-extern void (*flush_hook) (struct ui_file * stream);
-extern void (*create_breakpoint_hook) (struct breakpoint * b);
-extern void (*delete_breakpoint_hook) (struct breakpoint * bpt);
-extern void (*modify_breakpoint_hook) (struct breakpoint * bpt);
-extern void (*interactive_hook) (void);
-extern void (*registers_changed_hook) (void);
-extern void (*readline_begin_hook) (char *,...);
-extern char *(*readline_hook) (char *);
-extern void (*readline_end_hook) (void);
-extern void (*register_changed_hook) (int regno);
-extern void (*memory_changed_hook) (CORE_ADDR addr, int len);
-extern void (*context_hook) (int);
-extern ptid_t (*target_wait_hook) (ptid_t ptid,
+extern int (*deprecated_query_hook) (const char *, va_list);
+extern void (*deprecated_warning_hook) (const char *, va_list);
+extern void (*deprecated_flush_hook) (struct ui_file * stream);
+extern void (*deprecated_create_breakpoint_hook) (struct breakpoint * b);
+extern void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
+extern void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
+extern void (*deprecated_interactive_hook) (void);
+extern void (*deprecated_registers_changed_hook) (void);
+extern void (*deprecated_readline_begin_hook) (char *,...);
+extern char *(*deprecated_readline_hook) (char *);
+extern void (*deprecated_readline_end_hook) (void);
+extern void (*deprecated_register_changed_hook) (int regno);
+extern void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
+extern void (*deprecated_context_hook) (int);
+extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
                                          struct target_waitstatus * status);
 
-extern void (*attach_hook) (void);
-extern void (*detach_hook) (void);
-extern void (*call_command_hook) (struct cmd_list_element * c,
-                                 char *cmd, int from_tty);
+extern void (*deprecated_attach_hook) (void);
+extern void (*deprecated_detach_hook) (void);
+extern void (*deprecated_call_command_hook) (struct cmd_list_element * c,
+                                            char *cmd, int from_tty);
 
-extern void (*set_hook) (struct cmd_list_element * c);
+extern void (*deprecated_set_hook) (struct cmd_list_element * c);
 
-extern NORETURN void (*error_hook) (void) ATTR_NORETURN;
+extern void (*deprecated_error_hook) (void);
 
-extern void (*error_begin_hook) (void);
+extern void (*deprecated_error_begin_hook) (void);
 
-extern int (*ui_load_progress_hook) (const char *section, unsigned long num);
+extern int (*deprecated_ui_load_progress_hook) (const char *section,
+                                               unsigned long num);
 
 
 /* Inhibit window interface if non-zero. */
This page took 0.031858 seconds and 4 git commands to generate.