/* *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.
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 *);
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 const char *core_addr_to_string_nz (const CORE_ADDR addr);
extern CORE_ADDR string_to_core_addr (const char *my_string);
extern void fprintf_symbol_filtered (struct ui_file *, char *,
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 *);
#include "fopen-same.h"
#endif
-#define CONST_PTR const
-
/* Defaults for system-wide constants (if not defined by xm.h, we fake it).
FIXME: Assumes 2's complement arithmetic */
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
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
typedef int return_mask;
/* 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()).
+ to the inner most containing exception handler established using
+ catch_exceptions() (or the legacy catch_errors()).
- Useful when a section of code that caught an exception finds it
- needs to repropagate that exception up the call chain.
+ 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. */
- The name return_to_top_level() dates back to a time when GDB had
- only one exception handler installed at the top level. This really
- did return to the top level. The name should probably be changed.
-
- NOTE: Some sections of code are using error_begin() in conjunction
- with return_to_top_level() to throw the initial exception. That
- code should, instead, use either error() or error_string(). */
-
-extern NORETURN void return_to_top_level (enum return_reason) ATTR_NORETURN;
+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
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. */
#endif /* Not GNU C */
#endif /* alloca not defined */
-/* Get a definition of BIG_ENDIAN and LITTLE_ENDIAN. */
-/* FIXME: cagney/2001-10-31: GDB should just use BFD's definitions. */
-
-#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)
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. */
/* 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