* sparc64-tdep.h (sparc64_regnum): Fix comment.
[deliverable/binutils-gdb.git] / gdb / arm-linux-tdep.c
index 91fa88fe0add9bf148873d6d72a67d4ef1dbf75b..5ea3ef2f9828213828b326222c54a1ebad873cef 100644 (file)
@@ -27,6 +27,7 @@
 #include "frame.h"
 #include "regcache.h"
 #include "doublest.h"
+#include "solib-svr4.h"
 #include "osabi.h"
 
 #include "arm-tdep.h"
@@ -46,7 +47,7 @@
 
 static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
 
-/* CALL_DUMMY_WORDS:
+/* DEPRECATED_CALL_DUMMY_WORDS:
    This sequence of words is the instructions
 
    mov  lr, pc
@@ -73,7 +74,7 @@ LONGEST arm_linux_call_dummy_words[] =
    hidden behind the regcache abstraction.  */
 static void
 arm_linux_extract_return_value (struct type *type,
-                               char regbuf[REGISTER_BYTES],
+                               char regbuf[],
                                char *valbuf)
 {
   /* ScottB: This needs to be looked at to handle the different
@@ -115,10 +116,10 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
   /* Walk through the list of args and determine how large a temporary
      stack is required.  Need to take care here as structs may be
      passed on the stack, and we have to to push them.  */
-  nstack_size = -4 * REGISTER_SIZE;    /* Some arguments go into A1-A4.  */
+  nstack_size = -4 * DEPRECATED_REGISTER_SIZE; /* Some arguments go into A1-A4.  */
 
   if (struct_return)                   /* The struct address goes in A1.  */
-    nstack_size += REGISTER_SIZE;
+    nstack_size += DEPRECATED_REGISTER_SIZE;
 
   /* Walk through the arguments and add their size to nstack_size.  */
   for (argnum = 0; argnum < nargs; argnum++)
@@ -131,7 +132,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
 
       /* ANSI C code passes float arguments as integers, K&R code
          passes float arguments as doubles.  Correct for this here.  */
-      if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && REGISTER_SIZE == len)
+      if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && DEPRECATED_REGISTER_SIZE == len)
        nstack_size += FP_REGISTER_VIRTUAL_SIZE;
       else
        nstack_size += len;
@@ -178,7 +179,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
          .stabs records the type as FP_FLOAT.  In this latter case
          the compiler converts the float arguments to double before
          calling the function.  */
-      if (TYPE_CODE_FLT == typecode && REGISTER_SIZE == len)
+      if (TYPE_CODE_FLT == typecode && DEPRECATED_REGISTER_SIZE == len)
        {
          DOUBLEST dblval;
          dblval = deprecated_extract_floating (val, len);
@@ -193,9 +194,9 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
          && NULL != target_type
          && 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))
-           store_address (val, len, MAKE_THUMB_ADDR (regval));
+           store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval));
        }
 
       /* Copy the argument to general registers or the stack in
@@ -203,19 +204,19 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
          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)
            {
              /* It's an argument being passed in a general register.  */
-             regval = extract_address (val, partial_len);
+             regval = extract_unsigned_integer (val, partial_len);
              write_register (argreg++, regval);
            }
          else
            {
              /* Push the arguments onto the stack.  */
-             write_memory ((CORE_ADDR) fp, val, REGISTER_SIZE);
-             fp += REGISTER_SIZE;
+             write_memory ((CORE_ADDR) fp, val, DEPRECATED_REGISTER_SIZE);
+             fp += DEPRECATED_REGISTER_SIZE;
            }
 
          len -= partial_len;
@@ -376,6 +377,49 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p)
 }
 
 
+/* 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).  */
+
+static 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;
+}
+
 static CORE_ADDR
 skip_hurd_resolver (CORE_ADDR pc)
 {
@@ -530,9 +574,11 @@ arm_linux_init_abi (struct gdbarch_info info,
   tdep->jb_pc = ARM_LINUX_JB_PC;
   tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
 
-  set_gdbarch_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
-  set_gdbarch_sizeof_call_dummy_words (gdbarch,
-                                      sizeof (arm_linux_call_dummy_words));
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, arm_linux_svr4_fetch_link_map_offsets);
+
+  set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
+  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (arm_linux_call_dummy_words));
 
   /* The following two overrides shouldn't be needed.  */
   set_gdbarch_deprecated_extract_return_value (gdbarch, arm_linux_extract_return_value);
This page took 0.039377 seconds and 4 git commands to generate.