2002-02-10 Daniel Jacobowitz <drow@mvista.com>
[deliverable/binutils-gdb.git] / gdb / defs.h
index a0d6d03e8d210a40b8d62c7e185fab75ddcd5d6b..59d53d67a85f217c97ab0826ab407a7fa9331522 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
+   1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "progress.h"
 
-#ifdef USE_MMALLOC
-#include "mmalloc.h"
-#endif
-
 /* For BFD64 and bfd_vma.  */
 #include "bfd.h"
 
@@ -579,6 +575,8 @@ 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 *);
+
 /* From demangle.c */
 
 extern void set_demangling_style (char *);
@@ -690,6 +688,12 @@ extern char *paddr_d (LONGEST addr);
 extern char *phex (ULONGEST l, int sizeof_l);
 extern char *phex_nz (ULONGEST l, int sizeof_l);
 
+/* Like paddr() only print/scan raw CORE_ADDR.  The output from
+   core_addr_to_string() can be passed direct to
+   string_to_core_addr().  */
+extern const char *core_addr_to_string (const CORE_ADDR addr);
+extern CORE_ADDR string_to_core_addr (const char *my_string);
+
 extern void fprintf_symbol_filtered (struct ui_file *, char *,
                                     enum language, int);
 
@@ -771,6 +775,13 @@ extern void exec_set_section_offsets (bfd_signed_vma text_off,
                                      bfd_signed_vma data_off,
                                      bfd_signed_vma bss_off);
 
+/* Take over the 'find_mapped_memory' vector from exec.c. */
+extern void exec_set_find_memory_regions (int (*) (int (*) (CORE_ADDR, 
+                                                           unsigned long, 
+                                                           int, int, int, 
+                                                           void *),
+                                                  void *));
+
 /* From findvar.c */
 
 extern int read_relative_register_raw_bytes (int, char *);
@@ -1023,16 +1034,6 @@ extern char *msavestring (void *, const char *, size_t);
 
 extern char *mstrsave (void *, const char *);
 
-#if !defined (USE_MMALLOC)
-/* NOTE: cagney/2000-03-04: The mmalloc functions need to use PTR
-   rather than void* so that they are consistent with the delcaration
-   in ../mmalloc/mmalloc.h. */
-extern PTR mcalloc (PTR, size_t, size_t);
-extern PTR mmalloc (PTR, size_t);
-extern PTR mrealloc (PTR, PTR, size_t);
-extern void mfree (PTR, PTR);
-#endif
-
 /* Robust versions of same.  Throw an internal error when no memory,
    guard against stray NULL arguments. */
 extern void *xmmalloc (void *md, size_t size);
@@ -1067,9 +1068,6 @@ extern NORETURN void verror (const char *fmt, va_list ap) ATTR_NORETURN;
 
 extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN;
 
-/* DEPRECATED: Use error(), verror() or error_stream(). */
-extern NORETURN void error_begin (void);
-
 extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
 
 /* Returns a freshly allocate buffer containing the last error
@@ -1084,7 +1082,7 @@ extern NORETURN void internal_error (const char *file, int line,
 
 extern NORETURN void nomem (long) ATTR_NORETURN;
 
-/* Reasons for calling return_to_top_level.  NOTE: all reason values
+/* Reasons for calling throw_exception().  NOTE: all reason values
    must be less than zero.  enum value 0 is reserved for internal use
    as the return value from an initial setjmp().  The function
    catch_exceptions() reserves values >= 0 as legal results from its
@@ -1106,11 +1104,21 @@ enum return_reason
 #define RETURN_MASK_ALL                (RETURN_MASK_QUIT | RETURN_MASK_ERROR)
 typedef int return_mask;
 
-extern NORETURN void return_to_top_level (enum return_reason) ATTR_NORETURN;
+/* Throw an exception of type RETURN_REASON.  Will execute a LONG JUMP
+   to the inner most containing exception handler established using
+   catch_exceptions() (or the legacy catch_errors()).
+
+   Code normally throws an exception using error() et.al.  For various
+   reaons, GDB also contains code that throws an exception directly.
+   For instance, the remote*.c targets contain CNTRL-C signal handlers
+   that propogate the QUIT event up the exception chain.  ``This could
+   be a good thing or a dangerous thing.'' -- the Existential Wombat.  */
+
+extern NORETURN void throw_exception (enum return_reason) ATTR_NORETURN;
 
 /* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception
    handler.  If an exception (enum return_reason) is thrown using
-   return_to_top_level() than all cleanups installed since
+   throw_exception() than all cleanups installed since
    catch_exceptions() was entered are invoked, the (-ve) exception
    value is then returned by catch_exceptions.  If FUNC() returns
    normally (with a postive or zero return value) then that value is
@@ -1153,10 +1161,10 @@ extern int catch_errors (catch_errors_ftype *, PTR, char *, return_mask);
 typedef void (catch_command_errors_ftype) (char *, int);
 extern int catch_command_errors (catch_command_errors_ftype *func, char *command, int from_tty, return_mask);
 
-extern void warning_begin (void);
-
 extern void warning (const char *, ...) ATTR_FORMAT (printf, 1, 2);
 
+extern void vwarning (const char *, va_list args);
+
 /* Global functions from other, non-gdb GNU thingies.
    Libiberty thingies are no longer declared here.  We include libiberty.h
    above, instead.  */
@@ -1216,20 +1224,6 @@ extern void *alloca ();
 #endif /* Not GNU C */
 #endif /* alloca not defined */
 
-/* HOST_BYTE_ORDER must be defined to one of these.  */
-
-#ifdef HAVE_ENDIAN_H
-#include <endian.h>
-#endif
-
-#if !defined (BIG_ENDIAN)
-#define BIG_ENDIAN 4321
-#endif
-
-#if !defined (LITTLE_ENDIAN)
-#define LITTLE_ENDIAN 1234
-#endif
-
 /* Dynamic target-system-dependent parameters for GDB. */
 #include "gdbarch.h"
 #if (GDB_MULTI_ARCH == 0)
@@ -1263,7 +1257,7 @@ extern void *alloca ();
    from byte/word byte order.  */
 
 #if !defined (BITS_BIG_ENDIAN)
-#define BITS_BIG_ENDIAN (TARGET_BYTE_ORDER == BIG_ENDIAN)
+#define BITS_BIG_ENDIAN (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
 #endif
 
 /* In findvar.c.  */
@@ -1297,10 +1291,8 @@ extern int watchdog;
 
 /* Hooks for alternate command interfaces.  */
 
-#ifdef UI_OUT
 /* The name of the interpreter if specified on the command line. */
 extern char *interpreter_p;
-#endif
 
 /* If a given interpreter matches INTERPRETER_P then it should update
    command_loop_hook and init_ui_hook with the per-interpreter
This page took 0.030255 seconds and 4 git commands to generate.