Patch from David Mosberger.
[deliverable/binutils-gdb.git] / gdb / m32r-tdep.c
index eeb6335131b2d27054e88fd14c34acb2657015a8..64842347ccfc642c26a8c127f09c96f9994dd496 100644 (file)
@@ -1,5 +1,7 @@
 /* Target-dependent code for the Mitsubishi m32r for GDB, the GNU debugger.
-   Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1996, 1998, 1999, 2000, 2001, 2003 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -426,20 +428,20 @@ m32r_init_extra_frame_info (struct frame_info *fi)
 void
 m32r_virtual_frame_pointer (CORE_ADDR pc, long *reg, long *offset)
 {
-  struct frame_info fi;
+  struct frame_info *fi = deprecated_frame_xmalloc ();
+  struct cleanup *old_chain = make_cleanup (xfree, fi);
 
   /* Set up a dummy frame_info. */
-  fi.next = NULL;
-  fi.prev = NULL;
-  fi.frame = 0;
-  fi.pc = pc;
+  fi->next = NULL;
+  fi->prev = NULL;
+  fi->frame = 0;
+  fi->pc = pc;
 
   /* Analyze the prolog and fill in the extra info.  */
-  m32r_init_extra_frame_info (&fi);
-
+  m32r_init_extra_frame_info (fi);
 
   /* Results will tell us which type of frame it uses.  */
-  if (fi.using_frame_pointer)
+  if (fi->using_frame_pointer)
     {
       *reg = FP_REGNUM;
       *offset = 0;
@@ -449,6 +451,7 @@ m32r_virtual_frame_pointer (CORE_ADDR pc, long *reg, long *offset)
       *reg = SP_REGNUM;
       *offset = 0;
     }
+  do_cleanups (old_chain);
 }
 
 /* Function: find_callers_reg
This page took 0.023986 seconds and 4 git commands to generate.