This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix NetBSD style a.out core files on i386


This makes it possible to recognize the OSABI of NetBSD style a.out
core files.

Committed,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* i386bsd-tdep.c (i386bsd_core_osabi_sniffer): New function.
	(_initialize_i386bsd_tdep): Register i386bsd_core_osabi_sniffer.

 
Index: i386bsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386bsd-tdep.c,v
retrieving revision 1.18
diff -u -p -r1.18 i386bsd-tdep.c
--- i386bsd-tdep.c 11 Oct 2003 15:38:55 -0000 1.18
+++ i386bsd-tdep.c 26 Dec 2003 17:58:34 -0000
@@ -144,6 +144,15 @@ i386bsd_aout_osabi_sniffer (bfd *abfd)
   return GDB_OSABI_UNKNOWN;
 }
 
+static enum gdb_osabi
+i386bsd_core_osabi_sniffer (bfd *abfd)
+{
+  if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
+    return GDB_OSABI_NETBSD_AOUT;
+
+  return GDB_OSABI_UNKNOWN;
+}
+
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_i386bsd_tdep (void);
@@ -153,4 +162,9 @@ _initialize_i386bsd_tdep (void)
 {
   gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_aout_flavour,
 				  i386bsd_aout_osabi_sniffer);
+
+  /* BFD doesn't set the architecture for NetBSD style a.out core
+     files.  */
+  gdbarch_register_osabi_sniffer (bfd_arch_unknown, bfd_target_unknown_flavour,
+				  i386bsd_core_osabi_sniffer);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]