2003-11-22 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Sun, 23 Nov 2003 02:48:40 +0000 (02:48 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 23 Nov 2003 02:48:40 +0000 (02:48 +0000)
* frame.c (deprecated_frame_xmalloc): Delete function.
(deprecated_set_frame_extra_info_hack): Delete function.
(deprecated_set_frame_saved_regs_hack): Delete function.
* frame.h (deprecated_frame_xmalloc): Delete declaration.
(deprecated_set_frame_extra_info_hack): Delete declaration.
(deprecated_set_frame_saved_regs_hack): Delete declaration.
* mcore-tdep.c (analyze_dummy_frame): Instead of
deprecated_frame_xmalloc, deprecated_set_frame_saved_regs_hack,
and deprecated_set_frame_extra_info_hack use
deprecated_frame_xmalloc_with_cleanup.
* mn10300-tdep.c (analyze_dummy_frame): Ditto.
* mips-tdep.c (mips_init_extra_frame_info): Delete call to
deprecated_set_frame_saved_regs_hack.

gdb/ChangeLog
gdb/frame.c
gdb/frame.h
gdb/mcore-tdep.c
gdb/mips-tdep.c
gdb/mn10300-tdep.c

index 457b4053aaa67033cadefc38852e14f3210eaea1..05a6b3585aee0f81a474188db5b11e67a01db560 100644 (file)
@@ -1,5 +1,19 @@
 2003-11-22  Andrew Cagney  <cagney@redhat.com>
 
+       * frame.c (deprecated_frame_xmalloc): Delete function.
+       (deprecated_set_frame_extra_info_hack): Delete function.
+       (deprecated_set_frame_saved_regs_hack): Delete function.
+       * frame.h (deprecated_frame_xmalloc): Delete declaration.
+       (deprecated_set_frame_extra_info_hack): Delete declaration.
+       (deprecated_set_frame_saved_regs_hack): Delete declaration.
+       * mcore-tdep.c (analyze_dummy_frame): Instead of
+       deprecated_frame_xmalloc, deprecated_set_frame_saved_regs_hack,
+       and deprecated_set_frame_extra_info_hack use
+       deprecated_frame_xmalloc_with_cleanup.
+       * mn10300-tdep.c (analyze_dummy_frame): Ditto.
+       * mips-tdep.c (mips_init_extra_frame_info): Delete call to
+       deprecated_set_frame_saved_regs_hack.
+
        * mips-tdep.c (mips_frame_chain): Delete call to
        deprecated_inside_entry_file.
 
index 1b3d9bc2fcf8e19567c2ba9d5059bb30bc51ea0a..7f4c8aa7ba168c3bd1f9680ffcaa03e9b4cb4f54 100644 (file)
@@ -2223,34 +2223,13 @@ deprecated_update_frame_base_hack (struct frame_info *frame, CORE_ADDR base)
   frame->this_id.value.stack_addr = base;
 }
 
-void
-deprecated_set_frame_saved_regs_hack (struct frame_info *frame,
-                                     CORE_ADDR *saved_regs)
-{
-  frame->saved_regs = saved_regs;
-}
-
-void
-deprecated_set_frame_extra_info_hack (struct frame_info *frame,
-                                     struct frame_extra_info *extra_info)
-{
-  frame->extra_info = extra_info;
-}
-
 struct frame_info *
