diff options
author | Daniel Jacobowitz <drow@false.org> | 2003-01-04 23:38:46 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2003-01-04 23:38:46 +0000 |
commit | 4be87837a23001df36ca5a4171eb01dec22856e1 (patch) | |
tree | 74f1de6f45a23352eaf4015335241dce25043582 /gdb/vax-tdep.c | |
parent | a881cf8e6bbb50470b7286758de18ea3dc3e5b82 (diff) | |
download | gdb-4be87837a23001df36ca5a4171eb01dec22856e1.zip gdb-4be87837a23001df36ca5a4171eb01dec22856e1.tar.gz gdb-4be87837a23001df36ca5a4171eb01dec22856e1.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/vax-tdep.c')
-rw-r--r-- | gdb/vax-tdep.c | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index c467e13..1d1b83a 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -1,5 +1,5 @@ /* Print VAX instructions for GDB, the GNU debugger. - Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000, 2002 + Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -29,6 +29,7 @@ #include "value.h" #include "arch-utils.h" #include "gdb_string.h" +#include "osabi.h" #include "vax-tdep.h" @@ -609,35 +610,19 @@ print_insn_arg (char *d, register char *p, CORE_ADDR addr, static struct gdbarch * vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { - struct gdbarch_tdep *tdep; struct gdbarch *gdbarch; - enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; - /* Try to determine the ABI of the object we are loading. */ + /* If there is already a candidate, use it. */ + arches = gdbarch_list_lookup_by_info (arches, &info); + if (arches != NULL) + return arches->gdbarch; - if (info.abfd != NULL) - osabi = gdbarch_lookup_osabi (info.abfd); - - /* Find a candidate among extant 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; - } - - tdep = xmalloc (sizeof (struct gdbarch_tdep)); - gdbarch = gdbarch_alloc (&info, tdep); + gdbarch = gdbarch_alloc (&info, NULL); /* NOTE: cagney/2002-12-06: This can be deleted when this arch is 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; - /* Register info */ set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS); set_gdbarch_sp_regnum (gdbarch, VAX_SP_REGNUM); @@ -707,27 +692,15 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_believe_pcc_promotion (gdbarch, 1); /* Hook in ABI-specific overrides, if they have been registered. */ - gdbarch_init_osabi (info, gdbarch, osabi); + gdbarch_init_osabi (info, gdbarch); return (gdbarch); } -static void -vax_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - - if (tdep == NULL) - return; - - fprintf_unfiltered (file, "vax_dump_tdep: OS ABI = %s\n", - gdbarch_osabi_name (tdep->osabi)); -} - void _initialize_vax_tdep (void) { - gdbarch_register (bfd_arch_vax, vax_gdbarch_init, vax_dump_tdep); + gdbarch_register (bfd_arch_vax, vax_gdbarch_init, NULL); tm_print_insn = vax_print_insn; } |