This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] More deprecated frame manipulation functions


Hello,

The attached adds more [deprecated] frame manipulation functions.
A number of files allocate a scratch frame and then use that to save the prologue analysis of the inner most frame. The files do this because, at the time the prologue analysis is being performed, there is no where to cache that information - neither FRAME_SAVED_PC nor FRAME_CHAIN have somewhere to cache this. Since the overhauled frame code does have somewhere for these functions (the cache parameter to frame_pc_unwind() et.al.) to store the prolog information the static cache is made redundant.

In th mean time, the attached methods keep that old code working, even with an opaque `struct frame_info'.

committed,
Andrew
2003-01-04  Andrew Cagney  <ac131313@redhat.com>

	* frame.c (deprecated_frame_xmalloc): New function.
	(deprecated_set_frame_saved_regs_hack): New function.
	(deprecated_set_frame_extra_info_hack): New function.
	* frame.h (deprecated_frame_xmalloc): Declare.
	(deprecated_set_frame_saved_regs_hack): Declare.
	(deprecated_set_frame_extra_info_hack): Declare.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.48
diff -u -r1.48 frame.c
--- frame.c	18 Dec 2002 18:03:41 -0000	1.48
+++ frame.c	4 Jan 2003 13:38:00 -0000
@@ -1311,6 +1311,29 @@
 }
 
 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)
+{
+  struct frame_info *frame = XMALLOC (struct frame_info);
+  memset (frame, 0, sizeof (struct frame_info));
+  return frame;
+}
+
+
+void
 _initialize_frame (void)
 {
   obstack_init (&frame_cache_obstack);
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.53
diff -u -r1.53 frame.h
--- frame.h	18 Dec 2002 18:03:41 -0000	1.53
+++ frame.h	4 Jan 2003 13:38:01 -0000
@@ -674,4 +674,23 @@
 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);
+
 #endif /* !defined (FRAME_H)  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]