2004-03-22 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Mon, 22 Mar 2004 15:36:47 +0000 (15:36 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 22 Mar 2004 15:36:47 +0000 (15:36 +0000)
* frame.h (deprecated_pc_in_call_dummy): Rename
generic_pc_in_call_dummy.
* dummy-frame.h (pc_in_dummy_frame): Delete declaration.
* dummy-frame.c (deprecated_pc_in_call_dummy): Rename
generic_pc_in_call_dummy.
(pc_in_dummy_frame): Make static.
* gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Update.
* gdbarch.h, gdbarch.c: Re-generate.
* dummy-frame.c (dummy_frame_sniffer): Simplify.
* frame.c (frame_type_from_pc): Call deprecated_pc_in_call_dummy.
(legacy_get_prev_frame): Ditto.
* inferior.h: Delete reference to generic_pc_in_call_dummy in
comment.

gdb/ChangeLog
gdb/dummy-frame.c
gdb/dummy-frame.h
gdb/frame.c
gdb/frame.h
gdb/gdbarch.c
gdb/gdbarch.sh
gdb/inferior.h

index 5ea55d8..8062186 100644 (file)
@@ -1,3 +1,19 @@
+2004-03-22  Andrew Cagney  <cagney@redhat.com>
+
+       * frame.h (deprecated_pc_in_call_dummy): Rename
+       generic_pc_in_call_dummy.
+       * dummy-frame.h (pc_in_dummy_frame): Delete declaration.
+       * dummy-frame.c (deprecated_pc_in_call_dummy): Rename
+       generic_pc_in_call_dummy.
+       (pc_in_dummy_frame): Make static.
+       * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Update.
+       * gdbarch.h, gdbarch.c: Re-generate.
+       * dummy-frame.c (dummy_frame_sniffer): Simplify.
+       * frame.c (frame_type_from_pc): Call deprecated_pc_in_call_dummy.
+       (legacy_get_prev_frame): Ditto.
+       * inferior.h: Delete reference to generic_pc_in_call_dummy in
+       comment.
+       
 2004-03-21  Andrew Cagney  <cagney@redhat.com>
 
        * inferior.h (deprecated_pc_in_call_dummy_at_entry_point): Delete
index 3b10c51..66918b6 100644 (file)
@@ -36,6 +36,8 @@ static void dummy_frame_this_id (struct frame_info *next_frame,
                                 void **this_prologue_cache,
                                 struct frame_id *this_id);
 
+static int pc_in_dummy_frame (CORE_ADDR pc);
+
 /* Dummy frame.  This saves the processor state just prior to setting
    up the inferior function call.  Older targets save the registers
    on the target stack (but that really slows down function calls).  */
@@ -137,7 +139,7 @@ deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
    subtracted out.  */
 
 int
-generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
+deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
 {
   return pc_in_dummy_frame (pc);
 }
@@ -155,7 +157,7 @@ generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
    !DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET_P yet generic dummy
    targets set DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. True?).  */
 
