aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
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/gdbarch.h
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/gdbarch.h')
-rw-r--r--gdb/gdbarch.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index db40c66..092f487 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -371,9 +371,29 @@ extern void set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, gdba
#define DEPRECATED_TARGET_READ_FP() (gdbarch_deprecated_target_read_fp (current_gdbarch))
#endif
+#if defined (TARGET_READ_SP)
+/* Legacy for systems yet to multi-arch TARGET_READ_SP */
+#if !defined (TARGET_READ_SP_P)
+#define TARGET_READ_SP_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP_P)
+#define TARGET_READ_SP_P() (0)
+#endif
+
+extern int gdbarch_read_sp_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP_P)
+#error "Non multi-arch definition of TARGET_READ_SP"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP_P)
+#define TARGET_READ_SP_P() (gdbarch_read_sp_p (current_gdbarch))
+#endif
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
-#define TARGET_READ_SP() (generic_target_read_sp ())
+#define TARGET_READ_SP() (internal_error (__FILE__, __LINE__, "TARGET_READ_SP"), 0)
#endif
typedef CORE_ADDR (gdbarch_read_sp_ftype) (void);