* sparcnbsd-tdep.c (sparcnbsd_core_osabi_sniffer): New function.
authorMark Kettenis <kettenis@gnu.org>
Thu, 22 Jan 2004 22:57:59 +0000 (22:57 +0000)
committerMark Kettenis <kettenis@gnu.org>
Thu, 22 Jan 2004 22:57:59 +0000 (22:57 +0000)
(_initialize_sparnbsd_tdep): Register sparcnbsd_core_osabi_sniffer.

gdb/ChangeLog
gdb/sparcnbsd-tdep.c

index 792a8a977ebb0ae8f6f41135d5f96ffe8eb3b8b0..c3adf21c1c0c536b48517fd3382a6a3c097f1944 100644 (file)
@@ -1,5 +1,8 @@
 2004-01-22  Mark Kettenis  <kettenis@gnu.org>
 
+       * sparcnbsd-tdep.c (sparcnbsd_core_osabi_sniffer): New function.
+       (_initialize_sparnbsd_tdep): Register sparcnbsd_core_osabi_sniffer.
+
        * ser-pipe.c (pipe_open): Use proper null pointer in execl call.
        * cli/cli-cmds.c (shell_escape): Likewise.
 
index 4ea39016aa57055af297972ed284d5fb83ce576e..80e3db5a678ce0fb9c9f7f65e64b6c697bed6253 100644 (file)
@@ -284,6 +284,15 @@ sparcnbsd_aout_osabi_sniffer (bfd *abfd)
   return GDB_OSABI_UNKNOWN;
 }
 
+static enum gdb_osabi
+sparcnbsd_core_osabi_sniffer (bfd *abfd)
+{
+  if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
+    return GDB_OSABI_NETBSD_AOUT;
+
+  return GDB_OSABI_UNKNOWN;
+}
+
 \f
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_sparcnbsd_tdep (void);
@@ -294,6 +303,11 @@ _initialize_sparnbsd_tdep (void)
   gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_aout_flavour,
                                  sparcnbsd_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,
+                                  sparcnbsd_core_osabi_sniffer);
+
   gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_AOUT,
                          sparc32nbsd_aout_init_abi);
   gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_ELF,