-deprecated_frame_xmalloc (void)
+deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs,
+                                      long sizeof_extra_info)
 {
   struct frame_info *frame = XMALLOC (struct frame_info);
   memset (frame, 0, sizeof (*frame));
   frame->this_id.p = 1;
-  return frame;
-}
-
-struct frame_info *
-deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs,
-                                      long sizeof_extra_info)
-{
-  struct frame_info *frame = deprecated_frame_xmalloc ();
   make_cleanup (xfree, frame);
   if (sizeof_saved_regs > 0)
     {
index 3cde00b35914632c7d47d80d9ca92f3820420ebc..4dc2fb15e048f16f4455a37c5af78b723aa3eff8 100644 (file)
@@ -702,25 +702,6 @@ extern void deprecated_update_frame_pc_hack (struct frame_info *frame,
 extern void deprecated_update_frame_base_hack (struct frame_info *frame,
                                               CORE_ADDR base);
 
-/* FIXME: cagney/2003-01-04: Explicitly set the frame's saved_regs
-   and/or extra_info.  Target code is allocating a fake frame and than
-   initializing that to get around the problem of, when creating the
-   inner most frame, there is no where to cache information such as
-   the prologue analysis.  This is fixed by the new unwind mechanism -
-   even the inner most frame has somewhere to store things like the
-   prolog analysis (or at least will once the frame overhaul is
-   finished).  */
-extern void deprecated_set_frame_saved_regs_hack (struct frame_info *frame,
-                                                 CORE_ADDR *saved_regs);
-extern void deprecated_set_frame_extra_info_hack (struct frame_info *frame,
-                                                 struct frame_extra_info *extra_info);
-
-/* FIXME: cagney/2003-01-04: Allocate a frame from the heap (rather
-   than the frame obstack).  Targets do this as a way of saving the
-   prologue analysis from the inner most frame before that frame has
-   been created.  By always creating a frame, this problem goes away.  */
-extern struct frame_info *deprecated_frame_xmalloc (void);
-
 /* FIXME: cagney/2003-01-05: Allocate a frame, along with the
    saved_regs and extra_info.  Set up cleanups for all three.  Same as
    for deprecated_frame_xmalloc, targets are calling this when
index af1900a9ce2a86e87701330322eff6a4e2343aa7..598a0ace52cbc9fecd0e135271281b6f261c8546 100644 (file)
@@ -246,25 +246,16 @@ mcore_reg_struct_has_addr (int gcc_p, struct type *type)
 static struct frame_info *
 analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame)
 {
-  static struct frame_info *dummy = NULL;
-
-  if (dummy == NULL)
-    {
-      struct frame_extra_info *extra_info;
-      CORE_ADDR *saved_regs;
-      dummy = deprecated_frame_xmalloc ();
-      saved_regs = (CORE_ADDR *) xmalloc (SIZEOF_FRAME_SAVED_REGS);
-      deprecated_set_frame_saved_regs_hack (dummy, saved_regs);
-      extra_info = XMALLOC (struct frame_extra_info);
-      deprecated_set_frame_extra_info_hack (dummy, extra_info);
-    }
-
+  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
+  struct frame_info *dummy
+    = deprecated_frame_xmalloc_with_cleanup (SIZEOF_FRAME_SAVED_REGS,
+                                            sizeof (struct frame_extra_info));
   deprecated_update_frame_pc_hack (dummy, pc);
   deprecated_update_frame_base_hack (dummy, frame);
   get_frame_extra_info (dummy)->status = 0;
   get_frame_extra_info (dummy)->framesize = 0;
-  memset (deprecated_get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS);
   mcore_analyze_prologue (dummy, 0, 0);
+  do_cleanups (old_chain);
   return dummy;
 }
 
index 0946ecf0bdc17eaa30eba36ed89f3f096aad1ab4..7ee7427d551292059c3b22e81c332a8cdeaa6e79 100644 (file)
@@ -2575,7 +2575,6 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
 
   frame_extra_info_zalloc (fci, sizeof (struct frame_extra_info));
 
-  deprecated_set_frame_saved_regs_hack (fci, NULL);
   get_frame_extra_info (fci)->proc_desc =
     proc_desc == &temp_proc_desc ? 0 : proc_desc;
   if (proc_desc)
index 9f62e8acac9a665f708eda17ac0729429ec2ee67..fdc353031f616b754ae8bdfe81a41464f5ca4551 100644 (file)
@@ -152,23 +152,16 @@ static struct frame_info *analyze_dummy_frame (CORE_ADDR, CORE_ADDR);
 static struct frame_info *
 analyze_dummy_frame (CORE_ADDR pc, CORE_ADDR frame)
 {
-  static struct frame_info *dummy = NULL;
-  if (dummy == NULL)
-    {
-      struct frame_extra_info *extra_info;
-      CORE_ADDR *saved_regs;
-      dummy = deprecated_frame_xmalloc ();
-      saved_regs = xmalloc (SIZEOF_FRAME_SAVED_REGS);
-      deprecated_set_frame_saved_regs_hack (dummy, saved_regs);
-      extra_info = XMALLOC (struct frame_extra_info);
-      deprecated_set_frame_extra_info_hack (dummy, extra_info);
-    }
+  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
+  struct frame_info *dummy
+    = deprecated_frame_xmalloc_with_cleanup (SIZEOF_FRAME_SAVED_REGS,
+                                            sizeof (struct frame_extra_info));
   deprecated_update_frame_pc_hack (dummy, pc);
   deprecated_update_frame_base_hack (dummy, frame);
   get_frame_extra_info (dummy)->status = 0;
   get_frame_extra_info (dummy)->stack_size = 0;
-  memset (deprecated_get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS);
   mn10300_analyze_prologue (dummy, pc);
+  do_cleanups (old_chain);
   return dummy;
 }