* config/i386/nm-linux.h: Include <signal.h>.
[deliverable/binutils-gdb.git] / gdb / gdbarch.sh
index a64d340c304e6e178f096c9abc2c16bb23fc15bc..42bd93098fd42ea12ca7333bf277e1054bd911a6 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/local/bin/bash -u
+#!/bin/sh -u
 
 # Architecture commands for GDB, the GNU debugger.
 # Copyright 1998-2000 Free Software Foundation, Inc.
@@ -22,7 +22,7 @@
 compare_new ()
 {
     file=$1
-    if ! test -r ${file}
+    if test ! -r ${file}
     then
        echo "${file} missing? cp new-${file} ${file}" 1>&2
     elif diff -c ${file} new-${file}
@@ -300,25 +300,48 @@ function_list ()
 i:2:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct::::%s:TARGET_ARCHITECTURE->printable_name:TARGET_ARCHITECTURE != NULL
 #
 i:2:TARGET_BYTE_ORDER:int:byte_order::::BIG_ENDIAN
+# 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.
+# v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
 #
-v:1:TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
-v:1:TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):0
-#v:1:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):0
-v:1:TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):0
-v:1:TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):0
-v:1:TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):0
-v:1:TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):0
-v:1:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):0
-v:1:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):0
-v:1:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):0
-v:1:IEEE_FLOAT:int:ieee_float::::0:0::0:::
+# Number of bits in a short or unsigned short for the target machine.
+v::TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):2*TARGET_CHAR_BIT::0
+# Number of bits in an int or unsigned int for the target machine.
+v::TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):4*TARGET_CHAR_BIT::0
+# Number of bits in a long or unsigned long for the target machine.
+v::TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):4*TARGET_CHAR_BIT::0
+# Number of bits in a long long or unsigned long long for the target
+# machine.
+v::TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0
+# Number of bits in a float for the target machine.
+v::TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):4*TARGET_CHAR_BIT::0
+# Number of bits in a double for the target machine.
+v::TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):8*TARGET_CHAR_BIT::0
+# Number of bits in a long double for the target machine.
+v::TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):2*TARGET_DOUBLE_BIT::0
+# 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.
 #
-f:1:TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:0
-f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0
-f:1:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:0
-f:1:TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:0
-f:1:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:0
-f:1:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:0
+# 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
+v::TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):TARGET_INT_BIT::0
+# addr_bit is the size of a target address as represented in gdb
+v::TARGET_ADDR_BIT:int:addr_bit::::8 * sizeof (void*):0:TARGET_PTR_BIT:
+# Number of bits in a BFD_VMA for the target object file format.
+v::TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
+#
+v::IEEE_FLOAT:int:ieee_float::::0:0::0:::
+#
+f::TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:generic_target_read_pc::0
+f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:generic_target_write_pc::0
+f::TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0
+f::TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:generic_target_write_fp::0
+f::TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0
+f::TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0
 #
 v:2:NUM_REGS:int:num_regs::::0:-1
 # This macro gives the number of pseudo-registers that live in the
@@ -426,6 +449,7 @@ f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:f
 f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0
 #
 F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0
+v:1:EXTRA_STACK_ALIGNMENT_NEEDED:int:extra_stack_alignment_needed::::0:1::0:::
 F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0
 F:2:SAVE_DUMMY_FRAME_TOS:void:save_dummy_frame_tos:CORE_ADDR sp:sp::0:0
 #
@@ -448,9 +472,9 @@ ${class} ${macro}(${actual})
     staticdefault=${staticdefault}
     predefault=${predefault}
     postdefault=${postdefault}
-    fallbackdefault=${fallbackdefault}
+    #fallbackdefault=${fallbackdefault}
     invalid_p=${invalid_p}
-    valid_p=${valid_p}
+    #valid_p=${valid_p}
     fmt=${fmt}
     print=${print}
     print_p=${print_p}
@@ -458,7 +482,7 @@ ${class} ${macro}(${actual})
 EOF
     if class_is_predicate_p && fallback_default_p
     then
-       echo "Error: predicate function can not have a non- multi-arch default" 1>&2
+       echo "Error: predicate function ${macro} can not have a non- multi-arch default" 1>&2
        kill $$
        exit 1
     fi
@@ -501,13 +525,13 @@ cat <<EOF
 
 /* 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. */
 
@@ -569,7 +593,7 @@ done
 # function typedef's
 echo ""
 echo ""
-echo "/* The following are initialized by the target dependant code. */"
+echo "/* The following are initialized by the target dependent code. */"
 function_list | while do_read
 do
     if [ "${comment}" ]
@@ -675,7 +699,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:
@@ -685,7 +709,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. */
 
@@ -788,13 +812,15 @@ extern void gdbarch_free (struct gdbarch *);
    architecture manipulation commands.
 
    The INFO parameter shall be fully initialized (\`\`memset (&INFO,
-   sizeof (info), 0)'' set relevant fields) before gdbarch_update() is
-   called.  gdbarch_update() shall initialize any \`\`default'' fields
-   using information obtained from the previous architecture or
+   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. */
+   architectures INIT function.
+
+   Returns non-zero if the update succeeds */
 
-extern int gdbarch_update (struct gdbarch_info info);
+extern int gdbarch_update_p (struct gdbarch_info info);
 
 
 
@@ -843,7 +869,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''
@@ -883,7 +909,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
@@ -896,7 +922,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 */
 
@@ -937,7 +963,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 *);
@@ -1131,7 +1157,7 @@ EOF
 echo ""
 echo ""
 cat <<EOF
-/* Create a new \`\`struct gdbarch'' based in information provided by
+/* Create a new \`\`struct gdbarch'' based on information provided by
    \`\`struct gdbarch_info''. */
 EOF
 echo ""
@@ -1270,7 +1296,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
 EOF
 function_list | while do_read
 do
-    if [ "${returntype}" == "void" ]
+    if [ "${returntype}" = "void" ]
     then
        echo "#if defined (${macro}) && GDB_MULTI_ARCH"
        echo "  /* Macro might contain \`[{}]' when not multi-arch */"
@@ -1503,7 +1529,7 @@ gdbarch_data (struct gdbarch_data *data)
 
 
 
-/* Keep a registrary of swaped data required by GDB modules. */
+/* Keep a registrary of swapped data required by GDB modules. */
 
 struct gdbarch_swap
 {
@@ -1722,7 +1748,7 @@ gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
    failed. */
 
 int
-gdbarch_update (struct gdbarch_info info)
+gdbarch_update_p (struct gdbarch_info info)
 {
   struct gdbarch *new_gdbarch;
   struct gdbarch_list **list;
This page took 0.028313 seconds and 4 git commands to generate.