* Makefile.in (ALLDEPFILES): Add nbsd-tdep.c.
authorJason Thorpe <thorpej@netbsd.org>
Sat, 11 May 2002 22:14:19 +0000 (22:14 +0000)
committerJason Thorpe <thorpej@netbsd.org>
Sat, 11 May 2002 22:14:19 +0000 (22:14 +0000)
(alphanbsd-tdep.o): Add nbsd-tdep.h to dependency list.
(nbsd-tdep.o): New dependency list.
* alphanbsd-tdep.c: Don't include solib-svr4.h.  Include
nbsd-tdep.h.
(alphanbsd_solib_svr4_fetch_link_map_offsets): Remove.
(alphanbsd_init_abi): Use nbsd_lp64_solib_svr4_fetch_link_map_offsets.
* nbsd-tdep.c: New file.
* nbsd-tdep.h: New file.
* shnbsd-tdep.c: Don't include solib-svr4.h.  Include
nbsd-tdep.h.
(shnbsd_solib_svr4_fetch_link_map_offsets): Remove.
(shnbsd_init_abi): Use nbsd_ilp32_solib_svr4_fetch_link_map_offsets.
* config/alpha/nbsd.mt (TDEPFILES): Add nbsd-tdep.o.
* config/sh/nbsd.mt (TDEPFILES): Ditto.

gdb/ChangeLog
gdb/Makefile.in
gdb/alphanbsd-tdep.c
gdb/config/alpha/nbsd.mt
gdb/config/sh/nbsd.mt
gdb/nbsd-tdep.c [new file with mode: 0644]
gdb/nbsd-tdep.h [new file with mode: 0644]
gdb/shnbsd-tdep.c

index 8ac3663280b1bcd5f383eb59357a5c13a06c16b1..f3f668a895b561e2bf8dd33059da4d54f2ed579f 100644 (file)
@@ -1,3 +1,21 @@
+2002-05-11  Jason Thorpe  <thorpej@wasabisystems.com>
+
+       * Makefile.in (ALLDEPFILES): Add nbsd-tdep.c.
+       (alphanbsd-tdep.o): Add nbsd-tdep.h to dependency list.
+       (nbsd-tdep.o): New dependency list.
+       * alphanbsd-tdep.c: Don't include solib-svr4.h.  Include
+       nbsd-tdep.h.
+       (alphanbsd_solib_svr4_fetch_link_map_offsets): Remove.
+       (alphanbsd_init_abi): Use nbsd_lp64_solib_svr4_fetch_link_map_offsets.
+       * nbsd-tdep.c: New file.
+       * nbsd-tdep.h: New file.
+       * shnbsd-tdep.c: Don't include solib-svr4.h.  Include
+       nbsd-tdep.h.
+       (shnbsd_solib_svr4_fetch_link_map_offsets): Remove.
+       (shnbsd_init_abi): Use nbsd_ilp32_solib_svr4_fetch_link_map_offsets.
+       * config/alpha/nbsd.mt (TDEPFILES): Add nbsd-tdep.o.
+       * config/sh/nbsd.mt (TDEPFILES): Ditto.
+
 2002-05-11  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * config/alpha/nbsd.mh (NATDEPFILES): Remove corelow.o.
index cb9efcff2d48a4f10bb8de95e23cb8932a745f26..00f809c6fcf1c991a2e3666d07593d1a3ae5dee9 100644 (file)
@@ -1205,6 +1205,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
        mips-linux-nat.c mips-linux-tdep.c \
        mips-nat.c \
        mips-tdep.c mipsm3-nat.c mipsv4-nat.c \
+       nbsd-tdep.c \
        nindy-share/Onindy.c nindy-share/nindy.c \
        nindy-share/ttyflush.c nindy-tdep.c \
        ns32k-tdep.c solib-osf.c \
@@ -1261,7 +1262,7 @@ alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) alphabsd-tdep.h
 alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) alpha-tdep.h
 
 alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
-       $(value_h) alpha-tdep.h alphabsd-tdep.h
+       $(value_h) alpha-tdep.h alphabsd-tdep.h nbsd-tdep.h
 
 annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) $(gdbtypes_h)
 
