From 4be87837a23001df36ca5a4171eb01dec22856e1 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Sat, 4 Jan 2003 23:38:46 +0000 Subject: * arch-utils.c (gdbarch_info_init): Set osabi to GDB_OSABI_UNINITIALIZED. * gdbarch.sh: Add osabi to struct gdbarch and to struct gdbarch_info. Include "osabi.h" in gdbarch.c. Check osabi in gdbarch_list_lookup_by_info and in gdbarch_update_p. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * osabi.c (gdbarch_lookup_osabi): Return GDB_OSABI_UNINITIALIZED if there's no BFD. (gdbarch_init_osabi): Remove osabi argument; use info.osabi. * osabi.h (enum gdb_osabi): Move to defs.h. (gdbarch_init_osabi): Update prototype. * defs.h (enum gdb_osabi): Moved here. * Makefile.in: Update dependencies. Plus updates to alpha, arm, hppa, i386, mips, ns32k, ppc, sh, sparc, and vax ports to match. --- gdb/sh-tdep.c | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) (limited to 'gdb/sh-tdep.c') diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 741f3f5..e0088d1 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -39,6 +39,7 @@ #include "floatformat.h" #include "regcache.h" #include "doublest.h" +#include "osabi.h" #include "sh-tdep.h" @@ -4210,26 +4211,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch_register_name_ftype *sh_register_name; gdbarch_deprecated_store_return_value_ftype *sh_store_return_value; gdbarch_register_virtual_type_ftype *sh_register_virtual_type; - enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; - /* Try to determine the ABI of the object we are loading. */ - - if (info.abfd != NULL) - { - osabi = gdbarch_lookup_osabi (info.abfd); - /* If we get "unknown" back, just leave it that way. */ - } - - /* Find a candidate among the list of pre-declared architectures. */ - for (arches = gdbarch_list_lookup_by_info (arches, &info); - arches != NULL; - arches = gdbarch_list_lookup_by_info (arches->next, &info)) - { - /* Make sure the ABI selection matches. */ - tdep = gdbarch_tdep (arches->gdbarch); - if (tdep && tdep->osabi == osabi) - return arches->gdbarch; - } + /* If there is already a candidate, use it. */ + arches = gdbarch_list_lookup_by_info (arches, &info); + if (arches != NULL) + return arches->gdbarch; /* None found, create a new architecture from the information provided. */ @@ -4240,8 +4226,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) ready to unwind the PC first (see frame.c:get_prev_frame()). */ set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); - tdep->osabi = osabi; - /* Initialize the register numbers that are not common to all the variants to -1, if necessary thse will be overwritten in the case statement below. */ @@ -4587,11 +4571,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_believe_pcc_promotion (gdbarch, 1); - /* Hook in ABI-specific overrides, if they have been registered. - - FIXME: if the ABI is unknown, this is probably an embedded target, - so we should not warn about this situation. */ - gdbarch_init_osabi (info, gdbarch, osabi); + /* Hook in ABI-specific overrides, if they have been registered. */ + gdbarch_init_osabi (info, gdbarch); return gdbarch; } @@ -4604,8 +4585,7 @@ sh_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) if (tdep == NULL) return; - fprintf_unfiltered (file, "sh_dump_tdep: OS ABI = %s\n", - gdbarch_osabi_name (tdep->osabi)); + /* FIXME: dump the rest of gdbarch_tdep. */ } void -- cgit v1.1