multi-arch ADDR_BITS_REMOVE.
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
index 0b8b64143a5499b53e99fce404182d606f98254d..ddea0c0a1010ddc3ae7e051a894adf3df0f85476 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.
 
 
 /* This file was created with the aid of ``gdbarch.sh''.
 
-   The bourn shell script ``gdbarch.sh'' creates the files
+   The Bourne shell script ``gdbarch.sh'' creates the files
    ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
    against the existing ``gdbarch.[hc]''.  Any differences found
    being reported.
 
    If editing this file, please also run gdbarch.sh and merge any
-   changes into that script. Conversely, when makeing sweeping changes
+   changes into that script. Conversely, when making sweeping changes
    to this file, modifying gdbarch.sh and using its output may prove
    easier. */
 
@@ -77,7 +77,7 @@ extern int gdbarch_byte_order (struct gdbarch *gdbarch);
 #endif
 
 
-/* The following are initialized by the target dependant code. */
+/* The following are initialized by the target dependent code. */
 
 /* Number of bits in a char or unsigned char for the target machine.
    Just like CHAR_BIT in <limits.h> but describes the target machine.
@@ -189,7 +189,15 @@ extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_doubl
 #endif
 #endif
 
-/* Number of bits in a pointer for the target machine */
+/* For most targets, a pointer on the target and its representation as an
+   address in GDB have the same size and "look the same".  For such a
+   target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
+   / addr_bit will be set from it.
+  
+   If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
+   also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
+  
+   ptr_bit is the size of a pointer on the target */
 
 /* Default (value) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT)
@@ -204,6 +212,21 @@ extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
 #endif
 #endif
 
+/* addr_bit is the size of a target address as represented in gdb */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT)
+#define TARGET_ADDR_BIT (TARGET_PTR_BIT)
+#endif
+
+extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
+extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_ADDR_BIT)
+#define TARGET_ADDR_BIT (gdbarch_addr_bit (current_gdbarch))
+#endif
+#endif
+
 /* Number of bits in a BFD_VMA for the target object file format. */
 
 /* Default (value) for non- multi-arch platforms. */
@@ -234,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
 
@@ -316,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
@@ -405,6 +440,86 @@ extern void set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch, int nnpc_regnum);
 #endif
 #endif
 
