* ld-selective/selective.exp <no CXX>: Fix typo for argument to
[deliverable/binutils-gdb.git] / gdb / gdbarch.h
index 0b8b64143a5499b53e99fce404182d606f98254d..198d80064aa95e569dddd006b466284cfd0848bf 100644 (file)
 
 /* 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. */
@@ -1315,6 +1338,20 @@ 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) (default_convert_from_func_ptr_addr (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
+
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
 
@@ -1327,7 +1364,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 +1374,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 +1398,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''
@@ -1497,7 +1534,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 +1574,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 +1587,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 */
 
@@ -1591,7 +1628,7 @@ extern disassemble_info tm_print_insn_info;
 #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 *);
This page took 0.026401 seconds and 4 git commands to generate.