2002-12-06 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Fri, 6 Dec 2002 19:26:06 +0000 (19:26 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 6 Dec 2002 19:26:06 +0000 (19:26 +0000)
* gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Rename
INIT_FRAME_PC_FIRST.  Change to a function with predicate.  Do not
provide a default value.
* gdbarch.h, gdbarch.c: Regenerate.
* frame.c (get_prev_frame): Update.  Check
DEPRECATED_INIT_FRAME_PC_FIRST_P.
* s390-tdep.c (s390_gdbarch_init): Update.
* mips-tdep.c (mips_gdbarch_init): Update.
* config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update.
* config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update.
* alpha-tdep.c (alpha_gdbarch_init): Update.

gdb/ChangeLog
gdb/alpha-tdep.c
gdb/config/rs6000/tm-rs6000.h
gdb/config/sparc/tm-sparc.h
gdb/frame.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/mips-tdep.c
gdb/s390-tdep.c

index cf2237c..efd95fa 100644 (file)
@@ -1,3 +1,17 @@
+2002-12-06  Andrew Cagney  <ac131313@redhat.com>
+
+       * gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Rename
+       INIT_FRAME_PC_FIRST.  Change to a function with predicate.  Do not
+       provide a default value.
+       * gdbarch.h, gdbarch.c: Regenerate.
+       * frame.c (get_prev_frame): Update.  Check
+       DEPRECATED_INIT_FRAME_PC_FIRST_P.
+       * s390-tdep.c (s390_gdbarch_init): Update.
+       * mips-tdep.c (mips_gdbarch_init): Update.
+       * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update.
+       * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update.
+       * alpha-tdep.c (alpha_gdbarch_init): Update.
+       
 2002-12-06  Elena Zannoni  <ezannoni@redhat.com>
 
        * ia64-linux-nat.c: Include gdb_string.h.
index 1f38f68..6d998c4 100644 (file)
@@ -73,7 +73,6 @@ static gdbarch_push_arguments_ftype alpha_push_arguments;
 static gdbarch_push_dummy_frame_ftype alpha_push_dummy_frame;
 static gdbarch_pop_frame_ftype alpha_pop_frame;
 static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy;
-static gdbarch_init_frame_pc_first_ftype alpha_init_frame_pc_first;
 static gdbarch_init_extra_frame_info_ftype alpha_init_extra_frame_info;
 
 static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target;
@@ -1896,7 +1895,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_push_dummy_frame (gdbarch, alpha_push_dummy_frame);
   set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy);
   set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop);
-  set_gdbarch_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first);
+  set_gdbarch_deprecated_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first);
 
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
index 478e9bd..30f8486 100644 (file)
@@ -78,7 +78,7 @@ extern void aix_process_linenos (void);
 
 /* Define other aspects of the stack frame.  */
 
-#define INIT_FRAME_PC_FIRST(fromleaf, prev) \
+#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) \
   prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
              prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
 #define INIT_FRAME_PC(fromleaf, prev)  /* nothing */
index 7cced22..ce94d94 100644 (file)
@@ -520,7 +520,7 @@ extern void sparc_print_extra_frame_info (struct frame_info *);
 /* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames.  */
 
 #define        INIT_FRAME_PC(FROMLEAF, PREV)   /* nothing */
-#define INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \
+#define DEPRECATED_INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \
   (PREV)->pc = ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \
              (PREV)->next ? FRAME_SAVED_PC ((PREV)->next) : read_pc ());
 
index b4e2cfd..4e31c93 100644 (file)
@@ -986,8 +986,9 @@ get_prev_frame (struct frame_info *next_frame)
      to require INIT_EXTRA_FRAME_INFO before they can do
      INIT_FRAME_PC.  Phoo.
 
-     We shouldn't need INIT_FRAME_PC_FIRST to add more complication to
-     an already overcomplicated part of GDB.  gnu@cygnus.com, 15Sep92.
+     We shouldn't need DEPRECATED_INIT_FRAME_PC_FIRST to add more
+     complication to an already overcomplicated part of GDB.
+     gnu@cygnus.com, 15Sep92.
 
      Assuming that some machines need INIT_FRAME_PC after
      INIT_EXTRA_FRAME_INFO, one possible scheme:
@@ -1040,7 +1041,8 @@ get_prev_frame (struct frame_info *next_frame)
      FRAME_SAVED_PC() is being superseed by frame_pc_unwind() and that
      function does have somewhere to cache that PC value.  */
 
-  INIT_FRAME_PC_FIRST (fromleaf, prev);
+  if (DEPRECATED_INIT_FRAME_PC_FIRST_P ())
+    DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev);
 
   if (INIT_EXTRA_FRAME_INFO_P ())
     INIT_EXTRA_FRAME_INFO (fromleaf, prev);
index 922ba57..ef56820 100644 (file)
@@ -195,7 +195,7 @@ struct gdbarch
   int call_dummy_stack_adjust_p;
   int call_dummy_stack_adjust;
   gdbarch_fix_call_dummy_ftype *fix_call_dummy;
-  gdbarch_init_frame_pc_first_ftype *init_frame_pc_first;
+  gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first;
   gdbarch_init_frame_pc_ftype *init_frame_pc;
   int believe_pcc_promotion;
   int believe_pcc_promotion_type;
@@ -533,7 +533,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->call_dummy_words = legacy_call_dummy_words;
   current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
   current_gdbarch->call_dummy_stack_adjust_p = -1;
-  current_gdbarch->init_frame_pc_first = init_frame_pc_noop;
   current_gdbarch->init_frame_pc = init_frame_pc_default;
   current_gdbarch->coerce_float_to_double = default_coerce_float_to_double;
   current_gdbarch->register_convertible = generic_register_convertible_not;
