From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5080 invoked by alias); 5 Dec 2002 05:21:12 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5073 invoked from network); 5 Dec 2002 05:21:12 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 5 Dec 2002 05:21:12 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gB54u5P06701 for ; Wed, 4 Dec 2002 23:56:05 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gB55LAD13424; Thu, 5 Dec 2002 00:21:10 -0500 Received: from localhost.localdomain (vpn50-49.rdu.redhat.com [172.16.50.49]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gB55L9910922; Thu, 5 Dec 2002 00:21:09 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id gB55L4q29813; Wed, 4 Dec 2002 22:21:04 -0700 Date: Wed, 04 Dec 2002 21:21:00 -0000 From: Kevin Buettner Message-Id: <1021205052104.ZM29812@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: [PATCH RFA] Create new file mips-tdep.h" (Nov 4, 9:11pm) References: <1021004010349.ZM32674@localhost.localdomain> <3DC728EF.1040700@redhat.com> To: Andrew Cagney Subject: Re: [PATCH RFA] Create new file mips-tdep.h Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-12/txt/msg00134.txt.bz2 On Nov 4, 9:11pm, Andrew Cagney wrote: > > I have some other changes under way in which I will need to know which > > mips ABI is in use. I've moved struct gdbarch_tdep and the enums > > that it depends upon into a new header file. > > > > Okay? > > > > * Makefile.in (mips_tdep_h): Define. > > (mips-tdep.o): Remove osabi_h from dependency list. Add mips_tdep_h > > to dependency list. > > * mips-tdep.h: New file. > > * mips-tdep.c (mips-tdep.h): Include. > > (osabi.h): Don't include (since it's included by mips-tdep.h). > > (enum mips_abi, enum_mips_fpu_type, struct gdbarch_tdep): Move > > definitions to mips-tdep.h. > > Rather than publishing `struct gdbarch_tdep', can you instead just > publish accessor methods for the parts you need? Otherwize ok. Okay, I've just committed the patch below. I have some WIP patches to mips-linux-tdep.c which use mips_abi(). * Makefile.in (mips_tdep_h): Define. (mips-tdep.o): Add mips_tdep_h to dependency list. * mips-tdep.h: New file. * mips-tdep.c (mips-tdep.h): Include. (enum mips_abi): Move to mips-tdep.h. (mips_abi): New function. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.289 diff -u -p -r1.289 Makefile.in --- Makefile.in 4 Dec 2002 23:00:14 -0000 1.289 +++ Makefile.in 5 Dec 2002 05:13:17 -0000 @@ -685,6 +685,7 @@ macrotab_h = macrotab.h main_h = main.h memattr_h = memattr.h minimon_h = minimon.h +mips_tdep_h = mips-tdep.h mipsnbsd_tdep_h = mipsnbsd-tdep.h monitor_h = monitor.h nbsd_tdep_h = nbsd-tdep.h @@ -1940,8 +1941,8 @@ mips-nat.o: mips-nat.c $(defs_h) $(infer mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(value_h) $(gdbcmd_h) $(language_h) $(gdbcore_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(target_h) $(arch_utils_h) \ - $(regcache_h) $(osabi_h) $(opcode_mips_h) $(elf_mips_h) $(elf_bfd_h) \ - $(symcat_h) + $(regcache_h) $(osabi_h) $(mips_tdep_h) $(opcode_mips_h) \ + $(elf_mips_h) $(elf_bfd_h) $(symcat_h) mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(mipsnbsd_tdep_h) Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.142 diff -u -p -r1.142 mips-tdep.c --- mips-tdep.c 1 Dec 2002 19:07:15 -0000 1.142 +++ mips-tdep.c 5 Dec 2002 05:13:19 -0000 @@ -39,6 +39,7 @@ #include "arch-utils.h" #include "regcache.h" #include "osabi.h" +#include "mips-tdep.h" #include "opcode/mips.h" #include "elf/mips.h" @@ -57,19 +58,6 @@ enum MIPS_FPU_DOUBLE_REGSIZE = 8 }; -/* All the possible MIPS ABIs. */ - -enum mips_abi - { - MIPS_ABI_UNKNOWN = 0, - MIPS_ABI_N32, - MIPS_ABI_O32, - MIPS_ABI_N64, - MIPS_ABI_O64, - MIPS_ABI_EABI32, - MIPS_ABI_EABI64, - MIPS_ABI_LAST - }; static const char *mips_abi_string; @@ -161,6 +149,13 @@ struct gdbarch_tdep static const char *mips_saved_regsize_string = size_auto; #define MIPS_SAVED_REGSIZE (mips_saved_regsize()) + +/* Return the MIPS ABI associated with GDBARCH. */ +enum mips_abi +mips_abi (struct gdbarch *gdbarch) +{ + return gdbarch_tdep (gdbarch)->mips_abi; +} static unsigned int mips_saved_regsize (void) Index: mips-tdep.h =================================================================== RCS file: mips-tdep.h diff -N mips-tdep.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mips-tdep.h 5 Dec 2002 05:13:19 -0000 @@ -0,0 +1,41 @@ +/* Target-dependent header for the MIPS architecture, for GDB, the GNU Debugger. + + Copyright 2002 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef MIPS_TDEP_H +#define MIPS_TDEP_H + +/* All the possible MIPS ABIs. */ +enum mips_abi + { + MIPS_ABI_UNKNOWN = 0, + MIPS_ABI_N32, + MIPS_ABI_O32, + MIPS_ABI_N64, + MIPS_ABI_O64, + MIPS_ABI_EABI32, + MIPS_ABI_EABI64, + MIPS_ABI_LAST + }; + +/* Return the MIPS ABI associated with GDBARCH. */ +enum mips_abi mips_abi (struct gdbarch *gdbarch); + +#endif /* MIPS_TDEP_H */