From bd1ce8ba9bdc886115d11aa491e108c578345985 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sat, 7 Jun 2003 18:08:25 +0000 Subject: 2003-06-07 Andrew Cagney * 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. --- gdb/gdbarch.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'gdb/gdbarch.c') diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 8f5c48f..eeea625 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -502,7 +502,6 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address; current_gdbarch->char_signed = -1; current_gdbarch->write_pc = generic_target_write_pc; - current_gdbarch->read_sp = generic_target_read_sp; current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; current_gdbarch->num_regs = -1; current_gdbarch->sp_regnum = -1; @@ -622,7 +621,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of read_pc, has predicate */ /* Skip verify of write_pc, invalid_p == 0 */ /* Skip verify of deprecated_target_read_fp, has predicate */ - /* Skip verify of read_sp, invalid_p == 0 */ + /* Skip verify of read_sp, has predicate */ /* Skip verify of deprecated_dummy_write_sp, has predicate */ /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ /* Skip verify of pseudo_register_read, has predicate */ @@ -2565,6 +2564,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->read_pc /*TARGET_READ_PC ()*/); #endif +#ifdef TARGET_READ_SP_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "TARGET_READ_SP_P()", + XSTRING (TARGET_READ_SP_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: TARGET_READ_SP_P() = %d\n", + TARGET_READ_SP_P ()); +#endif #ifdef TARGET_READ_SP fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2955,6 +2963,13 @@ set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, gdbarch->deprecated_target_read_fp = deprecated_target_read_fp; } +int +gdbarch_read_sp_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->read_sp != 0; +} + CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch) { -- cgit v1.1