@@ -712,7 +711,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->fix_call_dummy == 0))
     fprintf_unfiltered (log, "\n\tfix_call_dummy");
-  /* Skip verify of init_frame_pc_first, invalid_p == 0 */
+  /* Skip verify of deprecated_init_frame_pc_first, has predicate */
   /* Skip verify of init_frame_pc, invalid_p == 0 */
   /* Skip verify of coerce_float_to_double, invalid_p == 0 */
   /* Skip verify of get_saved_register, has predicate */
@@ -1193,6 +1192,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->deprecated_extract_struct_value_address
                         /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
 #endif
+#ifdef DEPRECATED_INIT_FRAME_PC_FIRST_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_INIT_FRAME_PC_FIRST_P()",
+                      XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST_P ()));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST_P() = %d\n",
+                      DEPRECATED_INIT_FRAME_PC_FIRST_P ());
+#endif
+#ifdef DEPRECATED_INIT_FRAME_PC_FIRST
+#if GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)",
+                      XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)));
+#endif
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = 0x%08lx\n",
+                        (long) current_gdbarch->deprecated_init_frame_pc_first
+                        /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/);
+#endif
 #ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -1572,20 +1594,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->init_frame_pc
                         /*INIT_FRAME_PC ()*/);
 #endif
-#ifdef INIT_FRAME_PC_FIRST
-#if GDB_MULTI_ARCH
-  /* Macro might contain `[{}]' when not multi-arch */
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "INIT_FRAME_PC_FIRST(fromleaf, prev)",
-                      XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
-#endif
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
-                        (long) current_gdbarch->init_frame_pc_first
-                        /*INIT_FRAME_PC_FIRST ()*/);
-#endif
 #ifdef INNER_THAN
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -3776,23 +3784,30 @@ set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
   gdbarch->fix_call_dummy = fix_call_dummy;
 }
 
+int
+gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->deprecated_init_frame_pc_first != 0;
+}
+
 void
-gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
+gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
 {
   gdb_assert (gdbarch != NULL);
-  if (gdbarch->init_frame_pc_first == 0)
+  if (gdbarch->deprecated_init_frame_pc_first == 0)
     internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_init_frame_pc_first invalid");
+                    "gdbarch: gdbarch_deprecated_init_frame_pc_first invalid");
   if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n");
-  gdbarch->init_frame_pc_first (fromleaf, prev);
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n");
+  gdbarch->deprecated_init_frame_pc_first (fromleaf, prev);
 }
 
 void
-set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
-                                 gdbarch_init_frame_pc_first_ftype init_frame_pc_first)
+set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch,
+                                            gdbarch_deprecated_init_frame_pc_first_ftype deprecated_init_frame_pc_first)
 {
-  gdbarch->init_frame_pc_first = init_frame_pc_first;
+  gdbarch->deprecated_init_frame_pc_first = deprecated_init_frame_pc_first;
 }
 
 void
index f472e57..c72897d 100644 (file)
@@ -1178,20 +1178,40 @@ extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_cal
 #endif
 #endif
 
+#if defined (DEPRECATED_INIT_FRAME_PC_FIRST)
+/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */
+#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
+#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
+#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (0)
+#endif
+
+extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
+#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
+#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch))
+#endif
+
 /* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST)
-#define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST)
+#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0)
 #endif
 
-typedef void (gdbarch_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
-extern void gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
-extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_init_frame_pc_first_ftype *init_frame_pc_first);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST)
-#error "Non multi-arch definition of INIT_FRAME_PC_FIRST"
+typedef void (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
+extern void gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
+extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST)
+#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
 #endif
 #if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST)
-#define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST)
+#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_deprecated_init_frame_pc_first (current_gdbarch, fromleaf, prev))
 #endif
 #endif
 
index f197211..db07119 100755 (executable)
@@ -513,7 +513,7 @@ v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_
 v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx
 v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P
 f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0
-f:2:INIT_FRAME_PC_FIRST:void:init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_noop::0
+F::DEPRECATED_INIT_FRAME_PC_FIRST:void:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
 f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_default::0
 #
 v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
index c29c7a0..65216bd 100644 (file)
@@ -5964,8 +5964,8 @@ mips_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_addr_bits_remove (gdbarch, mips_addr_bits_remove);
 
   /* There's a mess in stack frame creation.  See comments in
-     blockframe.c near reference to INIT_FRAME_PC_FIRST.  */
-  set_gdbarch_init_frame_pc_first (gdbarch, mips_init_frame_pc_first);
+     blockframe.c near reference to DEPRECATED_INIT_FRAME_PC_FIRST.  */
+  set_gdbarch_deprecated_init_frame_pc_first (gdbarch, mips_init_frame_pc_first);
   set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop);
 
   /* Map debug register numbers onto internal register numbers.  */
index 622f285..a558400 100644 (file)
@@ -1790,7 +1790,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_breakpoint_from_pc (gdbarch, s390_breakpoint_from_pc);
   set_gdbarch_skip_prologue (gdbarch, s390_skip_prologue);
   set_gdbarch_init_extra_frame_info (gdbarch, s390_init_extra_frame_info);
-  set_gdbarch_init_frame_pc_first (gdbarch, s390_init_frame_pc_first);
+  set_gdbarch_deprecated_init_frame_pc_first (gdbarch, s390_init_frame_pc_first);
   set_gdbarch_read_fp (gdbarch, s390_read_fp);
   /* This function that tells us whether the function invocation represented
      by FI does not have a frame on the stack associated with it.  If it