Subject: Re: Compiling GNU tools....
To: None <mike.long@analog.com>
From: Noriyuki Soda <soda@sra.co.jp>
List: current-users
Date: 09/26/1996 11:32:58
> Well, we are, but AFAIK the configs are out of date.  For instance, I
> was able to build gdb 4.16, but it refused to recognize 1.2_BETA core
> dumps.  Has anyone ever documented how NetBSD's a.out format differs
> from the original?  pk?

I think the following patch fixes the problem on i386.
(ports other than i386 should copy diffs of i386b-nat.c to appropriate
 file).

------------------------------------------------------------------------
Index: bfd/configure
===================================================================
RCS file: /usr/cvs/gnusrc/gdb/bfd/configure,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- configure	1996/05/10 13:34:39	1.1.1.1
+++ configure	1996/09/11 07:15:45	1.2
@@ -1622,6 +1622,7 @@
   hpux-core.o)		COREFLAG=-DHPUX_CORE ;;
   irix-core.o)		COREFLAG=-DIRIX_CORE ;;
   lynx-core.o)		COREFLAG=-DLYNX_CORE ;;
+  netbsd-core.o)	COREFLAG=-DNETBSD_CORE ;;
   osf-core.o)		COREFLAG=-DOSF_CORE ;;
   ptrace-core.o)	COREFLAG=-DPTRACE_CORE ;;
   rs6000-core.o)	COREFLAG="$COREFLAG -DAIX_CORE" ;;
Index: bfd/netbsd-core.c
===================================================================
RCS file: /usr/cvs/gnusrc/gdb/bfd/netbsd-core.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- netbsd-core.c	1996/05/10 13:34:51	1.1.1.1
+++ netbsd-core.c	1996/08/23 15:19:45	1.2
@@ -273,7 +273,9 @@
     0,			                                   /* symbol prefix */
     ' ',						   /* ar_pad_char */
     16,							   /* ar_max_namelen */
+#if 0 /* XXX - ? */
     3,							   /* minimum alignment power */
+#endif
     NO_GET, NO_SIGNED_GET, NO_PUT,	/* 64 bit data */
     NO_GET, NO_SIGNED_GET, NO_PUT,	/* 32 bit data */
     NO_GET, NO_SIGNED_GET, NO_PUT,	/* 16 bit data */
Index: bfd/targets.c
===================================================================
RCS file: /usr/cvs/gnusrc/gdb/bfd/targets.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- targets.c	1996/05/10 13:34:54	1.1.1.1
+++ targets.c	1996/09/11 07:15:46	1.2
@@ -578,6 +578,7 @@
 extern const bfd_target hpux_core_vec;
 extern const bfd_target hppabsd_core_vec;
 extern const bfd_target irix_core_vec;
+extern const bfd_target netbsd_core_vec;
 extern const bfd_target osf_core_vec;
 extern const bfd_target sco_core_vec;
 extern const bfd_target trad_core_vec;
@@ -767,6 +768,9 @@
 #endif
 #ifdef IRIX_CORE
 	&irix_core_vec,
+#endif
+#ifdef NETBSD_CORE
+	&netbsd_core_vec,
 #endif
 #ifdef OSF_CORE
 	&osf_core_vec,
Index: gdb/i386b-nat.c
===================================================================
RCS file: /usr/cvs/gnusrc/gdb/gdb/i386b-nat.c,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- i386b-nat.c	1996/05/10 13:33:38	1.1.1.1
+++ i386b-nat.c	1996/09/11 07:20:21	1.3
@@ -18,6 +18,7 @@
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
+#include "gdbcore.h"
 
 #ifdef FETCH_INFERIOR_REGISTERS
 #include <sys/types.h>
@@ -273,12 +323,29 @@
     }
   
   print_387_status (0, (struct env387 *)buf);
 }
 
+#ifdef __NetBSD__
+
+/* Register that we are able to handle core file formats. */
+
+static struct core_fns netbsd_core_fns =
+{
+  bfd_target_unknown_flavour,
+  fetch_core_registers,
+  NULL
+};
+
+void
+_initialize_core_netbsd ()
+{
+  add_core_fns (&netbsd_core_fns);
+}
+#endif /* __NetBSD__ */
 int
 kernel_u_size ()
 {
   return (sizeof (struct user));
 }
 
 #endif
------------------------------------------------------------------------
--
soda@sra.co.jp		Software Research Associates, Inc., Japan
(Noriyuki Soda)		   software tools and technology group