* arch-utils.c (init_frame_pc_default): New function
authorAndrew Cagney <cagney@redhat.com>
Sat, 16 Jun 2001 20:00:24 +0000 (20:00 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 16 Jun 2001 20:00:24 +0000 (20:00 +0000)
* arch-utils.h (init_frame_pc_default): Declare.
* gdbarch.sh (INIT_FRAME_PC): Default to init_frame_pc_default and
not init_frame_pc_noop.
* gdbarch.h, gdbarch.c: Re-generate.
* blockframe.c (INIT_FRAME_PC): Delete macro definition.
* mips-tdep.c (mips_gdbarch_init): Set init_frame_pc to
init_frame_pc_noop.

gdb/ChangeLog
gdb/arch-utils.c
gdb/arch-utils.h
gdb/blockframe.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/mips-tdep.c

index a5b11f7e77335fc75d16195b85aae5d66217247a..bcd919cbb6b7a875f26422a160831477356a97e0 100644 (file)
@@ -1,3 +1,14 @@
+2001-06-16  Andrew Cagney  <ac131313@redhat.com>
+
+       * arch-utils.c (init_frame_pc_default): New function
+       * arch-utils.h (init_frame_pc_default): Declare.
+       * gdbarch.sh (INIT_FRAME_PC): Default to init_frame_pc_default and
+       not init_frame_pc_noop.
+       * gdbarch.h, gdbarch.c: Re-generate.
+       * blockframe.c (INIT_FRAME_PC): Delete macro definition.
+       * mips-tdep.c (mips_gdbarch_init): Set init_frame_pc to
+       init_frame_pc_noop.
+
 2001-06-16  Andrew Cagney  <ac131313@redhat.com>
 
        * gdbarch.c: Regenerate.  Out-of-sync with gdbarch.sh.
index 24ca70fa2d2f0f51f92a07b44a77bf10f1a255cb..3da3c2713a6ce34dcaeff179d371733f7a58feba 100644 (file)
@@ -306,6 +306,17 @@ init_frame_pc_noop (int fromleaf, struct frame_info *prev)
   return;
 }
 
+void
+init_frame_pc_default (int fromleaf, struct frame_info *prev)
+{
+  if (fromleaf)
+    prev->pc = SAVED_PC_AFTER_CALL (prev->next);
+  else if (prev->next != NULL)
+    prev->pc = FRAME_SAVED_PC (prev->next);
+  else
+    prev->pc = read_pc ();
+}
+
 int
 cannot_register_not (int regnum)
 {
index 9934bbf328545bb5efb87c497abeb7148a9ee115..071b5305ef88b0f316b8e0b99b4204d82cc4f3a4 100644 (file)
@@ -111,10 +111,12 @@ extern int default_prepare_to_proceed (int select_it);
 
 extern int generic_prepare_to_proceed (int select_it);
 
-/* Version of init_frame_pc() that does nothing. */
+/* Versions of init_frame_pc().  Do nothing; do the default. */
 
 void init_frame_pc_noop (int fromleaf, struct frame_info *prev);
 
+void init_frame_pc_default (int fromleaf, struct frame_info *prev);
+
 /* Version of cannot_fetch_register() / cannot_store_register() that
    always fails. */
 
index 68da4fd53d75d6f0b406fb7c5294e17ffaed5d9e..34e1484f749417a4711de6d80f96d3721ddf7ec1 100644 (file)
@@ -304,12 +304,6 @@ frameless_look_for_prologue (struct frame_info *frame)
 
 /* Default a few macros that people seldom redefine.  */
 
-#if !defined (INIT_FRAME_PC)
-#define INIT_FRAME_PC(fromleaf, prev) \
-  prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
-             prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
-#endif
-
 #ifndef FRAME_CHAIN_COMBINE
 #define        FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
 #endif
index fc23d3efec690bff63a849794ee652a54b3e2849..bac36c2948bf0cb05fd163b7b3f731832a4fb97b 100644 (file)
@@ -471,7 +471,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
   gdbarch->call_dummy_stack_adjust_p = -1;
   gdbarch->init_frame_pc_first = init_frame_pc_noop;
-  gdbarch->init_frame_pc = init_frame_pc_noop;
+  gdbarch->init_frame_pc = init_frame_pc_default;
   gdbarch->coerce_float_to_double = default_coerce_float_to_double;
   gdbarch->register_convertible = generic_register_convertible_not;
   gdbarch->pointer_to_address = unsigned_pointer_to_address;
index 586f4e803fefd6c91948538da2e69839deff0514..9f2d0c0b3f56c44313fdd9c63d2b5b30e8dbd309 100644 (file)
@@ -833,7 +833,7 @@ extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_in
 
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC)
-#define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
+#define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev))
 #endif
 
 typedef void (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev);
index 449e7d6e46f32d10ccac3bb5cda805b5d039c422..b2c20f1ad65cb7d4e2b1fcda9ce02061e0882de6 100755 (executable)
@@ -447,7 +447,7 @@ 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:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_noop::0
+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:::::::
 v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
index bb7a6c4d226eb2ae0190481ad1ef061bd60d6e0a..c56d97e474a2bb8d3803848eee2ad017038ff8e8 100644 (file)
@@ -4130,6 +4130,7 @@ mips_gdbarch_init (struct gdbarch_info info,
   /* 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);
+  set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop);
 
   /* Map debug register numbers onto internal register numbers. */
   set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);