aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-11-05 21:44:05 +0000
committerAndrew Cagney <cagney@redhat.com>2002-11-05 21:44:05 +0000
commita216a322341d49ebb6eff80fe9a49542b545c7d0 (patch)
treeb6ff99a9842f2118fd12ead71c31c9a421086205 /gdb/gdbarch.h
parentb7c642601c187ba8e89c4084d0880649ede3aea1 (diff)
downloadgdb-a216a322341d49ebb6eff80fe9a49542b545c7d0.zip
gdb-a216a322341d49ebb6eff80fe9a49542b545c7d0.tar.gz
gdb-a216a322341d49ebb6eff80fe9a49542b545c7d0.tar.bz2
2002-11-05 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (GET_SAVED_REGISTER): Change to a predicate function. * gdbarch.h, gdbarch.c: Regnerate. * frame.h (frame_register): Declare. * frame.c (frame_register): New function. (get_saved_register): Test GET_SAVED_REGISTER_P before calling GET_SAVED_REGISTER, otherwize call generic_unwind_get_saved_register. (frame_register_read): Use frame_register instead of get_saved_register.
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 3add874..a2fa465 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1210,9 +1210,29 @@ extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch
#endif
#endif
+#if defined (GET_SAVED_REGISTER)
+/* Legacy for systems yet to multi-arch GET_SAVED_REGISTER */
+#if !defined (GET_SAVED_REGISTER_P)
+#define GET_SAVED_REGISTER_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER_P)
+#define GET_SAVED_REGISTER_P() (0)
+#endif
+
+extern int gdbarch_get_saved_register_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER_P)
+#error "Non multi-arch definition of GET_SAVED_REGISTER"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER_P)
+#define GET_SAVED_REGISTER_P() (gdbarch_get_saved_register_p (current_gdbarch))
+#endif
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER)
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval))
+#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "GET_SAVED_REGISTER"), 0)
#endif
typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);