From: Mark Kettenis Date: Thu, 22 Jan 2004 22:57:59 +0000 (+0000) Subject: * sparcnbsd-tdep.c (sparcnbsd_core_osabi_sniffer): New function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=89aac506c25976bbedcb92aa944a14ea7398e477;p=binutils-gdb.git * sparcnbsd-tdep.c (sparcnbsd_core_osabi_sniffer): New function. (_initialize_sparnbsd_tdep): Register sparcnbsd_core_osabi_sniffer. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 792a8a977eb..c3adf21c1c0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2004-01-22 Mark Kettenis + * 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. diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c index 4ea39016aa5..80e3db5a678 100644 --- a/gdb/sparcnbsd-tdep.c +++ b/gdb/sparcnbsd-tdep.c @@ -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; +} + /* 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,