2004-05-07 Michael Snyder <msnyder@redhat.com>
[deliverable/binutils-gdb.git] / gdb / arm-linux-tdep.c
index b5fb496deb4a2da120c948dfd7487bfc2c3cf476..98dacca60c207bd0e165666698386fdb60f20c95 100644 (file)
 #include "osabi.h"
 
 #include "arm-tdep.h"
-
-/* For shared library handling.  */
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
+#include "glibc-tdep.h"
 
 /* Under ARM GNU/Linux the traditional way of performing a breakpoint
    is to execute a particular software interrupt, rather than use a
@@ -48,22 +44,8 @@ static const char arm_linux_arm_le_breakpoint[] = { 0x01, 0x00, 0x9f, 0xef };
 
 static const char arm_linux_arm_be_breakpoint[] = { 0xef, 0x9f, 0x00, 0x01 };
 
-/* DEPRECATED_CALL_DUMMY_WORDS:
-   This sequence of words is the instructions
-
-   mov  lr, pc
-   mov  pc, r4
-   swi bkpt_swi
-
-   Note this is 12 bytes.  */
-
-LONGEST arm_linux_call_dummy_words[] =
-{
-  0xe1a0e00f, 0xe1a0f004, 0xef9f001
-};
-
 /* Description of the longjmp buffer.  */
-#define ARM_LINUX_JB_ELEMENT_SIZE      INT_REGISTER_RAW_SIZE
+#define ARM_LINUX_JB_ELEMENT_SIZE      INT_REGISTER_SIZE
 #define ARM_LINUX_JB_PC                        21
 
 /* Extract from an array REGBUF containing the (raw) register state
@@ -134,7 +116,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) && DEPRECATED_REGISTER_SIZE == len)
-       nstack_size += FP_REGISTER_VIRTUAL_SIZE;
+       nstack_size += TARGET_DOUBLE_BIT / TARGET_CHAR_BIT;
       else
        nstack_size += len;
     }
@@ -348,36 +330,6 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
    with.  Before the fixup/resolver code returns, it actually calls
    the requested function and repairs &GOT[n+3].  */
 
-/* Find the minimal symbol named NAME, and return both the minsym
-   struct and its objfile.  This probably ought to be in minsym.c, but
-   everything there is trying to deal with things like C++ and
-   SOFUN_ADDRESS_MAYBE_TURQUOISE, ...  Since this is so simple, it may
-   be considered too special-purpose for general consumption.  */
-
-static struct minimal_symbol *
-find_minsym_and_objfile (char *name, struct objfile **objfile_p)
-{
-  struct objfile *objfile;
-
-  ALL_OBJFILES (objfile)
-    {
-      struct minimal_symbol *msym;
-
-      ALL_OBJFILE_MSYMBOLS (objfile, msym)
-       {
-         if (DEPRECATED_SYMBOL_NAME (msym)
-             && strcmp (DEPRECATED_SYMBOL_NAME (msym), name) == 0)
-           {
-             *objfile_p = objfile;
-             return msym;
-           }
-       }
-    }
-
-  return 0;
-}
-
-
 /* 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.
@@ -421,63 +373,6 @@ arm_linux_svr4_fetch_link_map_offsets (void)
     return lmp;
 }
 
-static CORE_ADDR
-skip_hurd_resolver (CORE_ADDR pc)
-{
-  /* The HURD dynamic linker is part of the GNU C library, so many
-     GNU/Linux distributions use it.  (All ELF versions, as far as I
-     know.)  An unresolved PLT entry points to "_dl_runtime_resolve",
-     which calls "fixup" to patch the PLT, and then passes control to
-     the function.
-
-     We look for the symbol `_dl_runtime_resolve', and find `fixup' in
-     the same objfile.  If we are at the entry point of `fixup', then
-     we set a breakpoint at the return address (at the top of the
-     stack), and continue.
-  
-     It's kind of gross to do all these checks every time we're
-     called, since they don't change once the executable has gotten
-     started.  But this is only a temporary hack --- upcoming versions
-     of GNU/Linux will provide a portable, efficient interface for
-     debugging programs that use shared libraries.  */
-
-  struct objfile *objfile;
-  struct minimal_symbol *resolver 
-    = find_minsym_and_objfile ("_dl_runtime_resolve", &objfile);
-
-  if (resolver)
-    {
-      struct minimal_symbol *fixup
-       = lookup_minimal_symbol ("fixup", NULL, objfile);
-
-      if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc)
-       return (DEPRECATED_SAVED_PC_AFTER_CALL (get_current_frame ()));
-    }
-
-  return 0;
-}      
-
-/* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c.
-   This function:
-   1) decides whether a PLT has sent us into the linker to resolve
-      a function reference, and 
-   2) if so, tells us where to set a temporary breakpoint that will
-      trigger when the dynamic linker is done.  */
-
-CORE_ADDR
-arm_linux_skip_solib_resolver (CORE_ADDR pc)
-{
-  CORE_ADDR result;
-
-  /* Plug in functions for other kinds of resolvers here.  */
-  result = skip_hurd_resolver (pc);
-
-  if (result)
-    return result;
-  
-  return 0;
-}
-
 /* The constants below were determined by examining the following files
    in the linux kernel sources:
 
@@ -581,9 +476,6 @@ arm_linux_init_abi (struct gdbarch_info info,
   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);
   set_gdbarch_deprecated_push_arguments (gdbarch, arm_linux_push_arguments);
@@ -591,6 +483,7 @@ arm_linux_init_abi (struct gdbarch_info info,
   /* Shared library handling.  */
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+  set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
 }
 
 void
This page took 0.024723 seconds and 4 git commands to generate.