2003-07-22 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / arm-tdep.c
index 0a029e84702d485f8a4da20b84ec87836de1c60f..3f2f13c3bb6e1c2f4d2446e7d110588ab4055b4d 100644 (file)
@@ -33,7 +33,6 @@
 #include "doublest.h"
 #include "value.h"
 #include "arch-utils.h"
-#include "solib-svr4.h"
 #include "osabi.h"
 
 #include "arm-tdep.h"
@@ -306,28 +305,6 @@ arm_frameless_function_invocation (struct frame_info *fi)
   return frameless;
 }
 
-/* The address of the arguments in the frame.  */
-static CORE_ADDR
-arm_frame_args_address (struct frame_info *fi)
-{
-  return get_frame_base (fi);
-}
-
-/* The address of the local variables in the frame.  */
-static CORE_ADDR
-arm_frame_locals_address (struct frame_info *fi)
-{
-  return get_frame_base (fi);
-}
-
-/* The number of arguments being passed in the frame.  */
-static int
-arm_frame_num_args (struct frame_info *fi)
-{
-  /* We have no way of knowing.  */
-  return -1;
-}
-
 /* A typical Thumb prologue looks like this:
    push    {r7, lr}
    add     sp, sp, #-28
@@ -443,7 +420,7 @@ arm_skip_prologue (CORE_ADDR pc)
       struct symbol *sym;
 
       /* Found a function.  */
-      sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL);
+      sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL, NULL);
       if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
         {
          /* Don't use this trick for assembly source files.  */
@@ -1118,7 +1095,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
          else if (fromleaf)
            /* If we were called by a frameless fn.  then our frame is
               still in the frame pointer register on the board...  */
-           deprecated_update_frame_base_hack (fi, read_fp ());
+           deprecated_update_frame_base_hack (fi, deprecated_read_fp ());
        }
 
       /* Calculate actual addresses of saved registers using offsets
@@ -1237,7 +1214,7 @@ arm_push_dummy_frame (void)
   write_register (ARM_SP_REGNUM, sp);
 }
 
-/* CALL_DUMMY_WORDS:
+/* DEPRECATED_CALL_DUMMY_WORDS:
    This sequence of words is the instructions
 
    mov  lr,pc
@@ -1257,17 +1234,17 @@ static LONGEST arm_call_dummy_words[] =
 
    FIXME rearnsha 2002-02018: Tweeking current_gdbarch is not an
    optimal solution, but the call to arm_fix_call_dummy is immediately
-   followed by a call to run_stack_dummy, which is the only function
-   where call_dummy_breakpoint_offset is actually used.  */
+   followed by a call to call_function_by_hand, which is the only
+   function where call_dummy_breakpoint_offset is actually used.  */
 
 
 static void
 arm_set_call_dummy_breakpoint_offset (void)
 {
   if (caller_is_thumb)
-    set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 4);
+    set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 4);
   else
-    set_gdbarch_call_dummy_breakpoint_offset (current_gdbarch, 8);
+    set_gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch, 8);
 }
 
 /* Fix up the call dummy, based on whether the processor is currently
@@ -1405,19 +1382,20 @@ pop_stack_item (struct stack_item *si)
    we should probably support some of them based on the selected ABI.  */
 
 static CORE_ADDR
-arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
-                    CORE_ADDR dummy_addr, int nargs, struct value **args,
-                    CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
+arm_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+                    struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
+                    struct value **args, CORE_ADDR sp, int struct_return,
+                    CORE_ADDR struct_addr)
 {
   int argnum;
   int argreg;
   int nstack;
   struct stack_item *si = NULL;
 
-  /* Set the return address.  For the ARM, the return breakpoint is always
-     at DUMMY_ADDR.  */
+  /* Set the return address.  For the ARM, the return breakpoint is
+     always at BP_ADDR.  */
   /* XXX Fix for Thumb.  */
-  regcache_cooked_write_unsigned (regcache, ARM_LR_REGNUM, dummy_addr);
+  regcache_cooked_write_unsigned (regcache, ARM_LR_REGNUM, bp_addr);
 
   /* Walk through the list of args and determine how large a temporary
      stack is required.  Need to take care here as structs may be
@@ -1430,7 +1408,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
   /* Some platforms require a double-word aligned stack.  Make sure sp
      is correctly aligned before we start.  We always do this even if
      it isn't really needed -- it can never hurt things.  */
-  sp &= ~(CORE_ADDR)(2 * REGISTER_SIZE - 1);
+  sp &= ~(CORE_ADDR)(2 * DEPRECATED_REGISTER_SIZE - 1);
 
   /* The struct_return pointer occupies the first parameter
      passing register.  */
@@ -1464,11 +1442,11 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
          && target_type != NULL
          && TYPE_CODE_FUNC == TYPE_CODE (target_type))
        {
-         CORE_ADDR regval = extract_address (val, len);
+         CORE_ADDR regval = extract_unsigned_integer (val, len);
          if (arm_pc_is_thumb (regval))
            {
              val = alloca (len);
-             store_address (val, len, MAKE_THUMB_ADDR (regval));
+             store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval));
            }
        }
 
