* Makefile.in (arm-tdep.o, eval.o, target-descriptions.o)
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
index 48bcd7a263ba8b4a1efb1766e8dc1cb648f81ea7..2c9bc579c52573420c92c53ad8d8873d4957bd12 100644 (file)
@@ -2,8 +2,8 @@
 
 /* Dynamic architecture support for GDB, the GNU debugger.
 
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free
-   Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -50,6 +50,7 @@ struct disassemble_info;
 struct target_ops;
 struct obstack;
 struct bp_target_info;
+struct target_desc;
 
 extern struct gdbarch *current_gdbarch;
 
@@ -83,6 +84,9 @@ extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
 #define TARGET_OSABI (gdbarch_osabi (current_gdbarch))
 #endif
 
+extern const struct target_desc * gdbarch_target_desc (struct gdbarch *gdbarch);
+/* set_gdbarch_target_desc() - not applicable - pre-initialized. */
+
 
 /* The following are initialized by the target dependent code. */
 
@@ -137,7 +141,9 @@ extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bi
 
 /* The ABI default bit-size and format for "float", "double", and "long
    double".  These bit/format pairs should eventually be combined into
-   a single object.  For the moment, just initialize them as a pair. */
+   a single object.  For the moment, just initialize them as a pair.
+   Each format describes both the big and little endian layouts (if
+   useful). */
 
 extern int gdbarch_float_bit (struct gdbarch *gdbarch);
 extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
@@ -148,8 +154,8 @@ extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
 #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch))
 #endif
 
-extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
-extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
+extern const struct floatformat ** gdbarch_float_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat ** float_format);
 #if !defined (GDB_TM_FILE) && defined (TARGET_FLOAT_FORMAT)
 #error "Non multi-arch definition of TARGET_FLOAT_FORMAT"
 #endif
@@ -166,8 +172,8 @@ extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
 #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch))
 #endif
 
-extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch);
-extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format);
+extern const struct floatformat ** gdbarch_double_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat ** double_format);
 #if !defined (GDB_TM_FILE) && defined (TARGET_DOUBLE_FORMAT)
 #error "Non multi-arch definition of TARGET_DOUBLE_FORMAT"
 #endif
@@ -184,8 +190,8 @@ extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_doubl
 #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch))
 #endif
 
-extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch);
-extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format);
+extern const struct floatformat ** gdbarch_long_double_format (struct gdbarch *gdbarch);
+extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat ** long_double_format);
 #if !defined (GDB_TM_FILE) && defined (TARGET_LONG_DOUBLE_FORMAT)
 #error "Non multi-arch definition of TARGET_LONG_DOUBLE_FORMAT"
 #endif
@@ -465,7 +471,9 @@ extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register
 #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
 #endif
 
-/* REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE. */
+/* Return the type of a register specified by the architecture.  Only
+   the register cache should call this function directly; others should
+   use "register_type". */
 
 extern int gdbarch_register_type_p (struct gdbarch *gdbarch);
 
@@ -700,6 +708,15 @@ extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_valu
 #define VALUE_TO_REGISTER(frame, regnum, type, buf) (gdbarch_value_to_register (current_gdbarch, frame, regnum, type, buf))
 #endif
 
+/* Construct a value representing the contents of register REGNUM in
+   frame FRAME, interpreted as type TYPE.  The routine needs to
+   allocate and return a struct value with all value attributes
+   (but not the value contents) filled in. */
+
+typedef struct value * (gdbarch_value_from_register_ftype) (struct type *type, int regnum, struct frame_info *frame);
+extern struct value * gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame);
+extern void set_gdbarch_value_from_register (struct gdbarch *gdbarch, gdbarch_value_from_register_ftype *value_from_register);
+
 typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const gdb_byte *buf);
 extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf);
 extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
@@ -791,26 +808,6 @@ extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_sto
 #define STORE_RETURN_VALUE(type, regcache, valbuf) (gdbarch_store_return_value (current_gdbarch, type, regcache, valbuf))
 #endif
 
-typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, gdb_byte *regbuf, gdb_byte *valbuf);
-extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, gdb_byte *regbuf, gdb_byte *valbuf);
-extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value);
-#if !defined (GDB_TM_FILE) && defined (DEPRECATED_EXTRACT_RETURN_VALUE)
-#error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE"
-#endif
-#if !defined (DEPRECATED_EXTRACT_RETURN_VALUE)
-#define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf))
-#endif
-
-typedef void (gdbarch_deprecated_store_return_value_ftype) (struct type *type, gdb_byte *valbuf);
-extern void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, gdb_byte *valbuf);
-extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value);
-#if !defined (GDB_TM_FILE) && defined (DEPRECATED_STORE_RETURN_VALUE)
-#error "Non multi-arch definition of DEPRECATED_STORE_RETURN_VALUE"
-#endif
-#if !defined (DEPRECATED_STORE_RETURN_VALUE)
-#define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf))
-#endif
-
 typedef int (gdbarch_deprecated_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
 extern int gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
 extern void set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention);
@@ -950,6 +947,13 @@ typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdba
 extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
 extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address);
 
+/* Return the remote protocol register number associated with this
+   register.  Normally the identity mapping. */
+
+typedef int (gdbarch_remote_register_number_ftype) (struct gdbarch *gdbarch, int regno);
+extern int gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno);
+extern void set_gdbarch_remote_register_number (struct gdbarch *gdbarch, gdbarch_remote_register_number_ftype *remote_register_number);
+
 /* Fetch the target specific address used to represent a load module. */
 
 #if defined (FETCH_TLS_LOAD_MODULE_ADDRESS)
@@ -1001,31 +1005,6 @@ extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ft
 /* DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
    frame-base.  Enable frame-base before frame-unwind. */
 
-#if defined (DEPRECATED_SAVED_PC_AFTER_CALL)
-/* Legacy for systems yet to multi-arch DEPRECATED_SAVED_PC_AFTER_CALL */
-#if !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
-#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch);
-#if !defined (GDB_TM_FILE) && defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
-#error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
-#endif
-#if !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
-#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch))
-#endif
-
-typedef CORE_ADDR (gdbarch_deprecated_saved_pc_after_call_ftype) (struct frame_info *frame);
-extern CORE_ADDR gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame);
-extern void set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call);
-#if !defined (GDB_TM_FILE) && defined (DEPRECATED_SAVED_PC_AFTER_CALL)
-#error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
-#endif
-#if !defined (DEPRECATED_SAVED_PC_AFTER_CALL)
-#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (gdbarch_deprecated_saved_pc_after_call (current_gdbarch, frame))
-#endif
-
 #if defined (FRAME_NUM_ARGS)
 /* Legacy for systems yet to multi-arch FRAME_NUM_ARGS */
 #if !defined (FRAME_NUM_ARGS_P)
@@ -1404,6 +1383,19 @@ typedef const struct regset * (gdbarch_regset_from_core_section_ftype) (struct g
 extern const struct regset * gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size);
 extern void set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, gdbarch_regset_from_core_section_ftype *regset_from_core_section);
 
+/* If the elements of C++ vtables are in-place function descriptors rather
+   than normal function pointers (which may point to code or a descriptor),
+   set this to one. */
+
+extern int gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch);
+extern void set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch, int vtable_function_descriptors);
+
+/* Set if the least significant bit of the delta is used instead of the least
+   significant bit of the pfn for pointers to virtual member functions. */
+
+extern int gdbarch_vbit_in_delta (struct gdbarch *gdbarch);
+extern void set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, int vbit_in_delta);
+
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
 
@@ -1445,8 +1437,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
    ``struct gdbarch'' for this architecture.
 
    The INFO parameter is, as far as possible, be pre-initialized with
-   information obtained from INFO.ABFD or the previously selected
-   architecture.
+   information obtained from INFO.ABFD or the global defaults.
 
    The ARCHES parameter is a linked list (sorted most recently used)
    of all the previously created architures for this architecture
@@ -1488,6 +1479,9 @@ struct gdbarch_info
 
   /* Use default: GDB_OSABI_UNINITIALIZED (-1).  */
   enum gdb_osabi osabi;
+
+  /* Use default: NULL (ZERO).  */
+  const struct target_desc *target_desc;
 };
 
 typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
@@ -1512,11 +1506,11 @@ extern const char **gdbarch_printable_names (void);
 /* Helper function.  Search the list of ARCHES for a GDBARCH that
    matches the information provided by INFO. */
 
-extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches,  const struct gdbarch_info *info);
+extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
 
 
 /* Helper function.  Create a preliminary ``struct gdbarch''.  Perform
-   basic initialization using values obtained from the INFO andTDEP
+   basic initialization using values obtained from the INFO and TDEP
    parameters.  set_gdbarch_*() functions are called to complete the
    initialization of the object. */
 
This page took 0.026704 seconds and 4 git commands to generate.