diff options
44 files changed, 193 insertions, 979 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cba6514..f115283 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,114 @@ +2016-12-09 Pedro Alves <palves@redhat.com> + + * Makefile.in (ALL_TARGET_OBS): Remove vax-obsd-tdep.o. + * alpha-fbsd-tdep.c (_initialize_alphafbsd_tdep): Adjust. + * alpha-nbsd-tdep.c: Move comment to _initialize_alphanbsd_tdep. + (alphanbsd_core_osabi_sniffer): Delete. + (_initialize_alphanbsd_tdep): No longer handle a.out. + * alpha-obsd-tdep.c (_initialize_alphaobsd_tdep): Adjust. + * amd64-fbsd-tdep.c (_initialize_amd64fbsd_tdep): Adjust. + * amd64-nbsd-tdep.c (_initialize_amd64nbsd_tdep): Adjust. + * amd64-obsd-tdep.c (amd64obsd_supply_regset) + (amd64obsd_combined_regset) + (amd64obsd_iterate_over_regset_sections, amd64obsd_core_init_abi): + Delete. + (_initialize_amd64obsd_tdep): Don't handle a.out. + * arm-nbsd-nat.c (struct md_core, fetch_core_registers) + (arm_netbsd_core_fns): Delete. + (_initialize_arm_netbsd_nat): Don't register arm_netbsd_core_fns. + * arm-nbsd-tdep.c (arm_netbsd_aout_init_abi) + (arm_netbsd_aout_osabi_sniffer): Delete. + (_initialize_arm_netbsd_tdep): Don't handle a.out. + * arm-obsd-tdep.c (armobsd_core_osabi_sniffer): Delete. + (_initialize_armobsd_tdep): Don't handle a.out. + * arm-tdep.c (arm_gdbarch_init): Remove bfd_target_aout_flavour + case. + * breakpoint.c (disable_breakpoints_in_unloaded_shlib): Remove + SunOS a.out handling. + * configure.tgt (vax-*-netbsd* | vax-*-knetbsd*-gnu): Remove + vax-obsd-tdep.o from gdb_target_objs. + (vax-*-openbsd*): Likewise. + (*-*-freebsd*): Adjust default gdb_osabi. + (*-*-openbsd*): Likewise. + * dbxread.c (block_address_function_relative): Delete. + (dbx_symfile_read): Remove reference to + block_address_function_relative. + (dbx_symfile_read): Don't call read_dbx_dynamic_symtab. + (read_dbx_dynamic_symtab): Delete. + (process_one_symbol): Remove references to + block_address_function_relative. + * defs.h (GDB_OSABI_FREEBSD_AOUT, GDB_OSABI_NETBSD_AOUT): Remove. + (GDB_OSABI_FREEBSD_ELF): Rename to ... + (GDB_OSABI_FREEBSD): ... this. + (GDB_OSABI_NETBSD_ELF): Rename to ... + (GDB_OSABI_NETBSD): ... this. + (GDB_OSABI_OPENBSD_ELF): Rename to ... + (GDB_OSABI_OPENBSD): ... this. + (GDB_OSABI_HPUX_ELF, GDB_OSABI_HPUX_SOM): Remove. + * fbsd-tdep.c: Adjust comment. + * hppa-nbsd-tdep.c (_initialize_hppanbsd_tdep): Adjust. + * hppa-obsd-tdep.c (GDB_OSABI_NETBSD_CORE): Delete. + (hppaobsd_core_osabi_sniffer): Delete. + (_initialize_hppabsd_tdep): Don't handle a.out. + * hppa-tdep.c (hppa_stub_frame_unwind_cache): Don't handle + GDB_OSABI_HPUX_SOM. + (hppa_gdbarch_init): Likewise. + * i386-bsd-tdep.c (i386bsd_aout_osabi_sniffer) + (i386bsd_core_osabi_sniffer, _initialize_i386bsd_tdep): Delete. + * i386-fbsd-tdep.c (i386fbsdaout_init_abi): Delete. Merge bits + with ... + (i386fbsd_init_abi): ... this. + (_initialize_i386fbsd_tdep): Don't handle a.out. + * i386-nbsd-tdep.c (_initialize_i386nbsd_tdep): Adjust. + * i386-obsd-tdep.c (i386obsd_aout_supply_regset) + (i386obsd_aout_gregset) + (i386obsd_aout_iterate_over_regset_sections): Delete. + (i386obsd_init_abi): Merge with i386obsd_elf_init_abi. + (i386obsd_aout_init_abi): Delete. + (_initialize_i386obsd_tdep): Don't handle a.out. + * m68k-bsd-tdep.c (m68kobsd_sigtramp_cache_init) + (m68kobsd_sigtramp): Delete. + (m68kbsd_init_abi): Merge with ... + (m68kbsd_elf_init_abi): ... this, and delete it. + (m68kbsd_aout_init_abi): Delete. + (m68kbsd_aout_osabi_sniffer, m68kbsd_core_osabi_sniffer): Delete. + (_initialize_m68kbsd_tdep): Don't handle a.out. + * mips-nbsd-tdep.c (_initialize_mipsnbsd_tdep): Adjust. + * mips64-obsd-tdep.c (_initialize_mips64obsd_tdep): Adjust. + * osabi.c (gdb_osabi_names): Remove "a.out" entries. Drop "ELF" + suffixes. Remove "HP-UX" entries. + (generic_elf_osabi_sniff_abi_tag_sections): Adjust. + (generic_elf_osabi_sniffer): No longer handle GDB_OSABI_HPUX_ELF. + Adjust. + (_initialize_ppcfbsd_tdep): Adjust. + * ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Adjust. + * ppc-obsd-tdep.c (GDB_OSABI_NETBSD_CORE) + (ppcobsd_core_osabi_sniffer): Delete. + (_initialize_ppcobsd_tdep): Don't handle a.out. + * rs6000-tdep.c (rs6000_gdbarch_init): Adjust. + * sh-nbsd-tdep.c (GDB_OSABI_NETBSD_CORE) + (shnbsd_core_osabi_sniffer): Delete. + (_initialize_shnbsd_tdep): Don't handle a.out. + * solib.c (clear_solib): Don't handle SunOS/a.out. + * sparc-nbsd-tdep.c (sparc32nbsd_init_abi): Make extern. + (sparc32nbsd_aout_init_abi): Delete. + (sparc32nbsd_elf_init_abi): Merged into sparc32nbsd_init_abi. + (sparcnbsd_aout_osabi_sniffer): Delete. + (GDB_OSABI_NETBSD_CORE, sparcnbsd_core_osabi_sniffer): Delete. + (_initialize_sparcnbsd_tdep): No longer handle a.out. + * sparc-obsd-tdep.c (sparc32obsd_init_abi) + (_initialize_sparc32obsd_tdep): Adjust. + * sparc-tdep.h (sparc32nbsd_elf_init_abi): Rename to ... + (sparc32nbsd_init_abi): ... this. + * sparc64-fbsd-tdep.c (_initialize_sparc64fbsd_tdep): Adjust. + * sparc64-nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Adjust. + * sparc64-obsd-tdep.c (_initialize_sparc64obsd_tdep): Adjust. + * stabsread.c: Update comment. + * symmisc.c (print_objfile_statistics): Don't mention "a.out" in + output. + * vax-nbsd-tdep.c (_initialize_vaxnbsd_tdep): Adjust. + * vax-obsd-tdep.c: Delete file. + 2016-12-09 Yao Qi <yao.qi@linaro.org> PR tdep/20954 diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 2cf1b3d..946d440 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -873,7 +873,6 @@ ALL_TARGET_OBS = \ tilegx-tdep.o \ v850-tdep.o \ vax-nbsd-tdep.o \ - vax-obsd-tdep.o \ vax-tdep.o \ windows-tdep.o \ xcoffread.o \ diff --git a/gdb/alpha-fbsd-tdep.c b/gdb/alpha-fbsd-tdep.c index 84fedc2..6328f1e 100644 --- a/gdb/alpha-fbsd-tdep.c +++ b/gdb/alpha-fbsd-tdep.c @@ -127,6 +127,6 @@ void _initialize_alphafbsd_tdep (void); void _initialize_alphafbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_FREEBSD_ELF, + gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_FREEBSD, alphafbsd_init_abi); } diff --git a/gdb/alpha-nbsd-tdep.c b/gdb/alpha-nbsd-tdep.c index 00ff481..b84b691 100644 --- a/gdb/alpha-nbsd-tdep.c +++ b/gdb/alpha-nbsd-tdep.c @@ -35,9 +35,6 @@ /* Core file support. */ -/* Even though NetBSD/alpha used ELF since day one, it used the - traditional a.out-style core dump format before NetBSD 1.6. */ - /* Sizeof `struct reg' in <machine/reg.h>. */ #define ALPHANBSD_SIZEOF_GREGS (32 * 8) @@ -279,26 +276,15 @@ alphanbsd_init_abi (struct gdbarch_info info, } -static enum gdb_osabi -alphanbsd_core_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0) - return GDB_OSABI_NETBSD_ELF; - - return GDB_OSABI_UNKNOWN; -} - - /* Provide a prototype to silence -Wmissing-prototypes. */ void _initialize_alphanbsd_tdep (void); void _initialize_alphanbsd_tdep (void) { - /* BFD doesn't set a flavour for NetBSD style a.out core files. */ - gdbarch_register_osabi_sniffer (bfd_arch_alpha, bfd_target_unknown_flavour, - alphanbsd_core_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD_ELF, + /* Even though NetBSD/alpha used ELF since day one, it used the + traditional a.out-style core dump format before NetBSD 1.6, but + we don't support those. */ + gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD, alphanbsd_init_abi); } diff --git a/gdb/alpha-obsd-tdep.c b/gdb/alpha-obsd-tdep.c index 98436f3..2ed8a58 100644 --- a/gdb/alpha-obsd-tdep.c +++ b/gdb/alpha-obsd-tdep.c @@ -132,6 +132,6 @@ void _initialize_alphaobsd_tdep (void); void _initialize_alphaobsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OPENBSD_ELF, + gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OPENBSD, alphaobsd_init_abi); } diff --git a/gdb/amd64-fbsd-tdep.c b/gdb/amd64-fbsd-tdep.c index d3c4270..bd591af 100644 --- a/gdb/amd64-fbsd-tdep.c +++ b/gdb/amd64-fbsd-tdep.c @@ -315,5 +315,5 @@ void _initialize_amd64fbsd_tdep (void) { gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_FREEBSD_ELF, amd64fbsd_init_abi); + GDB_OSABI_FREEBSD, amd64fbsd_init_abi); } diff --git a/gdb/amd64-nbsd-tdep.c b/gdb/amd64-nbsd-tdep.c index 9e3cb11..6d37ffd 100644 --- a/gdb/amd64-nbsd-tdep.c +++ b/gdb/amd64-nbsd-tdep.c @@ -129,5 +129,5 @@ _initialize_amd64nbsd_tdep (void) gdb_assert (ARRAY_SIZE (amd64nbsd_r_reg_offset) == AMD64_NUM_GREGS); gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_NETBSD_ELF, amd64nbsd_init_abi); + GDB_OSABI_NETBSD, amd64nbsd_init_abi); } diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c index 7c79e44..bbf0908 100644 --- a/gdb/amd64-obsd-tdep.c +++ b/gdb/amd64-obsd-tdep.c @@ -35,44 +35,6 @@ #include "solib-svr4.h" #include "bsd-uthread.h" -/* Support for core dumps. */ - -static void -amd64obsd_supply_regset (const struct regset *regset, - struct regcache *regcache, int regnum, - const void *regs, size_t len) -{ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE); - - i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset); - amd64_supply_fxsave (regcache, regnum, - ((const gdb_byte *)regs) + tdep->sizeof_gregset); -} - -static const struct regset amd64obsd_combined_regset = - { - NULL, amd64obsd_supply_regset, NULL - }; - -static void -amd64obsd_iterate_over_regset_sections (struct gdbarch *gdbarch, - iterate_over_regset_sections_cb *cb, - void *cb_data, - const struct regcache *regcache) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - /* OpenBSD core dumps don't use seperate register sets for the - general-purpose and floating-point registers. */ - - cb (".reg", tdep->sizeof_gregset + I387_SIZEOF_FXSAVE, - &amd64obsd_combined_regset, NULL, cb_data); -} - - /* Support for signal handlers. */ /* Default page size. */ @@ -483,17 +445,6 @@ amd64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Unwind kernel trap frames correctly. */ frame_unwind_prepend_unwinder (gdbarch, &amd64obsd_trapframe_unwind); } - -/* Traditional (a.out) NetBSD-style core dumps. */ - -static void -amd64obsd_core_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - amd64obsd_init_abi (info, gdbarch); - - set_gdbarch_iterate_over_regset_sections - (gdbarch, amd64obsd_iterate_over_regset_sections); -} /* Provide a prototype to silence -Wmissing-prototypes. */ @@ -506,9 +457,5 @@ _initialize_amd64obsd_tdep (void) gdb_assert (ARRAY_SIZE (amd64obsd_r_reg_offset) == AMD64_NUM_GREGS); gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_OPENBSD_ELF, amd64obsd_init_abi); - - /* OpenBSD uses traditional (a.out) NetBSD-style core dumps. */ - gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, - GDB_OSABI_NETBSD_AOUT, amd64obsd_core_init_abi); + GDB_OSABI_OPENBSD, amd64obsd_init_abi); } diff --git a/gdb/arm-nbsd-nat.c b/gdb/arm-nbsd-nat.c index c8b549e..f9fd7be 100644 --- a/gdb/arm-nbsd-nat.c +++ b/gdb/arm-nbsd-nat.c @@ -409,25 +409,6 @@ armnbsd_store_registers (struct target_ops *ops, } } -struct md_core -{ - struct reg intreg; - struct fpreg freg; -}; - -static void -fetch_core_registers (struct regcache *regcache, - char *core_reg_sect, unsigned core_reg_size, - int which, CORE_ADDR ignore) -{ - struct md_core *core_reg = (struct md_core *) core_reg_sect; - int regno; - CORE_ADDR r_pc; - - arm_supply_gregset (regcache, &core_reg->intreg); - arm_supply_fparegset (regcache, &core_reg->freg); -} - static void fetch_elfcore_registers (struct regcache *regcache, char *core_reg_sect, unsigned core_reg_size, @@ -468,15 +449,6 @@ fetch_elfcore_registers (struct regcache *regcache, } } -static struct core_fns arm_netbsd_core_fns = -{ - bfd_target_unknown_flavour, /* core_flovour. */ - default_check_format, /* check_format. */ - default_core_sniffer, /* core_sniffer. */ - fetch_core_registers, /* core_read_registers. */ - NULL -}; - static struct core_fns arm_netbsd_elfcore_fns = { bfd_target_elf_flavour, /* core_flovour. */ @@ -496,6 +468,5 @@ _initialize_arm_netbsd_nat (void) t->to_store_registers = armnbsd_store_registers; add_target (t); - deprecated_add_core_fns (&arm_netbsd_core_fns); deprecated_add_core_fns (&arm_netbsd_elfcore_fns); } diff --git a/gdb/arm-nbsd-tdep.c b/gdb/arm-nbsd-tdep.c index 259853c..e4d8fbe 100644 --- a/gdb/arm-nbsd-tdep.c +++ b/gdb/arm-nbsd-tdep.c @@ -71,17 +71,6 @@ arm_netbsd_init_abi_common (struct gdbarch_info info, } static void -arm_netbsd_aout_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - arm_netbsd_init_abi_common (info, gdbarch); - if (tdep->fp_model == ARM_FLOAT_AUTO) - tdep->fp_model = ARM_FLOAT_SOFT_FPA; -} - -static void arm_netbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -96,26 +85,12 @@ arm_netbsd_elf_init_abi (struct gdbarch_info info, (gdbarch, svr4_ilp32_fetch_link_map_offsets); } -static enum gdb_osabi -arm_netbsd_aout_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "a.out-arm-netbsd") == 0) - return GDB_OSABI_NETBSD_AOUT; - - return GDB_OSABI_UNKNOWN; -} - /* Provide a prototype to silence -Wmissing-prototypes. */ extern initialize_file_ftype _initialize_arm_netbsd_tdep; void _initialize_arm_netbsd_tdep (void) { - gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_aout_flavour, - arm_netbsd_aout_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD_AOUT, - arm_netbsd_aout_init_abi); - gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD, arm_netbsd_elf_init_abi); } diff --git a/gdb/arm-obsd-tdep.c b/gdb/arm-obsd-tdep.c index 5ccf1d1..9031903 100644 --- a/gdb/arm-obsd-tdep.c +++ b/gdb/arm-obsd-tdep.c @@ -116,25 +116,12 @@ armobsd_init_abi (struct gdbarch_info info, } -static enum gdb_osabi -armobsd_core_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0) - return GDB_OSABI_OPENBSD_ELF; - - return GDB_OSABI_UNKNOWN; -} - /* Provide a prototype to silence -Wmissing-prototypes. */ extern initialize_file_ftype _initialize_armobsd_tdep; void _initialize_armobsd_tdep (void) { - /* BFD doesn't set a flavour for NetBSD style a.out core files. */ - gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_unknown_flavour, - armobsd_core_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_OPENBSD_ELF, + gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_OPENBSD, armobsd_init_abi); } diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 97dea89..937fb8b 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -8990,11 +8990,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) switch (bfd_get_flavour (info.abfd)) { - case bfd_target_aout_flavour: - /* Assume it's an old APCS-style ABI. */ - arm_abi = ARM_ABI_APCS; - break; - case bfd_target_coff_flavour: /* Assume it's an old APCS-style ABI. */ /* XXX WinCE? */ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 38262ba..92aac3a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -7957,14 +7957,6 @@ disable_breakpoints_in_unloaded_shlib (struct so_list *solib) struct bp_location *loc, **locp_tmp; int disabled_shlib_breaks = 0; - /* SunOS a.out shared libraries are always mapped, so do not - disable breakpoints; they will only be reported as unloaded - through clear_solib when GDB discards its shared library - list. See clear_solib for more information. */ - if (exec_bfd != NULL - && bfd_get_flavour (exec_bfd) == bfd_target_aout_flavour) - return; - ALL_BP_LOCATIONS (loc, locp_tmp) { /* ALL_BP_LOCATIONS bp_location has LOC->OWNER always non-NULL. */ diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 3a1ea6f..3f2603d 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -643,11 +643,11 @@ v850*-*-elf | v850*-*-rtems*) vax-*-netbsd* | vax-*-knetbsd*-gnu) # Target: NetBSD/vax - gdb_target_obs="vax-tdep.o vax-nbsd-tdep.o solib-svr4.o" + gdb_target_obs="vax-tdep.o solib-svr4.o" ;; vax-*-openbsd*) # Target: OpenBSD/vax - gdb_target_obs="vax-tdep.o vax-obsd-tdep.o" + gdb_target_obs="vax-tdep.o" ;; vax-*-*) # Target: VAX @@ -720,12 +720,12 @@ esac case "${targ}" in *-*-freebsd* | *-*-kfreebsd*-gnu) - gdb_osabi=GDB_OSABI_FREEBSD_ELF ;; + gdb_osabi=GDB_OSABI_FREEBSD ;; *-*-linux* | *-*-uclinux*) gdb_osabi=GDB_OSABI_LINUX ;; *-*-nto*) gdb_osabi=GDB_OSABI_QNXNTO ;; m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;; -*-*-openbsd*) gdb_osabi=GDB_OSABI_OPENBSD_ELF ;; +*-*-openbsd*) gdb_osabi=GDB_OSABI_OPENBSD ;; *-*-solaris*) gdb_osabi=GDB_OSABI_SOLARIS ;; *-*-*-gnu*) ;; # prevent non-GNU kernels to match the Hurd rule below *-*-gnu*) gdb_osabi=GDB_OSABI_HURD ;; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index cfc4ed0..ed3511f 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -144,10 +144,6 @@ static unsigned int next_file_string_table_offset; static int symfile_relocatable = 0; -/* If this is nonzero, N_LBRAC, N_RBRAC, and N_SLINE entries are - relative to the function start address. */ - -static int block_address_function_relative = 0; /* The lowest text address we have yet encountered. This is needed because in an a.out file, there is no header field which tells us @@ -262,9 +258,6 @@ static void dbx_read_symtab (struct partial_symtab *self, static void dbx_psymtab_to_symtab_1 (struct objfile *, struct partial_symtab *); -static void read_dbx_dynamic_symtab (minimal_symbol_reader &reader, - struct objfile *objfile); - static void read_dbx_symtab (minimal_symbol_reader &, struct objfile *); static void free_bincl_list (struct objfile *); @@ -534,18 +527,6 @@ dbx_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) symfile_relocatable = bfd_get_file_flags (sym_bfd) & HAS_RELOC; - /* This is true for Solaris (and all other systems which put stabs - in sections, hopefully, since it would be silly to do things - differently from Solaris), and false for SunOS4 and other a.out - file formats. */ - block_address_function_relative = - ((startswith (bfd_get_target (sym_bfd), "elf")) - || (startswith (bfd_get_target (sym_bfd), "som")) - || (startswith (bfd_get_target (sym_bfd), "coff")) - || (startswith (bfd_get_target (sym_bfd), "pe")) - || (startswith (bfd_get_target (sym_bfd), "epoc-pe")) - || (startswith (bfd_get_target (sym_bfd), "nlm"))); - val = bfd_seek (sym_bfd, DBX_SYMTAB_OFFSET (objfile), SEEK_SET); if (val < 0) perror_with_name (objfile_name (objfile)); @@ -566,10 +547,6 @@ dbx_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) read_dbx_symtab (reader, objfile); - /* Add the dynamic symbols. */ - - read_dbx_dynamic_symtab (reader, objfile); - /* Install any minimal symbols that have been collected as the current minimal symbols for this objfile. */ @@ -976,144 +953,6 @@ set_namestring (struct objfile *objfile, const struct internal_nlist *nlist) return namestring; } -/* Scan a SunOs dynamic symbol table for symbols of interest and - add them to the minimal symbol table. */ - -static void -read_dbx_dynamic_symtab (minimal_symbol_reader &reader, - struct objfile *objfile) -{ - bfd *abfd = objfile->obfd; - struct cleanup *back_to; - int counter; - long dynsym_size; - long dynsym_count; - asymbol **dynsyms; - asymbol **symptr; - arelent **relptr; - long dynrel_size; - long dynrel_count; - arelent **dynrels; - CORE_ADDR sym_value; - const char *name; - - /* Check that the symbol file has dynamic symbols that we know about. - bfd_arch_unknown can happen if we are reading a sun3 symbol file - on a sun4 host (and vice versa) and bfd is not configured - --with-target=all. This would trigger an assertion in bfd/sunos.c, - so we ignore the dynamic symbols in this case. */ - if (bfd_get_flavour (abfd) != bfd_target_aout_flavour - || (bfd_get_file_flags (abfd) & DYNAMIC) == 0 - || bfd_get_arch (abfd) == bfd_arch_unknown) - return; - - dynsym_size = bfd_get_dynamic_symtab_upper_bound (abfd); - if (dynsym_size < 0) - return; - - dynsyms = (asymbol **) xmalloc (dynsym_size); - back_to = make_cleanup (xfree, dynsyms); - - dynsym_count = bfd_canonicalize_dynamic_symtab (abfd, dynsyms); - if (dynsym_count < 0) - { - do_cleanups (back_to); - return; - } - - /* Enter dynamic symbols into the minimal symbol table - if this is a stripped executable. */ - if (bfd_get_symcount (abfd) <= 0) - { - symptr = dynsyms; - for (counter = 0; counter < dynsym_count; counter++, symptr++) - { - asymbol *sym = *symptr; - asection *sec; - int type; - - sec = bfd_get_section (sym); - - /* BFD symbols are section relative. */ - sym_value = sym->value + sec->vma; - - if (bfd_get_section_flags (abfd, sec) & SEC_CODE) - { - type = N_TEXT; - } - else if (bfd_get_section_flags (abfd, sec) & SEC_DATA) - { - type = N_DATA; - } - else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC) - { - type = N_BSS; - } - else - continue; - - if (sym->flags & BSF_GLOBAL) - type |= N_EXT; - - record_minimal_symbol (reader, bfd_asymbol_name (sym), sym_value, - type, objfile); - } - } - - /* Symbols from shared libraries have a dynamic relocation entry - that points to the associated slot in the procedure linkage table. - We make a mininal symbol table entry with type mst_solib_trampoline - at the address in the procedure linkage table. */ - dynrel_size = bfd_get_dynamic_reloc_upper_bound (abfd); - if (dynrel_size < 0) - { - do_cleanups (back_to); - return; - } - - dynrels = (arelent **) xmalloc (dynrel_size); - make_cleanup (xfree, dynrels); - - dynrel_count = bfd_canonicalize_dynamic_reloc (abfd, dynrels, dynsyms); - if (dynrel_count < 0) - { - do_cleanups (back_to); - return; - } - - for (counter = 0, relptr = dynrels; - counter < dynrel_count; - counter++, relptr++) - { - arelent *rel = *relptr; - CORE_ADDR address = rel->address; - - switch (bfd_get_arch (abfd)) - { - case bfd_arch_sparc: - if (rel->howto->type != RELOC_JMP_SLOT) - continue; - break; - case bfd_arch_m68k: - /* `16' is the type BFD produces for a jump table relocation. */ - if (rel->howto->type != 16) - continue; - - /* Adjust address in the jump table to point to - the start of the bsr instruction. */ - address -= 2; - break; - default: - continue; - } - - name = bfd_asymbol_name (*rel->sym_ptr_ptr); - reader.record (name, address, mst_solib_trampoline); - } - - do_cleanups (back_to); -} - static CORE_ADDR find_stab_function_addr (char *namestring, const char *filename, struct objfile *objfile) @@ -2688,14 +2527,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, source file. Used to detect the SunPRO solaris compiler. */ static int n_opt_found; - if (!block_address_function_relative) - { - /* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the - function start address, so just use the text offset. */ - function_start_offset = - ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); - } - /* Something is wrong if we see real data before seeing a source file name. */ @@ -2751,8 +2582,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, /* May be switching to an assembler file which may not be using block relative stabs, so reset the offset. */ - if (block_address_function_relative) - function_start_offset = 0; + function_start_offset = 0; break; } @@ -2774,13 +2604,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, if (n_opt_found && desc == 1) break; - if (block_address_function_relative) - /* Relocate for Sun ELF acc fn-relative syms. */ - valu += function_start_offset; - else - /* On most machines, the block addresses are relative to the - N_SO, the linker did not relocate them (sigh). */ - valu += last_source_start_addr; + valu += function_start_offset; push_context (desc, valu); break; @@ -2793,13 +2617,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, if (n_opt_found && desc == 1) break; - if (block_address_function_relative) - /* Relocate for Sun ELF acc fn-relative syms. */ - valu += function_start_offset; - else - /* On most machines, the block addresses are relative to the - N_SO, the linker did not relocate them (sigh). */ - valu += last_source_start_addr; + valu += function_start_offset; if (context_stack_depth <= 0) { @@ -2894,8 +2712,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, if (*name == '\000') break; - if (block_address_function_relative) - function_start_offset = 0; + function_start_offset = 0; start_stabs (); start_symtab (objfile, name, NULL, valu); @@ -3113,14 +2930,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, valu = minsym_valu; } - if (block_address_function_relative) - /* For Solaris 2 compilers, the block addresses and - N_SLINE's are relative to the start of the - function. On normal systems, and when using GCC on - Solaris 2, these addresses are just absolute, or - relative to the N_SO, depending on - BLOCK_ADDRESS_ABSOLUTE. */ - function_start_offset = valu; + /* These addresses are absolute. */ + function_start_offset = valu; within_function = 1; @@ -574,15 +574,11 @@ enum gdb_osabi GDB_OSABI_HURD, GDB_OSABI_SOLARIS, GDB_OSABI_LINUX, - GDB_OSABI_FREEBSD_AOUT, - GDB_OSABI_FREEBSD_ELF, - GDB_OSABI_NETBSD_AOUT, - GDB_OSABI_NETBSD_ELF, - GDB_OSABI_OPENBSD_ELF, + GDB_OSABI_FREEBSD, + GDB_OSABI_NETBSD, + GDB_OSABI_OPENBSD, GDB_OSABI_WINCE, GDB_OSABI_GO32, - GDB_OSABI_HPUX_ELF, - GDB_OSABI_HPUX_SOM, GDB_OSABI_QNXNTO, GDB_OSABI_CYGWIN, GDB_OSABI_AIX, diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index 4329f97..4c91cfc 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -334,7 +334,7 @@ fbsd_get_syscall_number (struct gdbarch *gdbarch, internal_error (__FILE__, __LINE__, _("fbsd_get_sycall_number called")); } -/* To be called from GDB_OSABI_FREEBSD_ELF handlers. */ +/* To be called from GDB_OSABI_FREEBSD handlers. */ void fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) diff --git a/gdb/hppa-nbsd-tdep.c b/gdb/hppa-nbsd-tdep.c index 6165bb5..c48dae4 100644 --- a/gdb/hppa-nbsd-tdep.c +++ b/gdb/hppa-nbsd-tdep.c @@ -213,6 +213,6 @@ extern initialize_file_ftype _initialize_hppanbsd_tdep; void _initialize_hppanbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_NETBSD, hppanbsd_init_abi); } diff --git a/gdb/hppa-obsd-tdep.c b/gdb/hppa-obsd-tdep.c index 65364fe..fe1e4f7 100644 --- a/gdb/hppa-obsd-tdep.c +++ b/gdb/hppa-obsd-tdep.c @@ -166,30 +166,12 @@ hppaobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) } -/* OpenBSD uses uses the traditional NetBSD core file format, even for - ports that use ELF. */ -#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF - -static enum gdb_osabi -hppaobsd_core_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0) - return GDB_OSABI_NETBSD_CORE; - - return GDB_OSABI_UNKNOWN; -} - - /* Provide a prototype to silence -Wmissing-prototypes. */ void _initialize_hppabsd_tdep (void); void _initialize_hppabsd_tdep (void) { - /* BFD doesn't set a flavour for NetBSD style a.out core files. */ - gdbarch_register_osabi_sniffer (bfd_arch_hppa, bfd_target_unknown_flavour, - hppaobsd_core_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_OPENBSD_ELF, + gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_OPENBSD, hppaobsd_init_abi); } diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 4bb49ed..65a49fd 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -2454,21 +2454,6 @@ hppa_stub_frame_unwind_cache (struct frame_info *this_frame, info->base = get_frame_register_unsigned (this_frame, HPPA_SP_REGNUM); - if (gdbarch_osabi (gdbarch) == GDB_OSABI_HPUX_SOM) - { - /* HPUX uses export stubs in function calls; the export stub clobbers - the return value of the caller, and, later restores it from the - stack. */ - u = find_unwind_entry (get_frame_pc (this_frame)); - - if (u && u->stub_unwind.stub_type == EXPORT) - { - info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].addr = info->base - 24; - - return info; - } - } - /* By default we assume that stubs do not change the rp. */ info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].realreg = HPPA_RP_REGNUM; @@ -3062,14 +3047,6 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch_tdep *tdep; struct gdbarch *gdbarch; - - /* Try to determine the ABI of the object we are loading. */ - if (info.abfd != NULL && info.osabi == GDB_OSABI_UNKNOWN) - { - /* If it's a SOM file, assume it's HP/UX SOM. */ - if (bfd_get_flavour (info.abfd) == bfd_target_som_flavour) - info.osabi = GDB_OSABI_HPUX_SOM; - } /* find a candidate among the list of pre-declared architectures. */ arches = gdbarch_list_lookup_by_info (arches, &info); diff --git a/gdb/i386-bsd-tdep.c b/gdb/i386-bsd-tdep.c index 15809b3..af4b830 100644 --- a/gdb/i386-bsd-tdep.c +++ b/gdb/i386-bsd-tdep.c @@ -86,38 +86,3 @@ i386bsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) } -static enum gdb_osabi -i386bsd_aout_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "a.out-i386-netbsd") == 0) - return GDB_OSABI_NETBSD_AOUT; - - if (strcmp (bfd_get_target (abfd), "a.out-i386-freebsd") == 0) - return GDB_OSABI_FREEBSD_AOUT; - - 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); - -void -_initialize_i386bsd_tdep (void) -{ - gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_aout_flavour, - i386bsd_aout_osabi_sniffer); - - /* BFD doesn't set a flavour for NetBSD style a.out core files. */ - gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_unknown_flavour, - i386bsd_core_osabi_sniffer); -} diff --git a/gdb/i386-fbsd-tdep.c b/gdb/i386-fbsd-tdep.c index a08523a..236f49b 100644 --- a/gdb/i386-fbsd-tdep.c +++ b/gdb/i386-fbsd-tdep.c @@ -373,7 +373,7 @@ i386fbsd_collect_uthread (const struct regcache *regcache, } static void -i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +i386fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -403,18 +403,10 @@ i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* FreeBSD provides a user-level threads implementation. */ bsd_uthread_set_supply_uthread (gdbarch, i386fbsd_supply_uthread); bsd_uthread_set_collect_uthread (gdbarch, i386fbsd_collect_uthread); -} - -static void -i386fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - /* It's almost identical to FreeBSD a.out. */ - i386fbsdaout_init_abi (info, gdbarch); - /* Except that it uses ELF. */ i386_elf_init_abi (info, gdbarch); - /* FreeBSD ELF uses SVR4-style shared libraries. */ + /* FreeBSD uses SVR4-style shared libraries. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); } @@ -491,8 +483,6 @@ void _initialize_i386fbsd_tdep (void); void _initialize_i386fbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_AOUT, - i386fbsdaout_init_abi); - gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_ELF, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD, i386fbsd4_init_abi); } diff --git a/gdb/i386-nbsd-tdep.c b/gdb/i386-nbsd-tdep.c index f73e5c1..088eb91 100644 --- a/gdb/i386-nbsd-tdep.c +++ b/gdb/i386-nbsd-tdep.c @@ -322,6 +322,6 @@ extern initialize_file_ftype _initialize_i386nbsd_tdep; void _initialize_i386nbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_NETBSD, i386nbsdelf_init_abi); } diff --git a/gdb/i386-obsd-tdep.c b/gdb/i386-obsd-tdep.c index 08becfa..5495c54 100644 --- a/gdb/i386-obsd-tdep.c +++ b/gdb/i386-obsd-tdep.c @@ -134,40 +134,6 @@ static int i386obsd_r_reg_offset[] = 15 * 4 /* %gs */ }; -static void -i386obsd_aout_supply_regset (const struct regset *regset, - struct regcache *regcache, int regnum, - const void *regs, size_t len) -{ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - const gdb_byte *gregs = (const gdb_byte *) regs; - - gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE); - - i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset); - i387_supply_fsave (regcache, regnum, gregs + tdep->sizeof_gregset); -} - -static const struct regset i386obsd_aout_gregset = - { - NULL, i386obsd_aout_supply_regset, NULL - }; - -static void -i386obsd_aout_iterate_over_regset_sections (struct gdbarch *gdbarch, - iterate_over_regset_sections_cb *cb, - void *cb_data, - const struct regcache *regcache) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - /* OpenBSD a.out core dumps don't use seperate register sets for the - general-purpose and floating-point registers. */ - - cb (".reg", tdep->sizeof_gregset + I387_SIZEOF_FSAVE, - &i386obsd_aout_gregset, NULL, cb_data); -} /* Sigtramp routine location for OpenBSD 3.1 and earlier releases. */ @@ -445,6 +411,7 @@ i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Obviously OpenBSD is BSD-based. */ i386bsd_init_abi (info, gdbarch); obsd_init_abi (info, gdbarch); + i386_elf_init_abi (info, gdbarch); /* OpenBSD has a different `struct reg'. */ tdep->gregset_reg_offset = i386obsd_r_reg_offset; @@ -470,30 +437,6 @@ i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Unwind kernel trap frames correctly. */ frame_unwind_prepend_unwinder (gdbarch, &i386obsd_trapframe_unwind); -} - -/* OpenBSD a.out. */ - -static void -i386obsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - i386obsd_init_abi (info, gdbarch); - - /* OpenBSD a.out has a single register set. */ - set_gdbarch_iterate_over_regset_sections - (gdbarch, i386obsd_aout_iterate_over_regset_sections); -} - -/* OpenBSD ELF. */ - -static void -i386obsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - /* It's still OpenBSD. */ - i386obsd_init_abi (info, gdbarch); - - /* But ELF-based. */ - i386_elf_init_abi (info, gdbarch); /* OpenBSD ELF uses SVR4-style shared libraries. */ set_solib_svr4_fetch_link_map_offsets @@ -507,14 +450,6 @@ void _initialize_i386obsd_tdep (void); void _initialize_i386obsd_tdep (void) { - /* FIXME: kettenis/20021020: Since OpenBSD/i386 binaries are - indistingushable from NetBSD/i386 a.out binaries, building a GDB - that should support both these targets will probably not work as - expected. */ -#define GDB_OSABI_OPENBSD_AOUT GDB_OSABI_NETBSD_AOUT - - gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD_AOUT, - i386obsd_aout_init_abi); - gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD_ELF, - i386obsd_elf_init_abi); + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD, + i386obsd_init_abi); } diff --git a/gdb/m68k-bsd-tdep.c b/gdb/m68k-bsd-tdep.c index 0d2a4e9..349774d 100644 --- a/gdb/m68k-bsd-tdep.c +++ b/gdb/m68k-bsd-tdep.c @@ -129,60 +129,6 @@ m68kbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, } -/* Signal trampolines. */ - -static void -m68kobsd_sigtramp_cache_init (const struct tramp_frame *self, - struct frame_info *this_frame, - struct trad_frame_cache *this_cache, - CORE_ADDR func) -{ - CORE_ADDR addr, base, pc; - int regnum; - - base = get_frame_register_unsigned (this_frame, M68K_SP_REGNUM); - - /* The 'addql #4,%sp' instruction at offset 8 adjusts the stack - pointer. Adjust the frame base accordingly. */ - pc = get_frame_register_unsigned (this_frame, M68K_PC_REGNUM); - if ((pc - func) > 8) - base -= 4; - - /* Get frame pointer, stack pointer, program counter and processor - state from `struct sigcontext'. */ - addr = get_frame_memory_unsigned (this_frame, base + 8, 4); - trad_frame_set_reg_addr (this_cache, M68K_FP_REGNUM, addr + 8); - trad_frame_set_reg_addr (this_cache, M68K_SP_REGNUM, addr + 12); - trad_frame_set_reg_addr (this_cache, M68K_PC_REGNUM, addr + 20); - trad_frame_set_reg_addr (this_cache, M68K_PS_REGNUM, addr + 24); - - /* The sc_ap member of `struct sigcontext' points to additional - hardware state. Here we find the missing registers. */ - addr = get_frame_memory_unsigned (this_frame, addr + 16, 4) + 4; - for (regnum = M68K_D0_REGNUM; regnum < M68K_FP_REGNUM; regnum++, addr += 4) - trad_frame_set_reg_addr (this_cache, regnum, addr); - - /* Construct the frame ID using the function start. */ - trad_frame_set_id (this_cache, frame_id_build (base, func)); -} - -static const struct tramp_frame m68kobsd_sigtramp = { - SIGTRAMP_FRAME, - 2, - { - { 0x206f, -1 }, { 0x000c, -1}, /* moveal %sp@(12),%a0 */ - { 0x4e90, -1 }, /* jsr %a0@ */ - { 0x588f, -1 }, /* addql #4,%sp */ - { 0x4e41, -1 }, /* trap #1 */ - { 0x2f40, -1 }, { 0x0004, -1 }, /* moveal %d0,%sp@(4) */ - { 0x7001, -1 }, /* moveq #SYS_exit,%d0 */ - { 0x4e40, -1 }, /* trap #0 */ - { TRAMP_SENTINEL_INSN, -1 } - }, - m68kobsd_sigtramp_cache_init -}; - - static void m68kbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -195,30 +141,6 @@ m68kbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_iterate_over_regset_sections (gdbarch, m68kbsd_iterate_over_regset_sections); -} - -/* OpenBSD and NetBSD a.out. */ - -static void -m68kbsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - m68kbsd_init_abi (info, gdbarch); - - tdep->struct_return = reg_struct_return; - - tramp_frame_prepend_unwinder (gdbarch, &m68kobsd_sigtramp); -} - -/* NetBSD ELF. */ - -static void -m68kbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - m68kbsd_init_abi (info, gdbarch); /* NetBSD ELF uses the SVR4 ABI. */ m68k_svr4_init_abi (info, gdbarch); @@ -230,41 +152,12 @@ m68kbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) } -static enum gdb_osabi -m68kbsd_aout_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "a.out-m68k-netbsd") == 0 - || strcmp (bfd_get_target (abfd), "a.out-m68k4k-netbsd") == 0) - return GDB_OSABI_NETBSD_AOUT; - - return GDB_OSABI_UNKNOWN; -} - -static enum gdb_osabi -m68kbsd_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_m68kbsd_tdep (void); void _initialize_m68kbsd_tdep (void) { - gdbarch_register_osabi_sniffer (bfd_arch_m68k, bfd_target_aout_flavour, - m68kbsd_aout_osabi_sniffer); - - /* BFD doesn't set a flavour for NetBSD style a.out core files. */ - gdbarch_register_osabi_sniffer (bfd_arch_m68k, bfd_target_unknown_flavour, - m68kbsd_core_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_m68k, 0, GDB_OSABI_NETBSD_AOUT, - m68kbsd_aout_init_abi); - gdbarch_register_osabi (bfd_arch_m68k, 0, GDB_OSABI_NETBSD_ELF, - m68kbsd_elf_init_abi); + gdbarch_register_osabi (bfd_arch_m68k, 0, GDB_OSABI_NETBSD, + m68kbsd_init_abi); } diff --git a/gdb/mips-nbsd-tdep.c b/gdb/mips-nbsd-tdep.c index 2d7cd82..7934c8d 100644 --- a/gdb/mips-nbsd-tdep.c +++ b/gdb/mips-nbsd-tdep.c @@ -380,6 +380,6 @@ extern initialize_file_ftype _initialize_mipsnbsd_tdep; void _initialize_mipsnbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_NETBSD, mipsnbsd_init_abi); } diff --git a/gdb/mips64-obsd-tdep.c b/gdb/mips64-obsd-tdep.c index df8ec0f..5209ab4 100644 --- a/gdb/mips64-obsd-tdep.c +++ b/gdb/mips64-obsd-tdep.c @@ -165,6 +165,6 @@ void _initialize_mips64obsd_tdep (void); void _initialize_mips64obsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_OPENBSD_ELF, + gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_OPENBSD, mips64obsd_init_abi); } diff --git a/gdb/osabi.c b/gdb/osabi.c index 8b44a85..69d95f6 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -64,15 +64,11 @@ static const struct osabi_names gdb_osabi_names[] = { "GNU/Hurd", NULL }, { "Solaris", NULL }, { "GNU/Linux", "linux(-gnu)?" }, - { "FreeBSD/a.out", NULL }, - { "FreeBSD/ELF", NULL }, - { "NetBSD/a.out", NULL }, - { "NetBSD/ELF", NULL }, - { "OpenBSD/ELF", NULL }, + { "FreeBSD", NULL }, + { "NetBSD", NULL }, + { "OpenBSD", NULL }, { "WindowsCE", NULL }, { "DJGPP", NULL }, - { "HP-UX/ELF", NULL }, - { "HP-UX/SOM", NULL }, { "QNX-Neutrino", NULL }, { "Cygwin", NULL }, { "AIX", NULL }, @@ -482,11 +478,11 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) break; case GNU_ABI_TAG_FREEBSD: - *osabi = GDB_OSABI_FREEBSD_ELF; + *osabi = GDB_OSABI_FREEBSD; break; case GNU_ABI_TAG_NETBSD: - *osabi = GDB_OSABI_NETBSD_ELF; + *osabi = GDB_OSABI_NETBSD; break; default: @@ -501,7 +497,7 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) NT_FREEBSD_ABI_TAG)) { /* There is no need to check the version yet. */ - *osabi = GDB_OSABI_FREEBSD_ELF; + *osabi = GDB_OSABI_FREEBSD; return; } @@ -513,7 +509,7 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) && check_note (abfd, sect, note, §size, "NetBSD", 4, NT_NETBSD_IDENT)) { /* There is no need to check the version yet. */ - *osabi = GDB_OSABI_NETBSD_ELF; + *osabi = GDB_OSABI_NETBSD; return; } @@ -523,14 +519,14 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) NT_OPENBSD_IDENT)) { /* There is no need to check the version yet. */ - *osabi = GDB_OSABI_OPENBSD_ELF; + *osabi = GDB_OSABI_OPENBSD; return; } /* .note.netbsdcore.procinfo notes, used by NetBSD. */ if (strcmp (name, ".note.netbsdcore.procinfo") == 0) { - *osabi = GDB_OSABI_NETBSD_ELF; + *osabi = GDB_OSABI_NETBSD; return; } } @@ -547,6 +543,7 @@ generic_elf_osabi_sniffer (bfd *abfd) { case ELFOSABI_NONE: case ELFOSABI_GNU: + case ELFOSABI_HPUX: /* When the EI_OSABI field in the ELF header is ELFOSABI_NONE (0), then the ELF structures in the file are conforming to the base specification for that machine (there are no @@ -555,34 +552,27 @@ generic_elf_osabi_sniffer (bfd *abfd) The same applies for ELFOSABI_GNU: this can mean GNU/Hurd, GNU/Linux, and possibly more. */ + + /* And likewise ELFOSABI_HPUX. For some reason the default + value for the EI_OSABI field is ELFOSABI_HPUX for all PA-RISC + targets (with the exception of GNU/Linux). */ bfd_map_over_sections (abfd, generic_elf_osabi_sniff_abi_tag_sections, &osabi); break; case ELFOSABI_FREEBSD: - osabi = GDB_OSABI_FREEBSD_ELF; + osabi = GDB_OSABI_FREEBSD; break; case ELFOSABI_NETBSD: - osabi = GDB_OSABI_NETBSD_ELF; + osabi = GDB_OSABI_NETBSD; break; case ELFOSABI_SOLARIS: osabi = GDB_OSABI_SOLARIS; break; - case ELFOSABI_HPUX: - /* For some reason the default value for the EI_OSABI field is - ELFOSABI_HPUX for all PA-RISC targets (with the exception of - GNU/Linux). We use HP-UX ELF as the default, but let any - OS-specific notes override this. */ - osabi = GDB_OSABI_HPUX_ELF; - bfd_map_over_sections (abfd, - generic_elf_osabi_sniff_abi_tag_sections, - &osabi); - break; - case ELFOSABI_OPENVMS: osabi = GDB_OSABI_OPENVMS; break; @@ -595,7 +585,7 @@ generic_elf_osabi_sniffer (bfd *abfd) header to "brand" their ELF binaries in FreeBSD 3.x. */ if (memcmp (&elf_elfheader (abfd)->e_ident[8], "FreeBSD", sizeof ("FreeBSD")) == 0) - osabi = GDB_OSABI_FREEBSD_ELF; + osabi = GDB_OSABI_FREEBSD; } return osabi; diff --git a/gdb/ppc-fbsd-tdep.c b/gdb/ppc-fbsd-tdep.c index 0e5ead6..3d2b578 100644 --- a/gdb/ppc-fbsd-tdep.c +++ b/gdb/ppc-fbsd-tdep.c @@ -343,11 +343,10 @@ void _initialize_ppcfbsd_tdep (void); void _initialize_ppcfbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, GDB_OSABI_FREEBSD_ELF, + gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, GDB_OSABI_FREEBSD, ppcfbsd_init_abi); - gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, - GDB_OSABI_FREEBSD_ELF, + gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, GDB_OSABI_FREEBSD, ppcfbsd_init_abi); - gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_FREEBSD_ELF, + gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_FREEBSD, ppcfbsd_init_abi); } diff --git a/gdb/ppc-nbsd-tdep.c b/gdb/ppc-nbsd-tdep.c index a730ebd..331540d 100644 --- a/gdb/ppc-nbsd-tdep.c +++ b/gdb/ppc-nbsd-tdep.c @@ -195,7 +195,7 @@ void _initialize_ppcnbsd_tdep (void); void _initialize_ppcnbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD, ppcnbsd_init_abi); /* Avoid initializing the register offsets again if they were diff --git a/gdb/ppc-obsd-tdep.c b/gdb/ppc-obsd-tdep.c index f61dd24..efc785f 100644 --- a/gdb/ppc-obsd-tdep.c +++ b/gdb/ppc-obsd-tdep.c @@ -262,33 +262,15 @@ ppcobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) } -/* OpenBSD uses uses the traditional NetBSD core file format, even for - ports that use ELF. */ -#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF - -static enum gdb_osabi -ppcobsd_core_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0) - return GDB_OSABI_NETBSD_CORE; - - return GDB_OSABI_UNKNOWN; -} - - /* Provide a prototype to silence -Wmissing-prototypes. */ void _initialize_ppcobsd_tdep (void); void _initialize_ppcobsd_tdep (void) { - /* BFD doesn't set a flavour for NetBSD style a.out core files. */ - gdbarch_register_osabi_sniffer (bfd_arch_powerpc, bfd_target_unknown_flavour, - ppcobsd_core_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_OPENBSD_ELF, + gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_OPENBSD, ppcobsd_init_abi); - gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_OPENBSD_ELF, + gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_OPENBSD, ppcobsd_init_abi); /* Avoid initializing the register offsets again if they were diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 1c26e1e..8c54276 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -6530,8 +6530,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) switch (info.osabi) { case GDB_OSABI_LINUX: - case GDB_OSABI_NETBSD_AOUT: - case GDB_OSABI_NETBSD_ELF: + case GDB_OSABI_NETBSD: case GDB_OSABI_UNKNOWN: set_gdbarch_unwind_pc (gdbarch, rs6000_unwind_pc); frame_unwind_append_unwinder (gdbarch, &rs6000_epilogue_frame_unwind); diff --git a/gdb/sh-nbsd-tdep.c b/gdb/sh-nbsd-tdep.c index b5c70ef..41fc8a2 100644 --- a/gdb/sh-nbsd-tdep.c +++ b/gdb/sh-nbsd-tdep.c @@ -71,31 +71,14 @@ shnbsd_init_abi (struct gdbarch_info info, } -/* OpenBSD uses uses the traditional NetBSD core file format, even for - ports that use ELF. */ -#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF - -static enum gdb_osabi -shnbsd_core_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0) - return GDB_OSABI_NETBSD_CORE; - - return GDB_OSABI_UNKNOWN; -} - /* Provide a prototype to silence -Wmissing-prototypes. */ extern initialize_file_ftype _initialize_shnbsd_tdep; void _initialize_shnbsd_tdep (void) { - /* BFD doesn't set a flavour for NetBSD style a.out core files. */ - gdbarch_register_osabi_sniffer (bfd_arch_sh, bfd_target_unknown_flavour, - shnbsd_core_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_NETBSD, shnbsd_init_abi); - gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_OPENBSD_ELF, + gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_OPENBSD, shnbsd_init_abi); } diff --git a/gdb/solib.c b/gdb/solib.c index db370e9..c4b2cdc 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1240,29 +1240,7 @@ clear_solib (void) { const struct target_so_ops *ops = solib_ops (target_gdbarch ()); - /* This function is expected to handle ELF shared libraries. It is - also used on Solaris, which can run either ELF or a.out binaries - (for compatibility with SunOS 4), both of which can use shared - libraries. So we don't know whether we have an ELF executable or - an a.out executable until the user chooses an executable file. - - ELF shared libraries don't get mapped into the address space - until after the program starts, so we'd better not try to insert - breakpoints in them immediately. We have to wait until the - dynamic linker has loaded them; we'll hit a bp_shlib_event - breakpoint (look for calls to create_solib_event_breakpoint) when - it's ready. - - SunOS shared libraries seem to be different --- they're present - as soon as the process begins execution, so there's no need to - put off inserting breakpoints. There's also nowhere to put a - bp_shlib_event breakpoint, so if we put it off, we'll never get - around to it. - - So: disable breakpoints only if we're using ELF shared libs. */ - if (exec_bfd != NULL - && bfd_get_flavour (exec_bfd) != bfd_target_aout_flavour) - disable_breakpoints_in_shlibs (); + disable_breakpoints_in_shlibs (); while (so_list_head) { diff --git a/gdb/sparc-nbsd-tdep.c b/gdb/sparc-nbsd-tdep.c index 7fa384d..b1427a3 100644 --- a/gdb/sparc-nbsd-tdep.c +++ b/gdb/sparc-nbsd-tdep.c @@ -290,7 +290,7 @@ static const struct regset sparc32nbsd_fpregset = NULL, sparc32nbsd_supply_fpregset, NULL }; -static void +void sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -309,54 +309,11 @@ sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->step_trap = sparcnbsd_step_trap; frame_unwind_append_unwinder (gdbarch, &sparc32nbsd_sigcontext_frame_unwind); -} - -static void -sparc32nbsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - sparc32nbsd_init_abi (info, gdbarch); -} - -void -sparc32nbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - sparc32nbsd_init_abi (info, gdbarch); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); } -static enum gdb_osabi -sparcnbsd_aout_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "a.out-sparc-netbsd") == 0) - return GDB_OSABI_NETBSD_AOUT; - - return GDB_OSABI_UNKNOWN; -} - -/* OpenBSD uses the traditional NetBSD core file format, even for - ports that use ELF. Therefore, if the default OS ABI is OpenBSD - ELF, we return that instead of NetBSD a.out. This is mainly for - the benfit of OpenBSD/sparc64, which inherits the sniffer below - since we include this file for an OpenBSD/sparc64 target. For - OpenBSD/sparc, the NetBSD a.out OS ABI is probably similar enough - to both the OpenBSD a.out and the OpenBSD ELF OS ABI. */ -#if defined (GDB_OSABI_DEFAULT) && (GDB_OSABI_DEFAULT == GDB_OSABI_OPENBSD_ELF) -#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF -#else -#define GDB_OSABI_NETBSD_CORE GDB_OSABI_NETBSD_AOUT -#endif - -static enum gdb_osabi -sparcnbsd_core_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0) - return GDB_OSABI_NETBSD_CORE; - - return GDB_OSABI_UNKNOWN; -} - /* Provide a prototype to silence -Wmissing-prototypes. */ void _initialize_sparcnbsd_tdep (void); @@ -364,15 +321,6 @@ void _initialize_sparcnbsd_tdep (void); void _initialize_sparcnbsd_tdep (void) { - gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_aout_flavour, - sparcnbsd_aout_osabi_sniffer); - - /* BFD doesn't set a flavour for NetBSD style a.out core files. */ - gdbarch_register_osabi_sniffer (bfd_arch_sparc, 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, - sparc32nbsd_elf_init_abi); + gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD, + sparc32nbsd_init_abi); } diff --git a/gdb/sparc-obsd-tdep.c b/gdb/sparc-obsd-tdep.c index 21c8d6a..cbf11c9 100644 --- a/gdb/sparc-obsd-tdep.c +++ b/gdb/sparc-obsd-tdep.c @@ -235,7 +235,7 @@ static void sparc32obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { /* OpenBSD/sparc is very similar to NetBSD/sparc ELF. */ - sparc32nbsd_elf_init_abi (info, gdbarch); + sparc32nbsd_init_abi (info, gdbarch); set_gdbarch_skip_solib_resolver (gdbarch, obsd_skip_solib_resolver); @@ -253,6 +253,6 @@ void _initialize_sparc32obsd_tdep (void); void _initialize_sparc32obsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_OPENBSD_ELF, + gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_OPENBSD, sparc32obsd_init_abi); } diff --git a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h index 6785e01..704c004 100644 --- a/gdb/sparc-tdep.h +++ b/gdb/sparc-tdep.h @@ -246,8 +246,8 @@ extern const struct sparc_gregmap sparc32nbsd_gregmap; extern CORE_ADDR sparcnbsd_step_trap (struct frame_info *frame, unsigned long insn); -extern void sparc32nbsd_elf_init_abi (struct gdbarch_info info, - struct gdbarch *gdbarch); +extern void sparc32nbsd_init_abi (struct gdbarch_info info, + struct gdbarch *gdbarch); extern struct trad_frame_saved_reg * sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame); diff --git a/gdb/sparc64-fbsd-tdep.c b/gdb/sparc64-fbsd-tdep.c index 27ca52e..7ce2126 100644 --- a/gdb/sparc64-fbsd-tdep.c +++ b/gdb/sparc64-fbsd-tdep.c @@ -248,5 +248,5 @@ void _initialize_sparc64fbsd_tdep (void) { gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9, - GDB_OSABI_FREEBSD_ELF, sparc64fbsd_init_abi); + GDB_OSABI_FREEBSD, sparc64fbsd_init_abi); } diff --git a/gdb/sparc64-nbsd-tdep.c b/gdb/sparc64-nbsd-tdep.c index 1abb721..71d40d5 100644 --- a/gdb/sparc64-nbsd-tdep.c +++ b/gdb/sparc64-nbsd-tdep.c @@ -276,5 +276,5 @@ void _initialize_sparc64nbsd_tdep (void) { gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9, - GDB_OSABI_NETBSD_ELF, sparc64nbsd_init_abi); + GDB_OSABI_NETBSD, sparc64nbsd_init_abi); } diff --git a/gdb/sparc64-obsd-tdep.c b/gdb/sparc64-obsd-tdep.c index a90ae1d..1a92644 100644 --- a/gdb/sparc64-obsd-tdep.c +++ b/gdb/sparc64-obsd-tdep.c @@ -448,5 +448,5 @@ void _initialize_sparc64obsd_tdep (void) { gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9, - GDB_OSABI_OPENBSD_ELF, sparc64obsd_init_abi); + GDB_OSABI_OPENBSD, sparc64obsd_init_abi); } diff --git a/gdb/stabsread.c b/gdb/stabsread.c index d72db14..47e489f 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -18,10 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Support routines for reading and decoding debugging information in - the "stabs" format. This format is used with many systems that use - the a.out object file format, as well as some systems that use - COFF or ELF where the stabs data is placed in a special section. - Avoid placing any object file format specific code in this file. */ + the "stabs" format. This format is used by some systems that use + COFF or ELF where the stabs data is placed in a special section (as + well as with many old systems that used the a.out object file + format). Avoid placing any object file format specific code in + this file. */ #include "defs.h" #include "bfd.h" diff --git a/gdb/symmisc.c b/gdb/symmisc.c index bba8a71..ba6883d 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -139,7 +139,7 @@ print_objfile_statistics (void) blockvectors); if (OBJSTAT (objfile, sz_strtab) > 0) - printf_filtered (_(" Space used by a.out string tables: %d\n"), + printf_filtered (_(" Space used by string tables: %d\n"), OBJSTAT (objfile, sz_strtab)); printf_filtered (_(" Total memory used for objfile obstack: %s\n"), pulongest (obstack_memory_used (&objfile diff --git a/gdb/vax-nbsd-tdep.c b/gdb/vax-nbsd-tdep.c index 1302dcd..f6c8208 100644 --- a/gdb/vax-nbsd-tdep.c +++ b/gdb/vax-nbsd-tdep.c @@ -41,6 +41,6 @@ void _initialize_vaxnbsd_tdep (void); void _initialize_vaxnbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_vax, 0, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_vax, 0, GDB_OSABI_NETBSD, vaxnbsd_elf_init_abi); } diff --git a/gdb/vax-obsd-tdep.c b/gdb/vax-obsd-tdep.c deleted file mode 100644 index ee48ac6..0000000 --- a/gdb/vax-obsd-tdep.c +++ /dev/null @@ -1,178 +0,0 @@ -/* Target-dependent code for OpenBSD/vax. - - Copyright (C) 2005-2016 Free Software Foundation, 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 3 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, see <http://www.gnu.org/licenses/>. */ - -#include "defs.h" -#include "arch-utils.h" -#include "frame.h" -#include "frame-unwind.h" -#include "osabi.h" -#include "symtab.h" -#include "trad-frame.h" - -#include "vax-tdep.h" - -/* Signal trampolines. */ - -/* Since OpenBSD 3.2, the sigtramp routine is mapped at a random page - in virtual memory. The randomness makes it somewhat tricky to - detect it, but fortunately we can rely on the fact that the start - of the sigtramp routine is page-aligned. We recognize the - trampoline by looking for the code that invokes the sigreturn - system call. The offset where we can find that code varies from - release to release. - - By the way, the mapping mentioned above is read-only, so you cannot - place a breakpoint in the signal trampoline. */ - -/* Default page size. */ -static const int vaxobsd_page_size = 4096; - -/* Offset for sigreturn(2). */ -static const int vaxobsd_sigreturn_offset = 0x11; - -/* Instruction sequence for sigreturn(2). VAX doesn't have - fixed-length instructions so we include the ensuing exit(2) to - reduce the chance of spurious matches. */ -static const gdb_byte vaxobsd_sigreturn[] = { - 0xbc, 0x8f, 0x67, 0x00, /* chmk $SYS_sigreturn */ - 0xbc, 0x01 /* chmk $SYS_exit */ -}; - -static int -vaxobsd_sigtramp_sniffer (const struct frame_unwind *self, - struct frame_info *this_frame, - void **this_cache) -{ - CORE_ADDR pc = get_frame_pc (this_frame); - CORE_ADDR start_pc = (pc & ~(vaxobsd_page_size - 1)); - CORE_ADDR sigreturn_addr = start_pc + vaxobsd_sigreturn_offset; - gdb_byte *buf; - const char *name; - - find_pc_partial_function (pc, &name, NULL, NULL); - if (name) - return 0; - - buf = (gdb_byte *) alloca (sizeof vaxobsd_sigreturn); - if (!safe_frame_unwind_memory (this_frame, sigreturn_addr, - buf, sizeof vaxobsd_sigreturn)) - return 0; - - if (memcmp(buf, vaxobsd_sigreturn, sizeof vaxobsd_sigreturn) == 0) - return 1; - - return 0; -} - -static struct trad_frame_cache * -vaxobsd_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache) -{ - struct trad_frame_cache *cache; - CORE_ADDR addr, base, func; - - if (*this_cache) - return (struct trad_frame_cache *) *this_cache; - - cache = trad_frame_cache_zalloc (this_frame); - *this_cache = cache; - - func = get_frame_pc (this_frame); - func &= ~(vaxobsd_page_size - 1); - - base = get_frame_register_unsigned (this_frame, VAX_SP_REGNUM); - addr = get_frame_memory_unsigned (this_frame, base - 4, 4); - - trad_frame_set_reg_addr (cache, VAX_SP_REGNUM, addr + 8); - trad_frame_set_reg_addr (cache, VAX_FP_REGNUM, addr + 12); - trad_frame_set_reg_addr (cache, VAX_AP_REGNUM, addr + 16); - trad_frame_set_reg_addr (cache, VAX_PC_REGNUM, addr + 20); - trad_frame_set_reg_addr (cache, VAX_PS_REGNUM, addr + 24); - - /* Construct the frame ID using the function start. */ - trad_frame_set_id (cache, frame_id_build (base, func)); - - return cache; -} - -static void -vaxobsd_sigtramp_frame_this_id (struct frame_info *this_frame, - void **this_cache, struct frame_id *this_id) -{ - struct trad_frame_cache *cache = - vaxobsd_sigtramp_frame_cache (this_frame, this_cache); - - trad_frame_get_id (cache, this_id); -} - -static struct value * -vaxobsd_sigtramp_frame_prev_register (struct frame_info *this_frame, - void **this_cache, int regnum) -{ - struct trad_frame_cache *cache = - vaxobsd_sigtramp_frame_cache (this_frame, this_cache); - - return trad_frame_get_register (cache, this_frame, regnum); -} - -static const struct frame_unwind vaxobsd_sigtramp_frame_unwind = { - SIGTRAMP_FRAME, - default_frame_unwind_stop_reason, - vaxobsd_sigtramp_frame_this_id, - vaxobsd_sigtramp_frame_prev_register, - NULL, - vaxobsd_sigtramp_sniffer -}; - - -/* OpenBSD a.out. */ - -static void -vaxobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - frame_unwind_append_unwinder (gdbarch, &vaxobsd_sigtramp_frame_unwind); -} - -/* FIXME: kettenis/20050821: Since OpenBSD/vax binaries are - indistingushable from NetBSD/vax a.out binaries, building a GDB - that should support both these targets will probably not work as - expected. */ -#define GDB_OSABI_OPENBSD_AOUT GDB_OSABI_NETBSD_AOUT - -static enum gdb_osabi -vaxobsd_aout_osabi_sniffer (bfd *abfd) -{ - if (strcmp (bfd_get_target (abfd), "a.out-vax-netbsd") == 0) - return GDB_OSABI_OPENBSD_AOUT; - - return GDB_OSABI_UNKNOWN; -} - - -/* Provide a prototype to silence -Wmissing-prototypes. */ -void _initialize_vaxobsd_tdep (void); - -void -_initialize_vaxobsd_tdep (void) -{ - gdbarch_register_osabi_sniffer (bfd_arch_vax, bfd_target_aout_flavour, - vaxobsd_aout_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_vax, 0, GDB_OSABI_OPENBSD_AOUT, - vaxobsd_init_abi); -} |