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]

[patch rfc] Eliminate frame->frame


Hello,

This eliminates frame->frame (which contained redundant information also found in frame->id.base).

All code manipulating ->frame should instead be using:

get_frame_base()
get_frame_id()
get_frame_{base,args,locals}_addr()
deprecated_update_frame_base_hack()

So after this is committed, any remaining tweaks are pretty obvious.

I'll leave this for a few days, take a deep breath, and then commit.

Andrew
2003-04-05  Andrew Cagney  <cagney at redhat dot com>

	* frame.c (get_frame_id): Eliminate code updating "frame".
	(legacy_get_prev_frame): Ditto.
	(get_frame_base): Return id.base directly.
	(deprecated_update_frame_base_hack): Update "id.base".
	* frame.h (struct frame_info): Delete field "frame".

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.98
diff -u -r1.98 frame.c
--- frame.c	5 Apr 2003 15:49:54 -0000	1.98
+++ frame.c	5 Apr 2003 16:37:25 -0000
@@ -64,11 +64,8 @@
       /* Find THIS frame's ID.  */
       fi->unwind->this_id (fi->next, &fi->prologue_cache, &fi->id);
       fi->id_p = 1;
-      /* FIXME: cagney/2002-12-18: Instead of this hack, should only
-	 store the frame ID in PREV_FRAME.  */
-      fi->frame = fi->id.base;
     }
-  return frame_id_build (fi->frame, get_frame_pc (fi));
+  return frame_id_build (fi->id.base, get_frame_pc (fi));
 }
 
 const struct frame_id null_frame_id; /* All zeros.  */
@@ -1155,12 +1152,6 @@
 	 after the switch to storing the frame ID, instead of the
 	 frame base, in the frame object.  */
 
-      /* FIXME: cagney/2002-12-18: Instead of this hack, should only
-	 store the frame ID in PREV_FRAME.  */
-      /* FIXME: cagney/2003-04-04: Once ->frame is eliminated, this
-         assignment can go.  */
-      prev->frame = prev->id.base;
-
       /* Link it in.  */
       this_frame->prev = prev;
 
@@ -1665,13 +1656,7 @@
 CORE_ADDR
 get_frame_base (struct frame_info *fi)
 {
-  if (!fi->id_p)
-    {
-      /* HACK: Force the ID code to (indirectly) initialize the
-         ->frame pointer.  */
-      get_frame_id (fi);
-    }
-  return fi->frame;
+  return get_frame_id (fi).base;
 }
 
 /* High-level offsets into the frame.  Used by the debug info.  */
@@ -1823,7 +1808,7 @@
 deprecated_update_frame_base_hack (struct frame_info *frame, CORE_ADDR base)
 {
   /* See comment in "frame.h".  */
-  frame->frame = base;
+  frame->id.base = base;
 }
 
 void
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.82
diff -u -r1.82 frame.h
--- frame.h	5 Apr 2003 15:39:33 -0000	1.82
+++ frame.h	5 Apr 2003 16:37:25 -0000
@@ -349,12 +349,6 @@
 
 struct frame_info
   {
-    /* Nominal address of the frame described.  See comments at
-       get_frame_base() about what this means outside the *FRAME*
-       macros; in the *FRAME* macros, it can mean whatever makes most
-       sense for this machine.  */
-    CORE_ADDR frame;
-
     /* Address at which execution is occurring in this frame.
        For the innermost frame, it's the current pc.
        For other frames, it is a pc saved in the next frame.  */

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