aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-06-07 18:08:25 +0000
committerAndrew Cagney <cagney@redhat.com>2003-06-07 18:08:25 +0000
commitbd1ce8ba9bdc886115d11aa491e108c578345985 (patch)
tree667b37aa166f5ca58e2143386d085574377444ea /gdb/regcache.c
parentec5cbaecff9fe229c30b15490b9b7e6839a398c5 (diff)
downloadgdb-bd1ce8ba9bdc886115d11aa491e108c578345985.zip
gdb-bd1ce8ba9bdc886115d11aa491e108c578345985.tar.gz
gdb-bd1ce8ba9bdc886115d11aa491e108c578345985.tar.bz2
2003-06-07 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (TARGET_READ_SP): Add predicate, delete default. * gdbarch.h, gdbarch.c: Regenerate. * mn10300-tdep.c: Include "gdb_assert.h". (mn10300_read_fp): New function. (mn10300_gdbarch_init): Set deprecated_target_read_fp to mn10300_read_fp. Do not set read_sp to generic_target_read_sp. * ia64-tdep.c: Include "gdb_assert.h". (ia64_read_fp): New function. (ia64_gdbarch_init): Set deprecated_target_read_fp to ia64_read_sp. Do not set read_sp to generic_target_read_sp. * regcache.c (generic_target_read_sp): Delete function. (read_sp): Try TARGET_READ_SP and SP_REGNUM for the SP register. * inferior.h (generic_target_read_sp): Delete declaration. * frv-tdep.c (frv_gdbarch_init): Do not set read_sp to generic_target_read_sp. * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. * sparc-tdep.c (sparc_gdbarch_init): Ditto * sh-tdep.c (sh_gdbarch_init): Ditto. * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. * Makefile.in (mn10300-tdep.o, ia64-tdep.o): Update dependencies.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 6493fbb..2d3c987 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1273,9 +1273,6 @@ regcache_collect (int regnum, void *buf)
they will use the contextual information provided by the FRAME.
These functions do not belong in the register cache. */
-/* NOTE: cagney/2003-06-07: The function generic_target_read_sp()
- should be deleted. */
-
/* NOTE: cagney/2003-06-07: The function generic_target_write_sp()
should be deleted. */
@@ -1353,20 +1350,14 @@ write_pc (CORE_ADDR pc)
/* Cope with strage ways of getting to the stack and frame pointers */
CORE_ADDR
-generic_target_read_sp (void)
-{
-#ifdef SP_REGNUM
- if (SP_REGNUM >= 0)
- return read_register (SP_REGNUM);
-#endif
- internal_error (__FILE__, __LINE__,
- "generic_target_read_sp");
-}
-
-CORE_ADDR
read_sp (void)
{
- return TARGET_READ_SP ();
+ if (TARGET_READ_SP_P ())
+ return TARGET_READ_SP ();
+ /* Else return SP from get_current_frame. */
+ else if (SP_REGNUM >= 0)
+ return read_register (SP_REGNUM);
+ internal_error (__FILE__, __LINE__, "read_sp: Unable to find SP");
}
void