From d721549e7f96a07ce5accd4a233b18a300172db7 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 5 Nov 2002 21:44:05 +0000 Subject: 2002-11-05 Andrew Cagney * 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. --- gdb/gdbarch.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'gdb/gdbarch.h') diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 3add874d337..a2fa46532c8 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); -- cgit v1.2.1