From d1973055b8847315e5783ae04ab701b632fd3a8b Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Thu, 5 Dec 2002 05:17:39 +0000 Subject: [PATCH] Create new file mips-tdep.h. --- gdb/ChangeLog | 9 +++++++++ gdb/Makefile.in | 5 +++-- gdb/mips-tdep.c | 21 ++++++++------------- gdb/mips-tdep.h | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 gdb/mips-tdep.h diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c42df9d9df..eb84f69f86 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2002-12-04 Kevin Buettner + + * 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. + 2002-12-04 David Carlton * Makefile.in (f-exp.tab.c): Don't depend on c-exp.tab.c. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 15b3211506..7560fbf792 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -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) $(inferior_h) $(gdbcore_h) $(regcache_h) 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) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 7a13a22eb7..c29c7a0a52 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -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; @@ -162,6 +150,13 @@ 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) { diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h new file mode 100644 index 0000000000..92202e2d7b --- /dev/null +++ b/gdb/mips-tdep.h @@ -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 */