-int
+static int
 pc_in_dummy_frame (CORE_ADDR pc)
 {
   struct dummy_frame *dummyframe;
@@ -411,9 +413,8 @@ const struct frame_unwind *
 dummy_frame_sniffer (struct frame_info *next_frame)
 {
   CORE_ADDR pc = frame_pc_unwind (next_frame);
-  if (DEPRECATED_PC_IN_CALL_DUMMY_P ()
-      ? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)
-      : pc_in_dummy_frame (pc))
+  gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
+  if (pc_in_dummy_frame (pc))
     return &dummy_frame_unwind;
   else
     return NULL;
index cde9eb7..6d565d1 100644 (file)
@@ -50,31 +50,6 @@ struct frame_id;
 
 extern const struct frame_unwind *dummy_frame_sniffer (struct frame_info *next_frame);
 
-/* Does the PC fall in a dummy frame?
-
-   This function is used by "frame.c" when creating a new `struct
-   frame_info'.
-
-   Note that there is also very similar code in breakpoint.c (where
-   the bpstat stop reason is computed).  It is looking for a PC
-   falling on a dummy_frame breakpoint.  Perhaphs this, and that code
-   should be combined?
-
-   Architecture dependant code, that has access to a frame, should not
-   use this function.  Instead (get_frame_type() == DUMMY_FRAME)
-   should be used.
-
-   Hmm, but what about threads?  When the dummy-frame code tries to
-   relocate a dummy frame's saved registers it definitly needs to
-   differentiate between threads (otherwize it will do things like
-   clean-up the wrong threads frames).  However, when just trying to
-   identify a dummy-frame that shouldn't matter.  The wost that can
-   happen is that a thread is marked as sitting in a dummy frame when,
-   in reality, its corrupted its stack, to the point that a PC is
-   pointing into a dummy frame.  */
-
-extern int pc_in_dummy_frame (CORE_ADDR pc);
-
 /* Return the regcache that belongs to the dummy-frame identifed by PC
    and FP, or NULL if no such frame exists.  */
 /* FIXME: cagney/2002-11-08: The function only exists because of
index 7df7c43..e5f4168 100644 (file)
@@ -1154,12 +1154,8 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized,
 static enum frame_type
 frame_type_from_pc (CORE_ADDR pc)
 {
-  /* FIXME: cagney/2002-11-24: Can't yet directly call
-     pc_in_dummy_frame() as some architectures don't set
-     PC_IN_CALL_DUMMY() to generic_pc_in_call_dummy() (remember the
-     latter is implemented by simply calling pc_in_dummy_frame).  */
   if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
+      && deprecated_pc_in_call_dummy (pc, 0, 0))
     return DUMMY_FRAME;
   else
     {
@@ -1688,9 +1684,7 @@ legacy_get_prev_frame (struct frame_info *this_frame)
      initialization, as seen in create_new_frame(), should occur
      before the INIT function has been called.  */
   if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && (DEPRECATED_PC_IN_CALL_DUMMY_P ()
-         ? DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (prev), 0, 0)
-         : pc_in_dummy_frame (get_frame_pc (prev))))
+      && deprecated_pc_in_call_dummy (get_frame_pc (prev), 0, 0))
     prev->type = DUMMY_FRAME;
   else
     {
index 0cdae6d..8d7ff1a 100644 (file)
@@ -568,8 +568,8 @@ extern void generic_push_dummy_frame (void);
 extern void generic_pop_current_frame (void (*)(struct frame_info *));
 extern void generic_pop_dummy_frame (void);
 
-extern int generic_pc_in_call_dummy (CORE_ADDR pc,
-                                    CORE_ADDR sp, CORE_ADDR fp);
+extern int deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp,
+                                       CORE_ADDR fp);
 
 /* NOTE: cagney/2002-06-26: Targets should no longer use this
    function.  Instead, the contents of a dummy frames registers can be
index 7927925..46dc08f 100644 (file)
@@ -347,7 +347,7 @@ struct gdbarch startup_gdbarch =
   0,  /* cannot_fetch_register */
   0,  /* cannot_store_register */
   0,  /* get_longjmp_target */
-  generic_pc_in_call_dummy,  /* deprecated_pc_in_call_dummy */
+  deprecated_pc_in_call_dummy,  /* deprecated_pc_in_call_dummy */
   0,  /* deprecated_init_frame_pc_first */
   0,  /* deprecated_init_frame_pc */
   0,  /* believe_pcc_promotion */
@@ -499,7 +499,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->register_sim_regno = legacy_register_sim_regno;
   current_gdbarch->cannot_fetch_register = cannot_register_not;
   current_gdbarch->cannot_store_register = cannot_register_not;
-  current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy;
+  current_gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy;
   current_gdbarch->convert_register_p = legacy_convert_register_p;
   current_gdbarch->register_to_value = legacy_register_to_value;
   current_gdbarch->value_to_register = legacy_value_to_register;
@@ -3767,7 +3767,7 @@ int
 gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy;
+  return gdbarch->deprecated_pc_in_call_dummy != deprecated_pc_in_call_dummy;
 }
 
 int
@@ -3775,7 +3775,7 @@ gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->deprecated_pc_in_call_dummy != NULL);
-  /* Do not check predicate: gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy, allow call.  */
+  /* Do not check predicate: gdbarch->deprecated_pc_in_call_dummy != deprecated_pc_in_call_dummy, allow call.  */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n");
   return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address);
index f5d6b05..cde5571 100755 (executable)
@@ -562,7 +562,7 @@ F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc
 # is false, the corresponding function works.  This simplifies the
 # migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
 # doesn't need to be modified.
-F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::generic_pc_in_call_dummy:generic_pc_in_call_dummy
+F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::deprecated_pc_in_call_dummy:deprecated_pc_in_call_dummy
 F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
 F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
 #
index 115ffe1..ab5a25b 100644 (file)
@@ -454,10 +454,10 @@ extern int attach_flag;
 
 /* Are we in a call dummy? */
 
-/* NOTE: cagney/2002-11-24: Targets need to both switch to generic
-   dummy frames, and use generic_pc_in_call_dummy().  The generic
-   version should be able to handle all cases since that code works by
-   saving the address of the dummy's breakpoint (where ever it is).  */
+/* NOTE: cagney/2002-11-24 cagney/2004-03-22: Targets need to both
+   switch to generic dummy frames.  The generic version should be able
+   to handle all cases since that code works by saving the address of
+   the dummy's breakpoint (where ever it is).  */
 
 extern int deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc,
                                                 CORE_ADDR sp,