+/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM)
+#define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr))
+#endif
+
+typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
+extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
+extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STAB_REG_TO_REGNUM)
+#define STAB_REG_TO_REGNUM(stab_regnr) (gdbarch_stab_reg_to_regnum (current_gdbarch, stab_regnr))
+#endif
+#endif
+
+/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM)
+#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr))
+#endif
+
+typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr);
+extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
+extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ECOFF_REG_TO_REGNUM)
+#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (gdbarch_ecoff_reg_to_regnum (current_gdbarch, ecoff_regnr))
+#endif
+#endif
+
+/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM)
+#define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr))
+#endif
+
+typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr);
+extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
+extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF_REG_TO_REGNUM)
+#define DWARF_REG_TO_REGNUM(dwarf_regnr) (gdbarch_dwarf_reg_to_regnum (current_gdbarch, dwarf_regnr))
+#endif
+#endif
+
+/* Convert from an sdb register number to an internal gdb register number.
+   This should be defined in tm.h, if REGISTER_NAMES is not set up
+   to map one to one onto the sdb register numbers. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM)
+#define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr))
+#endif
+
+typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr);
+extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
+extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SDB_REG_TO_REGNUM)
+#define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM)
+#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr))
+#endif
+
+typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr);
+extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
+extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DWARF2_REG_TO_REGNUM)
+#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf2_regnr))
+#endif
+#endif
+
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (REGISTER_NAME)
 #define REGISTER_NAME(regnr) (legacy_register_name (regnr))
@@ -518,6 +633,37 @@ extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_reg
 #endif
 #endif
 
+#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)
+#define REGISTER_BYTES_OK_P() (0)
+#endif
+
+extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
+#define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
+#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);
+extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes);
+extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK)
+#define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
+#endif
+#endif
+
 extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch);
 extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames);
 #if GDB_MULTI_ARCH
@@ -698,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);
@@ -712,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);
@@ -730,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);
@@ -748,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);
@@ -851,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);
@@ -865,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);
@@ -879,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);
@@ -893,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);
@@ -907,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);
@@ -921,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);
@@ -951,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);
@@ -1069,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
@@ -1178,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)
@@ -1193,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);
@@ -1220,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)
@@ -1235,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);
@@ -1249,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)
@@ -1264,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);
@@ -1276,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))
@@ -1315,6 +1511,84 @@ extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struc
 #endif
 #endif
 
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR)
+#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr))
+#endif
+
+typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr);
+extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CONVERT_FROM_FUNC_PTR_ADDR)
+#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (gdbarch_convert_from_func_ptr_addr (current_gdbarch, addr))
+#endif
+#endif
+
+/* On some machines there are bits in addresses which are not really
+   part of the address, but are used by the kernel, the hardware, etc.
+   for special purposes.  ADDR_BITS_REMOVE takes out any such bits so
+   we get a "real" address such as one would find in a symbol table.
+   This is used only for addresses of instructions, and even then I'm
+   not sure it's used in all contexts.  It exists to deal with there
+   being a few stray bits in the PC which would mislead us, not as some
+   sort of generic thing to handle alignment or segmentation (it's
+   possible it should be in TARGET_READ_PC instead). */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE)
+#define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr))
+#endif
+
+typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
+extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDR_BITS_REMOVE)
+#define ADDR_BITS_REMOVE(addr) (gdbarch_addr_bits_remove (current_gdbarch, addr))
+#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);
 
 
@@ -1327,7 +1601,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
    The mechanisms below ensures that there is only a loose connection
    between the set-architecture command and the various GDB
-   components.  Each component can independantly register their need
+   components.  Each component can independently register their need
    to maintain architecture specific data with gdbarch.
 
    Pragmatics:
@@ -1337,7 +1611,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
    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)
+   GDB is built from a variable number of (fairly independent)
    components it was determined that the global aproach was not
    applicable. */
 
@@ -1361,7 +1635,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
    that the INFO.BYTE_ORDER is non-zero.
 
    The INIT function shall return any of: NULL - indicating that it
-   doesn't reconize the selected architecture; an existing ``struct
+   doesn't recognize the selected architecture; an existing ``struct
    gdbarch'' from the ARCHES list - indicating that the new
    architecture is just a synonym for an earlier architecture (see
    gdbarch_list_lookup_by_info()); a newly created ``struct gdbarch''
@@ -1379,9 +1653,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;
 
@@ -1435,16 +1706,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 */
 
@@ -1456,29 +1723,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.
+
+   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.
 
-   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).
+   When a previously created 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.
+   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
@@ -1497,7 +1775,7 @@ extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_
 
 
 
-/* The target-system-dependant byte order is dynamic */
+/* The target-system-dependent 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''
@@ -1537,7 +1815,7 @@ extern int target_byte_order_auto;
 
 
 
-/* The target-system-dependant BFD architecture is dynamic */
+/* The target-system-dependent BFD architecture is dynamic */
 
 extern int target_architecture_auto;
 #ifndef TARGET_ARCHITECTURE_AUTO
@@ -1550,7 +1828,7 @@ extern const struct bfd_arch_info *target_architecture;
 #endif
 
 
-/* The target-system-dependant disassembler is semi-dynamic */
+/* The target-system-dependent disassembler is semi-dynamic */
 
 #include "dis-asm.h"           /* Get defs for disassemble_info */
 
@@ -1580,18 +1858,7 @@ 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-dependant parameters (architecture,
+/* Set the dynamic target-system-dependent parameters (architecture,
    byte-order, ...) using information found in the BFD */
 
 extern void set_gdbarch_from_file (bfd *);
@@ -1602,6 +1869,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.033721 seconds and 4 git commands to generate.