@@ -1477,17 +1455,17 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
         registers and stack.  */
       while (len > 0)
        {
-         int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
+         int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE;
 
          if (argreg <= ARM_LAST_ARG_REGNUM)
            {
              /* The argument is being passed in a general purpose
                 register.  */
-             CORE_ADDR regval = extract_address (val, partial_len);
+             CORE_ADDR regval = extract_unsigned_integer (val, partial_len);
              if (arm_debug)
                fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n",
                                    argnum, REGISTER_NAME (argreg),
-                                   phex (regval, REGISTER_SIZE));
+                                   phex (regval, DEPRECATED_REGISTER_SIZE));
              regcache_cooked_write_unsigned (regcache, argreg, regval);
              argreg++;
            }
@@ -1497,8 +1475,8 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache,
              if (arm_debug)
                fprintf_unfiltered (gdb_stdlog, "arg %d @ sp + %d\n",
                                    argnum, nstack);
-             si = push_stack_item (si, val, REGISTER_SIZE);
-             nstack += REGISTER_SIZE;
+             si = push_stack_item (si, val, DEPRECATED_REGISTER_SIZE);
+             nstack += DEPRECATED_REGISTER_SIZE;
            }
              
          len -= partial_len;
@@ -1799,7 +1777,7 @@ thumb_get_next_pc (CORE_ADDR pc)
 
       /* Fetch the saved PC from the stack.  It's stored above
          all of the other registers.  */
-      offset = bitcount (bits (inst1, 0, 7)) * REGISTER_SIZE;
+      offset = bitcount (bits (inst1, 0, 7)) * DEPRECATED_REGISTER_SIZE;
       sp = read_register (ARM_SP_REGNUM);
       nextpc = (CORE_ADDR) read_memory_integer (sp + offset, 4);
       nextpc = ADDR_BITS_REMOVE (nextpc);
@@ -2309,10 +2287,10 @@ arm_use_struct_convention (int gcc_p, struct type *type)
 
   /* In the ARM ABI, "integer" like aggregate types are returned in
      registers.  For an aggregate type to be integer like, its size
-     must be less than or equal to REGISTER_SIZE and the offset of
-     each addressable subfield must be zero.  Note that bit fields are
-     not addressable, and all addressable subfields of unions always
-     start at offset zero.
+     must be less than or equal to DEPRECATED_REGISTER_SIZE and the
+     offset of each addressable subfield must be zero.  Note that bit
+     fields are not addressable, and all addressable subfields of
+     unions always start at offset zero.
 
      This function is based on the behaviour of GCC 2.95.1.
      See: gcc/arm.c: arm_return_in_memory() for details.
@@ -2326,7 +2304,7 @@ arm_use_struct_convention (int gcc_p, struct type *type)
 
   /* All aggregate types that won't fit in a register must be returned
      in memory.  */
-  if (TYPE_LENGTH (type) > REGISTER_SIZE)
+  if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE)
     {
       return 1;
     }
@@ -2348,11 +2326,11 @@ arm_use_struct_convention (int gcc_p, struct type *type)
       int i;
       /* Need to check if this struct/union is "integer" like.  For
          this to be true, its size must be less than or equal to
-         REGISTER_SIZE and the offset of each addressable subfield
-         must be zero.  Note that bit fields are not addressable, and
-         unions always start at offset zero.  If any of the subfields
-         is a floating point type, the struct/union cannot be an
-         integer type.  */
+         DEPRECATED_REGISTER_SIZE and the offset of each addressable
+         subfield must be zero.  Note that bit fields are not
+         addressable, and unions always start at offset zero.  If any
+         of the subfields is a floating point type, the struct/union
+         cannot be an integer type.  */
 
       /* For each field in the object, check:
          1) Is it FP? --> yes, nRc = 1;
@@ -2493,7 +2471,7 @@ arm_get_longjmp_target (CORE_ADDR *pc)
                          INT_REGISTER_RAW_SIZE))
     return 0;
 
-  *pc = extract_address (buf, INT_REGISTER_RAW_SIZE);
+  *pc = extract_unsigned_integer (buf, INT_REGISTER_RAW_SIZE);
   return 1;
 }
 
@@ -2689,49 +2667,6 @@ arm_othernames (char *names, int n)
   set_disassembly_style ();
 }
 
-/* Fetch, and possibly build, an appropriate link_map_offsets structure
-   for ARM linux targets using the struct offsets defined in <link.h>.
-   Note, however, that link.h is not actually referred to in this file.
-   Instead, the relevant structs offsets were obtained from examining
-   link.h.  (We can't refer to link.h from this file because the host
-   system won't necessarily have it, or if it does, the structs which
-   it defines will refer to the host system, not the target).  */
-
-struct link_map_offsets *
-arm_linux_svr4_fetch_link_map_offsets (void)
-{
-  static struct link_map_offsets lmo;
-  static struct link_map_offsets *lmp = 0;
-
-  if (lmp == 0)
-    {
-      lmp = &lmo;
-
-      lmo.r_debug_size = 8;    /* Actual size is 20, but this is all we
-                                   need.  */
-
-      lmo.r_map_offset = 4;
-      lmo.r_map_size   = 4;
-
-      lmo.link_map_size = 20;  /* Actual size is 552, but this is all we
-                                   need.  */
-
-      lmo.l_addr_offset = 0;
-      lmo.l_addr_size   = 4;
-
-      lmo.l_name_offset = 4;
-      lmo.l_name_size   = 4;
-
-      lmo.l_next_offset = 12;
-      lmo.l_next_size   = 4;
-
-      lmo.l_prev_offset = 16;
-      lmo.l_prev_size   = 4;
-    }
-
-    return lmp;
-}
-
 /* Test whether the coff symbol specific value corresponds to a Thumb
    function.  */
 