@@ -1799,6 +1800,8 @@ monitor.o: monitor.c $(monitor_h) $(bfd_h) $(defs_h) $(gdbcmd_h) \
        $(inferior_h) $(target_h) $(serial_h) $(terminal_h) $(gdb_string_h) \
        $(regcache_h)
 
+nbsd-tdep.o: nbsd-tdep.c $(defs_h) solib-svr4.h
+
 Onindy.o: nindy-share/Onindy.c gdb_wait.h nindy-share/block_io.h \
        nindy-share/env.h
        $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/Onindy.c
index 65641ec9759b2a8cbaf995db5f4aa35eb3312d7b..d10a3cab1597762c4488948f7456abd48536969d 100644 (file)
 #include "gdbcore.h"
 #include "regcache.h"
 #include "value.h"
-#include "solib-svr4.h"
 
 #include "alpha-tdep.h"
 #include "alphabsd-tdep.h"
+#include "nbsd-tdep.h"
 
 static void
 fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
@@ -117,47 +117,6 @@ static struct core_fns alphanbsd_elfcore_fns =
   NULL                                 /* next */
 };
 
-/* Fetch (and possibly build) an appropriate link_map_offsets
-   structure for NetBSD/alpha targets using the struct offsets
-   defined in <link.h> (but without actual reference to that file).
-
-   This makes it possible to access NetBSD/alpha shared libraries
-   from a GDB that was not built on a NetBSD/alpha host (for cross
-   debugging).  */
-
-static struct link_map_offsets *
-alphanbsd_solib_svr4_fetch_link_map_offsets (void)
-{
-  static struct link_map_offsets lmo;
-  static struct link_map_offsets *lmp = NULL;
-
-  if (lmp == NULL)
-    {
-      lmp = &lmo;
-
-      lmo.r_debug_size = 32;
-
-      lmo.r_map_offset = 8;
-      lmo.r_map_size   = 8;
-
-      lmo.link_map_size = 40;
-
-      lmo.l_addr_offset = 0;
-      lmo.l_addr_size   = 8;
-
-      lmo.l_name_offset = 8;
-      lmo.l_name_size   = 8;
-
-      lmo.l_next_offset = 24;
-      lmo.l_next_size   = 8;
-
-      lmo.l_prev_offset = 32;
-      lmo.l_prev_size   = 8;
-    }
-
-  return lmp;
-}
-
 /* Under NetBSD/alpha, signal handler invocations can be identified by the
    designated code sequence that is used to return from a signal handler.
    In particular, the return address of a signal handler points to the
@@ -233,7 +192,7 @@ alphanbsd_init_abi (struct gdbarch_info info,
   set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
 
   set_solib_svr4_fetch_link_map_offsets (gdbarch,
-                                  alphanbsd_solib_svr4_fetch_link_map_offsets);
+                                 nbsd_lp64_solib_svr4_fetch_link_map_offsets);
 
   tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;
 
index f7808f0079df5c841385680aa683a5f7c6a46e14..7fd9c503255c92b8be091561671597b7cac29aaa 100644 (file)
@@ -1,4 +1,4 @@
 # Target: Alpha running NetBSD
 TDEPFILES= alpha-tdep.o alphabsd-tdep.o alphanbsd-tdep.o corelow.o \
-       solib.o solib-svr4.o
+       nbsd-tdep.o solib.o solib-svr4.o
 TM_FILE= tm-nbsd.h
index b440993724b6623f961f014bb9d2c18e44e62b05..62d0c5ce3e86d36984be31dc860a055cad805ecd 100644 (file)
@@ -1,5 +1,5 @@
 # Target: SuperH running NetBSD
-TDEPFILES= sh-tdep.o shnbsd-tdep.o corelow.o solib.o solib-svr4.o
+TDEPFILES= sh-tdep.o shnbsd-tdep.o corelow.o nbsd-tdep.o solib.o solib-svr4.o
 TM_FILE= tm-nbsd.h
 
 SIM_OBS = remote-sim.o
diff --git a/gdb/nbsd-tdep.c b/gdb/nbsd-tdep.c
new file mode 100644 (file)
index 0000000..b5cdffb
--- /dev/null
@@ -0,0 +1,99 @@
+/* Common target-dependent code for NetBSD systems.
+   Copyright 2002 Free Software Foundation, Inc.
+   Contributed by Wasabi Systems, Inc.
+  
+   This file is part of GDB.
+  
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+     
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "solib-svr4.h"
+
+/* Fetch (and possibly build) an appropriate link_map_offsets
+   structure for NetBSD/sh targets using the struct offsets
+   defined in <link.h> (but without actual reference to that file).
+  
+   This makes it possible to access NetBSD/sh shared libraries
+   from a GDB that was not built on a NetBSD/sh host (for cross
+   debugging).
+
+   We provide versions for ILP32 and LP64 NetBSD targets here.  */
+  
+struct link_map_offsets *
+nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void)
+{
+  static struct link_map_offsets lmo;
+  static struct link_map_offsets *lmp = NULL;
+
+  if (lmp == NULL)
+    {
+      lmp = &lmo;
+
+      lmo.r_debug_size = 16;
+
+      lmo.r_map_offset = 4;
+      lmo.r_map_size   = 4;
+
+      lmo.link_map_size = 20;
+
+      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;
+}
+
+struct link_map_offsets *
+nbsd_lp64_solib_svr4_fetch_link_map_offsets (void)
+{
+  static struct link_map_offsets lmo;
+  static struct link_map_offsets *lmp = NULL;
+
+  if (lmp == NULL)
+    {
+      lmp = &lmo;
+
+      lmo.r_debug_size = 32;
+
+      lmo.r_map_offset = 8;
+      lmo.r_map_size   = 8;
+
+      lmo.link_map_size = 40;
+
+      lmo.l_addr_offset = 0;
+      lmo.l_addr_size   = 8;
+
+      lmo.l_name_offset = 8;
+      lmo.l_name_size   = 8;
+
+      lmo.l_next_offset = 24;
+      lmo.l_next_size   = 8;
+
+      lmo.l_prev_offset = 32;
+      lmo.l_prev_size   = 8;
+    }
+
+  return lmp;
+}
diff --git a/gdb/nbsd-tdep.h b/gdb/nbsd-tdep.h
new file mode 100644 (file)
index 0000000..ca40965
--- /dev/null
@@ -0,0 +1,28 @@
+/* Common target-dependent definitions for NetBSD systems.
+   Copyright 2002 Free Software Foundation, Inc.
+   Contributed by Wasabi Systems, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef NBSD_TDEP_H
+#define NBSD_TDEP_H
+
+struct link_map_offsets *nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void);
+struct link_map_offsets *nbsd_lp64_solib_svr4_fetch_link_map_offsets (void);
+
+#endif /* NBSD_TDEP_H */
index 8e503860f033cf812f6f834a005abe50247501e8..5f9903d8d7a9d5914965bdf38b1a022b171cedd7 100644 (file)
@@ -23,8 +23,8 @@
 #include "gdbcore.h"
 #include "regcache.h"
 #include "value.h"
-#include "solib-svr4.h"
 
+#include "nbsd-tdep.h"
 #include "shnbsd-tdep.h"
 
 /* Convert an r0-r15 register number into an offset into a ptrace
@@ -107,47 +107,6 @@ shnbsd_fill_reg (char *regs, int regno)
     }
 }
 
-/* Fetch (and possibly build) an appropriate link_map_offsets
-   structure for NetBSD/sh targets using the struct offsets
-   defined in <link.h> (but without actual reference to that file).
-
-   This makes it possible to access NetBSD/sh shared libraries
-   from a GDB that was not built on a NetBSD/sh host (for cross
-   debugging).  */
-
-static struct link_map_offsets *
-shnbsd_solib_svr4_fetch_link_map_offsets (void)
-{
-  static struct link_map_offsets lmo;
-  static struct link_map_offsets *lmp = NULL;
-
-  if (lmp == NULL)
-    {
-      lmp = &lmo;
-
-      lmo.r_debug_size = 16;
-
-      lmo.r_map_offset = 4;
-      lmo.r_map_size   = 4;
-
-      lmo.link_map_size = 20;
-
-      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 void
 fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
                       int which, CORE_ADDR ignore)
@@ -208,7 +167,7 @@ shnbsd_init_abi (struct gdbarch_info info,
                   struct gdbarch *gdbarch)
 {
   set_solib_svr4_fetch_link_map_offsets (gdbarch,
-                                  shnbsd_solib_svr4_fetch_link_map_offsets);
+                               nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
 }
 
 void
This page took 0.035089 seconds and 4 git commands to generate.