2000-12-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
[deliverable/binutils-gdb.git] / gdb / sh-tdep.c
index 640ea4006a2b89a0e7ac50fe5cac883e6f0f260a..44c5bd87ad2291f27164807a3eda8f0337968147 100644 (file)
@@ -39,6 +39,8 @@
 #include "arch-utils.h"
 #include "floatformat.h"
 
+#include "solib-svr4.h"
+
 #undef XMALLOC
 #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
 
@@ -1661,7 +1663,7 @@ static void
 sh_do_pseudo_register (int regnum)
 {
   if (regnum < NUM_REGS || regnum >= NUM_REGS + NUM_PSEUDO_REGS)
-    internal_error ("Invalid pasudo register number %d\n", regnum);
+    internal_error ("Invalid pseudo register number %d\n", regnum);
   else if (regnum >= NUM_REGS && 
           regnum < gdbarch_tdep (current_gdbarch)->FV0_REGNUM)
     do_dr_register_info (regnum);
@@ -1798,6 +1800,50 @@ sh_do_registers_info (int regnum, int fpregs)
     }
 }
 
+#ifdef SVR4_SHARED_LIBS
+
+/* Fetch (and possibly build) an appropriate link_map_offsets structure
+   for native i386 linux targets using the struct offsets defined in
+   link.h (but without actual reference to that file).
+
+   This makes it possible to access i386-linux shared libraries from
+   a gdb that was not built on an i386-linux host (for cross debugging).
+   */
+
+struct link_map_offsets *
+sh_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;    /* 20 not actual size but all we need */
+
+      lmo.r_map_offset = 4;
+      lmo.r_map_size   = 4;
+
+      lmo.link_map_size = 20;  /* 552 not actual size but 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;
+}
+#endif /* SVR4_SHARED_LIBS */
+
 static gdbarch_init_ftype sh_gdbarch_init;
 
 static struct gdbarch *
This page took 0.02347 seconds and 4 git commands to generate.