@@ -2930,22 +2865,19 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   tdep->lowest_pc = 0x20;
   tdep->jb_pc = -1;    /* Longjump support not enabled by default.  */
 
-  set_gdbarch_call_dummy_words (gdbarch, arm_call_dummy_words);
-  set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+  set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_call_dummy_words);
+  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
 
   set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
 
   /* Frame handling.  */
   set_gdbarch_deprecated_frame_chain_valid (gdbarch, arm_frame_chain_valid);
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, arm_init_extra_frame_info);
-  set_gdbarch_read_fp (gdbarch, arm_read_fp);
+  set_gdbarch_deprecated_target_read_fp (gdbarch, arm_read_fp);
   set_gdbarch_deprecated_frame_chain (gdbarch, arm_frame_chain);
   set_gdbarch_frameless_function_invocation
     (gdbarch, arm_frameless_function_invocation);
   set_gdbarch_deprecated_frame_saved_pc (gdbarch, arm_frame_saved_pc);
-  set_gdbarch_frame_args_address (gdbarch, arm_frame_args_address);
-  set_gdbarch_frame_locals_address (gdbarch, arm_frame_locals_address);
-  set_gdbarch_frame_num_args (gdbarch, arm_frame_num_args);
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs);
   set_gdbarch_deprecated_pop_frame (gdbarch, arm_pop_frame);
@@ -2972,26 +2904,26 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Information about registers, etc.  */
   set_gdbarch_print_float_info (gdbarch, arm_print_float_info);
-  set_gdbarch_fp_regnum (gdbarch, ARM_FP_REGNUM);      /* ??? */
+  set_gdbarch_deprecated_fp_regnum (gdbarch, ARM_FP_REGNUM);   /* ??? */
   set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM);
-  set_gdbarch_register_byte (gdbarch, arm_register_byte);
-  set_gdbarch_register_bytes (gdbarch,
-                             (NUM_GREGS * INT_REGISTER_RAW_SIZE
-                              + NUM_FREGS * FP_REGISTER_RAW_SIZE
-                              + NUM_SREGS * STATUS_REGISTER_SIZE));
+  set_gdbarch_deprecated_register_byte (gdbarch, arm_register_byte);
+  set_gdbarch_deprecated_register_bytes (gdbarch,
+                                        (NUM_GREGS * INT_REGISTER_RAW_SIZE
+                                         + NUM_FREGS * FP_REGISTER_RAW_SIZE
+                                         + NUM_SREGS * STATUS_REGISTER_SIZE));
   set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SREGS);
-  set_gdbarch_register_raw_size (gdbarch, arm_register_raw_size);
-  set_gdbarch_register_virtual_size (gdbarch, arm_register_virtual_size);
+  set_gdbarch_deprecated_register_raw_size (gdbarch, arm_register_raw_size);
+  set_gdbarch_deprecated_register_virtual_size (gdbarch, arm_register_virtual_size);
   set_gdbarch_deprecated_max_register_raw_size (gdbarch, FP_REGISTER_RAW_SIZE);
   set_gdbarch_deprecated_max_register_virtual_size (gdbarch, FP_REGISTER_VIRTUAL_SIZE);
-  set_gdbarch_register_virtual_type (gdbarch, arm_register_type);
+  set_gdbarch_deprecated_register_virtual_type (gdbarch, arm_register_type);
 
   /* Internal <-> external register number maps.  */
   set_gdbarch_register_sim_regno (gdbarch, arm_register_sim_regno);
 
   /* Integer registers are 4 bytes.  */
-  set_gdbarch_register_size (gdbarch, 4);
+  set_gdbarch_deprecated_register_size (gdbarch, 4);
   set_gdbarch_register_name (gdbarch, arm_register_name);
 
   /* Returning results.  */
@@ -3078,6 +3010,8 @@ arm_init_abi_apcs (struct gdbarch_info info,
   /* Place-holder.  */
 }
 
+extern initialize_file_ftype _initialize_arm_tdep; /* -Wmissing-prototypes */
+
 void
 _initialize_arm_tdep (void)
 {
This page took 0.029197 seconds and 4 git commands to generate.