constify error_no_arg
[deliverable/binutils-gdb.git] / gdb / dummy-frame.c
index b8a8c860910a1f707e6e47a7ce6ce97e87703d4a..dd2ff1285ce7f7fbe152e80592dbda68cdd791d3 100644 (file)
@@ -1,6 +1,6 @@
 /* Code dealing with dummy stack frames, for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2004, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 1986-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -27,7 +27,7 @@
 #include "frame-unwind.h"
 #include "command.h"
 #include "gdbcmd.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "observer.h"
 #include "gdbthread.h"
 
@@ -47,40 +47,6 @@ struct dummy_frame
 
 static struct dummy_frame *dummy_frame_stack = NULL;
 
-/* Function: deprecated_pc_in_call_dummy (pc)
-
-   Return non-zero if the PC falls in a dummy frame created by gdb for
-   an inferior call.  The code below which allows gdbarch_decr_pc_after_break
-   is for infrun.c, which may give the function a PC without that
-   subtracted out.
-
-   FIXME: cagney/2002-11-23: This is silly.  Surely "infrun.c" can
-   figure out what the real PC (as in the resume address) is BEFORE
-   calling this function.
-
-   NOTE: cagney/2004-08-02: I'm pretty sure that, with the introduction of
-   infrun.c:adjust_pc_after_break (thanks), this function is now
-   always called with a correctly adjusted PC!
-
-   NOTE: cagney/2004-08-02: Code should not need to call this.  */
-
-int
-deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc)
-{
-  struct dummy_frame *dummyframe;
-
-  for (dummyframe = dummy_frame_stack;
-       dummyframe != NULL;
-       dummyframe = dummyframe->next)
-    {
-      if ((pc >= dummyframe->id.code_addr)
-         && (pc <= dummyframe->id.code_addr
-                   + gdbarch_decr_pc_after_break (gdbarch)))
-       return 1;
-    }
-  return 0;
-}
-
 /* Push the caller's state, along with the dummy frame info, onto the
    dummy-frame stack.  */
 
@@ -90,7 +56,7 @@ dummy_frame_push (struct infcall_suspend_state *caller_state,
 {
   struct dummy_frame *dummy_frame;
 
-  dummy_frame = XZALLOC (struct dummy_frame);
+  dummy_frame = XCNEW (struct dummy_frame);
   dummy_frame->caller_state = caller_state;
   dummy_frame->id = (*dummy_id);
   dummy_frame->next = dummy_frame_stack;
@@ -229,9 +195,6 @@ dummy_frame_sniffer (const struct frame_unwind *self,
                     struct frame_info *this_frame,
                     void **this_prologue_cache)
 {
-  struct dummy_frame *dummyframe;
-  struct frame_id this_id;
-
   /* When unwinding a normal frame, the stack structure is determined
      by analyzing the frame's function's code (be it using brute force
      prologue analysis, or the dwarf2 CFI).  In the case of a dummy
@@ -243,9 +206,11 @@ dummy_frame_sniffer (const struct frame_unwind *self,
   /* Don't bother unless there is at least one dummy frame.  */
   if (dummy_frame_stack != NULL)
     {
+      struct dummy_frame *dummyframe;
       /* Use an architecture specific method to extract this frame's
         dummy ID, assuming it is a dummy frame.  */
-      this_id = gdbarch_dummy_id (get_frame_arch (this_frame), this_frame);
+      struct frame_id this_id
+       = gdbarch_dummy_id (get_frame_arch (this_frame), this_frame);
 
       /* Use that ID to find the corresponding cache entry.  */
       for (dummyframe = dummy_frame_stack;
This page took 0.024526 seconds and 4 git commands to generate.