From 8f87102502242e23f901af040c8eb904de162f87 Mon Sep 17 00:00:00 2001
From: Andrew Cagney <cagney@redhat.com>
Date: Mon, 13 Jan 2003 21:10:30 +0000
Subject: 2003-01-13  Andrew Cagney  <ac131313@redhat.com>

	* gdbarch.sh (FRAME_INIT_SAVED_REGS): Change to function with
	predicate.
	* gdbarch.h, gdbarch.c: Regenerate.
	* stack.c (frame_info): Only initialize the saved registers when
	FRAME_INIT_SAVED_REGS_P.
	* frame.c (frame_saved_regs_register_unwind): Assert
	FRAME_INIT_SAVED_REGS_P.
	(deprecated_generic_get_saved_register): Ditto.
---
 gdb/gdbarch.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

(limited to 'gdb/gdbarch.c')

diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 9519bb3..069e566 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -739,9 +739,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of extract_struct_value_address, has predicate */
   /* Skip verify of deprecated_extract_struct_value_address, has predicate */
   /* Skip verify of use_struct_convention, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
-      && (gdbarch->frame_init_saved_regs == 0))
-    fprintf_unfiltered (log, "\n\tframe_init_saved_regs");
+  /* Skip verify of frame_init_saved_regs, has predicate */
   /* Skip verify of init_extra_frame_info, has predicate */
   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->skip_prologue == 0))
@@ -1464,6 +1462,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->frame_chain_valid
                         /*FRAME_CHAIN_VALID ()*/);
 #endif
+#ifdef FRAME_INIT_SAVED_REGS_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "FRAME_INIT_SAVED_REGS_P()",
+                      XSTRING (FRAME_INIT_SAVED_REGS_P ()));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: FRAME_INIT_SAVED_REGS_P() = %d\n",
+                      FRAME_INIT_SAVED_REGS_P ());
+#endif
 #ifdef FRAME_INIT_SAVED_REGS
 #if GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
@@ -4356,6 +4363,13 @@ set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
   gdbarch->use_struct_convention = use_struct_convention;
 }
 
+int
+gdbarch_frame_init_saved_regs_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->frame_init_saved_regs != 0;
+}
+
 void
 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
 {
-- 
cgit v1.1