* gdbarch.sh (EXTRACT_STRUCT_VALUE_ADDRESS_P): Delete definition.
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
index 2ba93711887898ec6c31af81d5d11b4c155a244a..51cc4401af82c28adfbdfc12b011b533ada008a8 100644 (file)
@@ -1,7 +1,7 @@
 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
 
 /* Dynamic architecture support for GDB, the GNU debugger.
-   Copyright 1998-1999, Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -257,29 +257,29 @@ extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float);
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
-#define TARGET_READ_PC(pid) (generic_target_read_pc (pid))
+#define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid))
 #endif
 
-typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid);
-extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid);
+typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid);
+extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid);
 extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC)
-#define TARGET_READ_PC(pid) (gdbarch_read_pc (current_gdbarch, pid))
+#define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid))
 #endif
 #endif
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC)
-#define TARGET_WRITE_PC(val, pid) (generic_target_write_pc (val, pid))
+#define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid))
 #endif
 
-typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, int pid);
-extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid);
+typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid);
+extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid);
 extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
 #if GDB_MULTI_ARCH
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_PC)
-#define TARGET_WRITE_PC(val, pid) (gdbarch_write_pc (current_gdbarch, val, pid))
+#define TARGET_WRITE_PC(val, ptid) (gdbarch_write_pc (current_gdbarch, val, ptid))
 #endif
 #endif
 
@@ -339,6 +339,18 @@ extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftyp
 #endif
 #endif
 
+extern int gdbarch_register_read_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_register_read_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
+extern void gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf);
+extern void set_gdbarch_register_read (struct gdbarch *gdbarch, gdbarch_register_read_ftype *register_read);
+
+extern int gdbarch_register_write_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_register_write_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
+extern void gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf);
+extern void set_gdbarch_register_write (struct gdbarch *gdbarch, gdbarch_register_write_ftype *register_write);
+
 extern int gdbarch_num_regs (struct gdbarch *gdbarch);
 extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
 #if GDB_MULTI_ARCH
@@ -623,8 +635,10 @@ extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_reg
 
 #if defined (REGISTER_BYTES_OK)
 /* Legacy for systems yet to multi-arch REGISTER_BYTES_OK */
+#if !defined (REGISTER_BYTES_OK_P)
 #define REGISTER_BYTES_OK_P() (1)
 #endif
+#endif
 
 /* Default predicate for non- multi-arch targets. */
 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P)
@@ -638,7 +652,7 @@ extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
-#define REGISTER_BYTES_OK(nr_bytes) (internal_error ("REGISTER_BYTES_OK"), 0)
+#define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0)
 #endif
 
 typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes);
@@ -830,7 +844,7 @@ extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_r
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL)
-#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error ("REGISTER_CONVERT_TO_VIRTUAL"), 0)
+#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0)
 #endif
 
 typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
@@ -844,7 +858,7 @@ extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gd
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW)
-#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error ("REGISTER_CONVERT_TO_RAW"), 0)
+#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0)
 #endif
 
 typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to);
@@ -862,7 +876,7 @@ extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarc
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER)
-#define FETCH_PSEUDO_REGISTER(regnum) (internal_error ("FETCH_PSEUDO_REGISTER"), 0)
+#define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0)
 #endif
 
 typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum);
@@ -880,7 +894,7 @@ extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER)
-#define STORE_PSEUDO_REGISTER(regnum) (internal_error ("STORE_PSEUDO_REGISTER"), 0)
+#define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0)
 #endif
 
 typedef void (gdbarch_store_pseudo_register_ftype) (int regnum);
@@ -983,7 +997,7 @@ extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ft
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_DADDR)
-#define D10V_MAKE_DADDR(x) (internal_error ("D10V_MAKE_DADDR"), 0)
+#define D10V_MAKE_DADDR(x) (internal_error (__FILE__, __LINE__, "D10V_MAKE_DADDR"), 0)
 #endif
 
 typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) (CORE_ADDR x);
@@ -997,7 +1011,7 @@ extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_m
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_IADDR)
-#define D10V_MAKE_IADDR(x) (internal_error ("D10V_MAKE_IADDR"), 0)
+#define D10V_MAKE_IADDR(x) (internal_error (__FILE__, __LINE__, "D10V_MAKE_IADDR"), 0)
 #endif
 
 typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) (CORE_ADDR x);
@@ -1011,7 +1025,7 @@ extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_m
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (D10V_DADDR_P)
-#define D10V_DADDR_P(x) (internal_error ("D10V_DADDR_P"), 0)
+#define D10V_DADDR_P(x) (internal_error (__FILE__, __LINE__, "D10V_DADDR_P"), 0)
 #endif
 
 typedef int (gdbarch_d10v_daddr_p_ftype) (CORE_ADDR x);
