/* Architecture commands for GDB, the GNU debugger.
- Copyright 1998, Free Software Foundation, Inc.
+ Copyright 1998-1999, Free Software Foundation, Inc.
This file is part of GDB.
#ifndef GDBARCH_H
#define GDBARCH_H
-/* start-sanitize-carp start-sanitize-vr4xxx */
-
-#ifndef GDB_MULTI_ARCH
-#define GDB_MULTI_ARCH 0
-#endif
-
-extern struct gdbarch *current_gdbarch;
-
-
-/* When GDB_MULTI_ARCH override any earlier definitions of the
- below. */
-
-extern const struct bfd_arch_info *gdbarch_bfd_arch_info PARAMS ((struct gdbarch*));
-#if GDB_MULTI_ARCH
-#undef TARGET_ARCHITECTURE
-#define TARGET_ARCHITECTURE (gdbarch_bfd_arch_info (current_gdbarch))
-#endif
-
-extern int gdbarch_byte_order PARAMS ((struct gdbarch*));
-#if GDB_MULTI_ARCH
-#undef TARGET_BYTE_ORDER
-#define TARGET_BYTE_ORDER (gdbarch_byte_order (current_gdbarch))
-#endif
-
-extern int gdbarch_long_bit PARAMS ((struct gdbarch*));
-extern void set_gdbarch_long_bit PARAMS ((struct gdbarch*, int));
-#if GDB_MULTI_ARCH
-#undef TARGET_LONG_BIT
-#define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch))
-#endif
-
-extern int gdbarch_long_long_bit PARAMS ((struct gdbarch*));
-extern void set_gdbarch_long_long_bit PARAMS ((struct gdbarch*, int));
-#if GDB_MULTI_ARCH
-#undef TARGET_LONG_LONG_BIT
-#define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch))
-#endif
-
-extern int gdbarch_ptr_bit PARAMS ((struct gdbarch*));
-extern void set_gdbarch_ptr_bit PARAMS ((struct gdbarch*, int));
-#if GDB_MULTI_ARCH
-#undef TARGET_PTR_BIT
-#define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch))
-#endif
-
-extern struct gdbarch_tdep *gdbarch_tdep PARAMS ((struct gdbarch*));
-
-
-/* Mechanism for co-ordinating the selection of a specific
- architecture.
-
- GDB targets (*-tdep.c) can register an interest in a specific
- architecture. Other GDB components can register a need to maintain
- per-architecture data.
-
- The mechanisms below ensures that only a loose connection between
- the set-architecture command and the various GDB components exists.
- Each component can independantly register their need to maintain
- architecture specific data with gdbarch.
-
- Pragmatics:
-
- Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
- didn't scale.
-
- The more traditional mega-struct containing architecture specific
- data for all the various GDB components was also considered. Since
- GDB is built from a variable number of (fairly independant)
- components this global aproach was considered non-applicable. */
-
-
-/* Register a new architectural family with GDB.
-
- Register support for the specified architecture with GDB. When
- ever gdbarch determines that this architecture has been selected,
- the specifed INIT function is called.
-
- INIT takes two parameters: INFO which contains the information
- available to gdbarch about the (possibly new) architecture; ARCHES
- which is a list of the previously created ``struct gdbarch'' for
- this architecture. When possible, and when no other value was
- provided, INFO is initialized using either the ABFD or the current
- GDBARCH.
-
- The INIT function shall return any of: NULL indicating that it
- doesn't reconize the selected architecture; an existing ``struct
- gdbarch'' from the ARCHES list (indicating that the new
- architecture is just a synonym for an earlier architecture); create
- and then return a new ``struct gdbarch'' for this new architecture
- (using gdbarch_alloc()). */
-
-struct gdbarch_list
-{
- struct gdbarch *gdbarch;
- struct gdbarch_list *next;
-};
-
-struct gdbarch_info
-{
- /* Default: bfd_arch_unknown. */
- enum bfd_architecture bfd_architecture;
-
- /* Default: NULL */
- const struct bfd_arch_info *bfd_arch_info;
-
- /* Default: 0 */
- int byte_order;
-
- /* Default: NULL */
- bfd *abfd;
-
- /* Default: NULL */
- struct gdbarch_tdep_info *tdep_info;
-};
-
-typedef struct gdbarch *(gdbarch_init_ftype) PARAMS ((struct gdbarch_info info, struct gdbarch_list *arches));
-
-extern void register_gdbarch_init PARAMS ((enum bfd_architecture, gdbarch_init_ftype *));
-
-/* Helper function. Search ARCHES for a gdbarch that matches
- information provided by INFO. */
-
-extern struct gdbarch_list *gdbarch_list_lookup_by_info PARAMS ((struct gdbarch_list *arches, const struct gdbarch_info *info));
-
-/* Helper function. Create a preliminary ``struct gdbarch''. Perform
- basic initialization using values from the INFO structure. */
-
-extern struct gdbarch *gdbarch_alloc PARAMS ((const struct gdbarch_info *, struct gdbarch_tdep *));
-
-/* Helper function. Force the updating of the current architecture.
- Used by targets that have added their own target specific
- architecture manipulation commands. */
-
-extern int gdbarch_update PARAMS ((struct gdbarch_info));
-
-
-
-/* Register per-architecture data-pointer.
-
- Reserve space for a per-architecture data-pointer. An identifier
- for the reserved data-pointer is returned. That identifer should
- be saved in a local static.
-
- When a new architecture is selected, INIT() is called. When a
- previous architecture is re-selected, the per-architecture
- data-pointer for that previous architecture is restored (INIT() is
- not called).
-
- INIT() shall return the initial value for the per-architecture
- data-pointer for the current architecture.
-
- Multiple registrarants for any architecture are allowed (and
- strongly encouraged). */
-
-typedef void *(gdbarch_data_ftype) PARAMS ((void));
-extern struct gdbarch_data *register_gdbarch_data PARAMS ((gdbarch_data_ftype *init));
-
-
-/* Return the value of the per-architecture data-pointer for the
- current architecture. */
-
-extern void *gdbarch_data PARAMS ((struct gdbarch_data*));
-
-
-/* Register per-architecture memory region.
-
- For legacy code, provide a memory-region swap mechanism.
- Per-architecture memory blocks are created, these being swapped
- whenever the architecture is changed. For a new architecture, the
- memory region is initialized with zero (0) and the INIT function is
- called.
-
- Memory regions are swapped / initialized in the order that they are
- registered. NULL DATA and/or INIT values can be specified. */
-
-typedef void (gdbarch_swap_ftype) PARAMS ((void));
-extern void register_gdbarch_swap PARAMS ((void *data, unsigned long size, gdbarch_swap_ftype *init));
-
-
-/* end-sanitize-carp end-sanitize-vr4xxx */
-
/* The target-system-dependant byte order is dynamic */
/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
- is selectable at runtime. The user can use the `set endian'
+ is selectable at runtime. The user can use the ``set endian''
command to change it. TARGET_BYTE_ORDER_AUTO is nonzero when
target_byte_order should be auto-detected (from the program image
say). */
+/* Explicit test for D10V architecture.
+ USE of these macro's is *STRONGLY* discouraged. */
+
+#define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v)
+#ifndef D10V_MAKE_DADDR
+#define D10V_MAKE_DADDR(X) (abort (), 0)
+#endif
+#ifndef D10V_MAKE_IADDR
+#define D10V_MAKE_IADDR(X) (abort (), 0)
+#endif
+
+
+/* Fallback definition of FRAMELESS_FUNCTION_INVOCATION */
+#ifndef FRAMELESS_FUNCTION_INVOCATION
+#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
+#endif
+
+
+/* Fallback definition of REGISTER_CONVERTIBLE etc */
+#ifndef REGISTER_CONVERTIBLE
+#define REGISTER_CONVERTIBLE(x) (0)
+#endif
+#ifndef REGISTER_CONVERT_TO_VIRTUAL
+#define REGISTER_CONVERT_TO_VIRTUAL(x, y, z, a)
+#endif
+#ifndef REGISTER_CONVERT_TO_RAW
+#define REGISTER_CONVERT_TO_RAW(x, y, z, a)
+#endif
+
+
+/* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */
+#ifndef EXTRACT_STRUCT_VALUE_ADDRESS
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P (0)
+#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (abort (), 0)
+#else
+#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1)
+#endif
+#endif
+
+
/* Set the dynamic target-system-dependant parameters (architecture,
byte-order, ...) using information found in the BFD */