From a094c6fb43d455f513814088207e30261617d244 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 17 Sep 2002 23:26:02 +0000 Subject: [PATCH] 2002-09-17 Andrew Cagney * NEWS: Mention that MIPS $fp behavior changed. * mipsnbsd-tdep.c (mipsnbsd_cannot_fetch_register): Delete reference to FP_REGNUM. (mipsnbsd_cannot_store_register): Ditto. * mips-linux-nat.c: Update copyright. (mips_linux_cannot_fetch_register): Delete reference to FP_REGNUM. (mips_linux_cannot_store_register): Ditto. * mips-linux-tdep.c (supply_gregset): Ditto. Update copyright. * config/mips/tm-mips.h: Update copyright. (FP_REGNUM): Delete macro. (MIPS_REGISTER_NAMES): Replace "fp" with "". * config/mips/tm-irix6.h (FP_REGNUM): Delete macro. * mips-tdep.c (mips_gdbarch_init): Set read_fp to mips_read_sp. (mips_r3041_reg_names, mips_r3051_reg_names) (mips_r3081_reg_names): Replace "fp" with "". Fix PR gdb/480. --- gdb/ChangeLog | 19 +++++++++++++++++++ gdb/NEWS | 8 ++++++++ gdb/config/mips/tm-irix6.h | 6 ++---- gdb/config/mips/tm-mips.h | 10 +++++----- gdb/mips-linux-nat.c | 11 ++++------- gdb/mips-linux-tdep.c | 4 ++-- gdb/mips-tdep.c | 8 ++++---- gdb/mipsnbsd-tdep.c | 6 ++---- 8 files changed, 46 insertions(+), 26 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7223ea0..50cc991 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,22 @@ +2002-09-17 Andrew Cagney + + * NEWS: Mention that MIPS $fp behavior changed. + * mipsnbsd-tdep.c (mipsnbsd_cannot_fetch_register): Delete + reference to FP_REGNUM. + (mipsnbsd_cannot_store_register): Ditto. + * mips-linux-nat.c: Update copyright. + (mips_linux_cannot_fetch_register): Delete reference to FP_REGNUM. + (mips_linux_cannot_store_register): Ditto. + * mips-linux-tdep.c (supply_gregset): Ditto. Update copyright. + * config/mips/tm-mips.h: Update copyright. + (FP_REGNUM): Delete macro. + (MIPS_REGISTER_NAMES): Replace "fp" with "". + * config/mips/tm-irix6.h (FP_REGNUM): Delete macro. + * mips-tdep.c (mips_gdbarch_init): Set read_fp to mips_read_sp. + (mips_r3041_reg_names, mips_r3051_reg_names) + (mips_r3081_reg_names): Replace "fp" with "". + Fix PR gdb/480. + 2002-09-17 Theodore A. Roth * gdb/avr-tdep.c(avr_scan_prologue): Fix bad call to diff --git a/gdb/NEWS b/gdb/NEWS index e1c1a83..bbd70c4 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,6 +3,14 @@ *** Changes since GDB 5.3: +* MIPS $fp behavior changed + +The convenience variable $fp, for the MIPS, now consistently returns +the address of the current frame's base. Previously, depending on the +context, $fp could refer to either $sp or the current frame's base +address. See ``8.10 Registers'' in the manual ``Debugging with GDB: +The GNU Source-Level Debugger''. + *** Changes in GDB 5.3: * ``gdbserver'' now supports multi-threaded applications on some targets diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h index ac710a4..6a91ebc 100644 --- a/gdb/config/mips/tm-irix6.h +++ b/gdb/config/mips/tm-irix6.h @@ -1,6 +1,6 @@ /* Target machine description for SGI Iris under Irix 6.x, for GDB. - Copyright 2001 - Free Software Foundation, Inc. + + Copyright 2001, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -38,7 +38,6 @@ #undef BADVADDR_REGNUM #undef FCRCS_REGNUM #undef FCRIR_REGNUM -#undef FP_REGNUM /* Number of machine registers */ @@ -74,7 +73,6 @@ #define LO_REGNUM 68 /* ... */ #define FCRCS_REGNUM 69 /* FP control/status */ #define FCRIR_REGNUM 70 /* FP implementation/revision */ -#define FP_REGNUM 30 /* S8 register is the Frame Pointer */ #undef REGISTER_BYTES diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index d87c4a7..ded8e10 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -1,7 +1,8 @@ /* Definitions to make GDB run on a mips box under 4.3bsd. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000 - Free Software Foundation, Inc. + + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. + Contributed by Per Bothner (bothner@cs.wisc.edu) at U.Wisconsin and by Alessandro Forin (af@cs.cmu.edu) at CMU.. @@ -86,7 +87,7 @@ extern int mips_step_skips_delay (CORE_ADDR); "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\ - "fsr", "fir", "fp", "", \ + "fsr", "fir", ""/*"fp"*/, "", \ "", "", "", "", "", "", "", "", \ "", "", "", "", "", "", "", "", \ } @@ -115,7 +116,6 @@ extern int mips_step_skips_delay (CORE_ADDR); #define FPA0_REGNUM (FP0_REGNUM+12) /* First float argument register */ #define FCRCS_REGNUM 70 /* FP control/status */ #define FCRIR_REGNUM 71 /* FP implementation/revision */ -#define FP_REGNUM 72 /* Pseudo register that contains true address of executing stack frame */ #define UNUSED_REGNUM 73 /* Never used, FIXME */ #define FIRST_EMBED_REGNUM 74 /* First CP0 register for embedded use */ #define PRID_REGNUM 89 /* Processor ID */ diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index cec16d3..454520d 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -1,5 +1,6 @@ /* Native-dependent code for GNU/Linux on MIPS processors. - Copyright 2001 Free Software Foundation, Inc. + + Copyright 2001, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -28,9 +29,7 @@ int mips_linux_cannot_fetch_register (int regno) { - if (regno >= FP_REGNUM) - return 1; - else if (regno == PS_REGNUM) + if (regno == PS_REGNUM) return 1; else if (regno == ZERO_REGNUM) return 1; @@ -41,9 +40,7 @@ mips_linux_cannot_fetch_register (int regno) int mips_linux_cannot_store_register (int regno) { - if (regno >= FP_REGNUM) - return 1; - else if (regno == PS_REGNUM) + if (regno == PS_REGNUM) return 1; else if (regno == ZERO_REGNUM) return 1; diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index b8d41db..03279d8 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -1,5 +1,6 @@ /* Target-dependent code for GNU/Linux on MIPS processors. - Copyright 2001 Free Software Foundation, Inc. + + Copyright 2001, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -100,7 +101,6 @@ supply_gregset (elf_gregset_t *gregsetp) supply_register (CAUSE_REGNUM, (char *)(regp + EF_CP0_CAUSE)); /* Fill inaccessible registers with zero. */ - supply_register (FP_REGNUM, zerobuf); supply_register (UNUSED_REGNUM, zerobuf); for (regi = FIRST_EMBED_REGNUM; regi < LAST_EMBED_REGNUM; regi++) supply_register (regi, zerobuf); diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 683faa4..79b189c 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -388,7 +388,7 @@ char *mips_r3041_reg_names[] = { "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", - "fsr", "fir", "fp", "", + "fsr", "fir", "",/*"fp"*/ "", "", "", "bus", "ccfg", "", "", "", "", "", "", "port", "cmp", "", "", "epc", "prid", }; @@ -405,7 +405,7 @@ char *mips_r3051_reg_names[] = { "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", - "fsr", "fir", "fp", "", + "fsr", "fir", ""/*"fp"*/, "", "inx", "rand", "elo", "", "ctxt", "", "", "", "", "", "ehi", "", "", "", "epc", "prid", }; @@ -422,7 +422,7 @@ char *mips_r3081_reg_names[] = { "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", - "fsr", "fir", "fp", "", + "fsr", "fir", ""/*"fp"*/, "", "inx", "rand", "elo", "cfg", "ctxt", "", "", "", "", "", "ehi", "", "", "", "epc", "prid", }; @@ -5923,7 +5923,7 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_register_name (gdbarch, mips_register_name); set_gdbarch_read_pc (gdbarch, mips_read_pc); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); - set_gdbarch_read_fp (gdbarch, generic_target_read_fp); + set_gdbarch_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base. */ set_gdbarch_read_sp (gdbarch, mips_read_sp); set_gdbarch_write_sp (gdbarch, generic_target_write_sp); diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index 3367e36..73ba384 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -258,16 +258,14 @@ mipsnbsd_get_longjmp_target (CORE_ADDR *pc) static int mipsnbsd_cannot_fetch_register (int regno) { - return (regno >= FP_REGNUM - || regno == ZERO_REGNUM + return (regno == ZERO_REGNUM || regno == FCRIR_REGNUM); } static int mipsnbsd_cannot_store_register (int regno) { - return (regno >= FP_REGNUM - || regno == ZERO_REGNUM + return (regno == ZERO_REGNUM || regno == FCRIR_REGNUM); } -- 2.7.4