@@ -1025,7 +1039,7 @@ extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_dadd
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (D10V_IADDR_P)
-#define D10V_IADDR_P(x) (internal_error ("D10V_IADDR_P"), 0)
+#define D10V_IADDR_P(x) (internal_error (__FILE__, __LINE__, "D10V_IADDR_P"), 0)
 #endif
 
 typedef int (gdbarch_d10v_iaddr_p_ftype) (CORE_ADDR x);
@@ -1039,7 +1053,7 @@ extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iadd
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (D10V_CONVERT_DADDR_TO_RAW)
-#define D10V_CONVERT_DADDR_TO_RAW(x) (internal_error ("D10V_CONVERT_DADDR_TO_RAW"), 0)
+#define D10V_CONVERT_DADDR_TO_RAW(x) (internal_error (__FILE__, __LINE__, "D10V_CONVERT_DADDR_TO_RAW"), 0)
 #endif
 
 typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) (CORE_ADDR x);
@@ -1053,7 +1067,7 @@ extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdba
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (D10V_CONVERT_IADDR_TO_RAW)
-#define D10V_CONVERT_IADDR_TO_RAW(x) (internal_error ("D10V_CONVERT_IADDR_TO_RAW"), 0)
+#define D10V_CONVERT_IADDR_TO_RAW(x) (internal_error (__FILE__, __LINE__, "D10V_CONVERT_IADDR_TO_RAW"), 0)
 #endif
 
 typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) (CORE_ADDR x);
@@ -1083,6 +1097,28 @@ extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_sto
 #endif
 #endif
 
+#if defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+/* Legacy for systems yet to multi-arch EXTRACT_STRUCT_VALUE_ADDRESS */
+#if !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
+#endif
+
+extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
+#endif
+
 typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf);
 extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
 extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
@@ -1201,6 +1237,20 @@ extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR
 #endif
 #endif
 
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PREPARE_TO_PROCEED)
+#define PREPARE_TO_PROCEED(select_it) (default_prepare_to_proceed (select_it))
+#endif
+
+typedef int (gdbarch_prepare_to_proceed_ftype) (int select_it);
+extern int gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it);
+extern void set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, gdbarch_prepare_to_proceed_ftype *prepare_to_proceed);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PREPARE_TO_PROCEED)
+#define PREPARE_TO_PROCEED(select_it) (gdbarch_prepare_to_proceed (current_gdbarch, select_it))
+#endif
+#endif
+
 extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
 extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
 #if GDB_MULTI_ARCH
@@ -1310,8 +1360,10 @@ extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_n
 
 #if defined (STACK_ALIGN)
 /* Legacy for systems yet to multi-arch STACK_ALIGN */
+#if !defined (STACK_ALIGN_P)
 #define STACK_ALIGN_P() (1)
 #endif
+#endif
 
 /* Default predicate for non- multi-arch targets. */
 #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P)
@@ -1325,7 +1377,7 @@ extern int gdbarch_stack_align_p (struct gdbarch *gdbarch);
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN)
-#define STACK_ALIGN(sp) (internal_error ("STACK_ALIGN"), 0)
+#define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0)
 #endif
 
 typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp);
@@ -1352,8 +1404,10 @@ extern void set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch, i
 
 #if defined (REG_STRUCT_HAS_ADDR)
 /* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
+#if !defined (REG_STRUCT_HAS_ADDR_P)
 #define REG_STRUCT_HAS_ADDR_P() (1)
 #endif
+#endif
 
 /* Default predicate for non- multi-arch targets. */
 #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P)
@@ -1367,7 +1421,7 @@ extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch);
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR)
-#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error ("REG_STRUCT_HAS_ADDR"), 0)
+#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0)
 #endif
 
 typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
@@ -1381,8 +1435,10 @@ extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_re
 
 #if defined (SAVE_DUMMY_FRAME_TOS)
 /* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
+#if !defined (SAVE_DUMMY_FRAME_TOS_P)
 #define SAVE_DUMMY_FRAME_TOS_P() (1)
 #endif
+#endif
 
 /* Default predicate for non- multi-arch targets. */
 #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS_P)
@@ -1396,7 +1452,7 @@ extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS)
-#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error ("SAVE_DUMMY_FRAME_TOS"), 0)
+#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0)
 #endif
 
 typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
@@ -1408,6 +1464,14 @@ extern void set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_s
 #endif
 #endif
 
+extern int gdbarch_parm_boundary (struct gdbarch *gdbarch);
+extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PARM_BOUNDARY)
+#define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
+#endif
+#endif
+
 /* Default (value) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT)
 #define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch))
@@ -1461,6 +1525,46 @@ extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdb
 #endif
 #endif
 
+/* FIXME/cagney/2001-01-18: This should be split in two.  A target method that indicates if
+   the target needs software single step.  An ISA method to implement it.
+  
+   FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
+   using the breakpoint system instead of blatting memory directly (as with rs6000).
+  
+   FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the target can
+   single step.  If not, then implement single step using breakpoints. */
+
+#if defined (SOFTWARE_SINGLE_STEP)
+/* Legacy for systems yet to multi-arch SOFTWARE_SINGLE_STEP */
+#if !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (0)
+#endif
+
+extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
+#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
+#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
+#endif
+
+typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
+extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
+extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP)
+#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
+#endif
+#endif
+
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
 
@@ -1525,9 +1629,6 @@ struct gdbarch_list
 
 struct gdbarch_info
 {
-  /* Use default: bfd_arch_unknown (ZERO). */
-  enum bfd_architecture bfd_architecture;
-
   /* Use default: NULL (ZERO). */
   const struct bfd_arch_info *bfd_arch_info;
 
@@ -1581,16 +1682,12 @@ extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gd
 extern void gdbarch_free (struct gdbarch *);
 
 
-/* Helper function. Force an update of the current architecture.  Used
-   by legacy targets that have added their own target specific
-   architecture manipulation commands.
+/* Helper function. Force an update of the current architecture.
 
-   The INFO parameter shall be fully initialized (``memset (&INFO,
-   sizeof (info), 0)'' set relevant fields) before gdbarch_update_p()
-   is called.  gdbarch_update_p() shall initialize any ``default''
-   fields using information obtained from the previous architecture or
-   INFO.ABFD (if specified) before calling the corresponding
-   architectures INIT function.
+   The actual architecture selected is determined by INFO, ``(gdb) set
+   architecture'' et.al., the existing architecture and BFD's default
+   architecture.  INFO should be initialized to zero and then selected
+   fields should be updated.
 
    Returns non-zero if the update succeeds */
 
@@ -1602,29 +1699,40 @@ extern int gdbarch_update_p (struct gdbarch_info info);
 
    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.
+   be saved in a local static variable.
 
-   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).
+   The per-architecture data-pointer can be initialized in one of two
+   ways: The value can be set explicitly using a call to
+   set_gdbarch_data(); the value can be set implicitly using the value
+   returned by a non-NULL INIT() callback.  INIT(), when non-NULL is
+   called after the basic architecture vector has been created.
 
-   INIT() shall return the initial value for the per-architecture
-   data-pointer for the current architecture.
+   When a previously created architecture is re-selected, the
+   per-architecture data-pointer for that previous architecture is
+   restored.  INIT() is not called.
+
+   During initialization, multiple assignments of the data-pointer are
+   allowed, non-NULL values are deleted by calling FREE().  If the
+   architecture is deleted using gdbarch_free() all non-NULL data
+   pointers are also deleted using FREE().
 
    Multiple registrarants for any architecture are allowed (and
    strongly encouraged).  */
 
-typedef void *(gdbarch_data_ftype) (void);
-extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_ftype *init);
+struct gdbarch_data;
 
-/* Return the value of the per-architecture data-pointer for the
-   current architecture. */
+typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
+typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
+                                       void *pointer);
+extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
+                                                  gdbarch_data_free_ftype *free);
+extern void set_gdbarch_data (struct gdbarch *gdbarch,
+                             struct gdbarch_data *data,
+                             void *pointer);
 
 extern void *gdbarch_data (struct gdbarch_data*);
 
 
-
 /* Register per-architecture memory region.
 
    Provide a memory-region swap mechanism.  Per-architecture memory
@@ -1726,17 +1834,6 @@ extern disassemble_info tm_print_insn_info;
 #define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v)
 
 
-/* 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) (internal_error ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
-#else
-#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1)
-#endif
-#endif
-
-
 /* Set the dynamic target-system-dependent parameters (architecture,
    byte-order, ...) using information found in the BFD */
 
@@ -1748,6 +1845,10 @@ extern void set_gdbarch_from_file (bfd *);
 
 extern void initialize_current_architecture (void);
 
+/* For non-multiarched targets, do any initialization of the default
+   gdbarch object necessary after the _initialize_MODULE functions
+   have run.  */
+extern void initialize_non_multiarch ();
 
 /* gdbarch trace variable */
 extern int gdbarch_debug;
This page took 0.02925 seconds and 4 git commands to generate.