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]

[offbyone] Fix some names


Hello,

This is a strictly cosmetic change to rename various types, parameters, and struct fields to names that better match their function.

Andrew
2003-03-11  Andrew Cagney  <cagney at redhat dot com>

	* frame-unwind.h (frame_this_id_ftype): Rename
	frame_unwind_id_ftype.
	(frame_prev_register_ftype): Rename frame_unwind_reg_ftype.
	(struct frame_unwind): Update.  Rename "id" to "this_id", and
	"reg" to "prev_register".
	* frame.c (get_prev_frame): Update.  Rename parameter next_frame
	to this frame.
	(frame_register_unwind): Update.

Index: frame-unwind.h
===================================================================
RCS file: /cvs/src/src/gdb/frame-unwind.h,v
retrieving revision 1.3.6.3
diff -u -r1.3.6.3 frame-unwind.h
--- frame-unwind.h	7 Mar 2003 14:24:29 -0000	1.3.6.3
+++ frame-unwind.h	11 Mar 2003 22:58:50 -0000
@@ -72,9 +72,9 @@
    other unwind methods.  Memory for that cache should be allocated
    using frame_obstack_zalloc().  */
 
-typedef void (frame_unwind_id_ftype) (struct frame_info *next_frame,
-				      void **this_cache,
-				      struct frame_id *this_id);
+typedef void (frame_this_id_ftype) (struct frame_info *next_frame,
+				    void **this_cache,
+				    struct frame_id *this_id);
 
 /* Assuming the frame chain: (outer) prev <-> this <-> next (inner);
    use the NEXT frame, and its register unwind method, to unwind THIS
@@ -94,21 +94,21 @@
    other unwind methods.  Memory for that cache should be allocated
    using frame_obstack_zalloc().  */
 
-typedef void (frame_unwind_reg_ftype) (struct frame_info *next_frame,
-				       void **this_cache,
-				       int prev_regnum,
-				       int *optimized,
-				       enum lval_type * lvalp,
-				       CORE_ADDR *addrp,
-				       int *realnump, void *valuep);
+typedef void (frame_prev_register_ftype) (struct frame_info *next_frame,
+					  void **this_cache,
+					  int prev_regnum,
+					  int *optimized,
+					  enum lval_type * lvalp,
+					  CORE_ADDR *addrp,
+					  int *realnump, void *valuep);
 
 struct frame_unwind
 {
   /* Should the frame's type go here? */
   /* Should an attribute indicating the frame's address-in-block go
      here?  */
-  frame_unwind_id_ftype *id;
-  frame_unwind_reg_ftype *reg;
+  frame_this_id_ftype *this_id;
+  frame_prev_register_ftype *prev_register;
 };
 
 #endif
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.71.2.6
diff -u -r1.71.2.6 frame.c
--- frame.c	10 Mar 2003 21:00:55 -0000	1.71.2.6
+++ frame.c	11 Mar 2003 22:58:51 -0000
@@ -249,9 +249,10 @@
 
   /* Ask this frame's register unwinder to return the value of
      PREV_REGNUM using register values unwound from the NEXT frame.  */
-  this_frame->unwind->reg (this_frame->next, &this_frame->unwind_cache,
-			   prev_regnum, optimizedp, lvalp, addrp, realnump,
-			   bufferp);
+  this_frame->unwind->prev_register (this_frame->next,
+				     &this_frame->unwind_cache,
+				     prev_regnum, optimizedp, lvalp, addrp,
+				     realnump, bufferp);
 }
 
 void
@@ -1220,7 +1221,7 @@
    if there is no such frame.  */
 
 struct frame_info *
-get_prev_frame (struct frame_info *next_frame)
+get_prev_frame (struct frame_info *this_frame)
 {
   struct frame_info *prev_frame;
 
@@ -1242,7 +1243,7 @@
      that a frame isn't possible, rather than checking that the target
      has state and then calling get_current_frame() and
      get_prev_frame().  This is a guess mind.  */
-  if (next_frame == NULL)
+  if (this_frame == NULL)
     {
       /* NOTE: cagney/2002-11-09: There was a code segment here that
 	 would error out when CURRENT_FRAME was NULL.  The comment
@@ -1255,18 +1256,18 @@
 	 thing to do.''
 
          Per the above, this code shouldn't even be called with a NULL
-         NEXT_FRAME.  */
+         THIS_FRAME.  */
       return current_frame;
     }
 
   /* There is always a frame.  If this assertion fails, suspect that
      something should be calling get_selected_frame() or
      get_current_frame().  */
-  gdb_assert (next_frame != NULL);
+  gdb_assert (this_frame != NULL);
 
-  if (next_frame->level >= 0
+  if (this_frame->level >= 0
       && !backtrace_below_main
-      && inside_main_func (get_frame_pc (next_frame)))
+      && inside_main_func (get_frame_pc (this_frame)))
     /* Don't unwind past main(), bug always unwind the sentinel frame.
        Note, this is done _before_ the frame has been marked as
        previously unwound.  That way if the user later decides to
@@ -1279,9 +1280,9 @@
     }
 
   /* Only try to do the unwind once.  */
-  if (next_frame->prev_p)
-    return next_frame->prev;
-  next_frame->prev_p = 1;
+  if (this_frame->prev_p)
+    return this_frame->prev;
+  this_frame->prev_p = 1;
 
   /* If we're inside the entry file, it isn't valid.  Don't apply this
      test to a dummy frame - dummy frame PC's typically land in the
@@ -1294,8 +1295,8 @@
   /* NOTE: cagney/2003-01-10: If there is a way of disabling this test
      then it should probably be moved to before the ->prev_p test,
      above.  */
-  if (next_frame->type != DUMMY_FRAME && next_frame->level >= 0
-      && inside_entry_file (get_frame_pc (next_frame)))
+  if (this_frame->type != DUMMY_FRAME && this_frame->level >= 0
+      && inside_entry_file (get_frame_pc (this_frame)))
     {
       if (frame_debug)
 	fprintf_unfiltered (gdb_stdlog,
@@ -1311,8 +1312,8 @@
   /* NOTE: cagney/2003-02-25: Don't enable until someone has found
      hard evidence that this is needed.  */
   if (0
-      && next_frame->type != DUMMY_FRAME && next_frame->level >= 0
-      && inside_entry_func (get_frame_pc (next_frame)))
+      && this_frame->type != DUMMY_FRAME && this_frame->level >= 0
+      && inside_entry_func (get_frame_pc (this_frame)))
     {
       if (frame_debug)
 	fprintf_unfiltered (gdb_stdlog,
@@ -1328,9 +1329,9 @@
        || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
        || DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()
        || FRAME_CHAIN_P ())
-      && next_frame->level >= 0)
+      && this_frame->level >= 0)
     {
-      prev_frame = legacy_get_prev_frame (next_frame);
+      prev_frame = legacy_get_prev_frame (this_frame);
       if (frame_debug && prev_frame == NULL)
 	fprintf_unfiltered (gdb_stdlog,
 			    "Outermost frame - legacy_get_prev_frame NULL.\n");
@@ -1348,7 +1349,7 @@
      been here before' check above will stop repeated memory
      allocation calls.  */
   prev_frame = FRAME_OBSTACK_ZALLOC (struct frame_info);
-  prev_frame->level = next_frame->level + 1;
+  prev_frame->level = this_frame->level + 1;
 
   /* Try to unwind the PC.  If that doesn't work, assume we've reached
      the oldest frame and simply return.  Is there a better sentinal
@@ -1358,16 +1359,16 @@
      Note that the pc-unwind is intentionally performed before the
      frame chain.  This is ok since, for old targets, both
      frame_pc_unwind (nee, FRAME_SAVED_PC) and FRAME_CHAIN()) assume
-     NEXT_FRAME's data structures have already been initialized (using
+     THIS_FRAME's data structures have already been initialized (using
      DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order
      doesn't matter.
 
      By unwinding the PC first, it becomes possible to, in the case of
      a dummy frame, avoid also unwinding the frame ID.  This is
      because (well ignoring the PPC) a dummy frame can be located
-     using NEXT_FRAME's frame ID.  */
+     using THIS_FRAME's frame ID.  */
 
-  prev_frame->pc = frame_pc_unwind (next_frame);
+  prev_frame->pc = frame_pc_unwind (this_frame);
   if (prev_frame->pc == 0)
     {
       /* The allocated PREV_FRAME will be reclaimed when the frame
@@ -1406,9 +1407,9 @@
 	     frame_register_unwind to obtain the register values
 	     needed to determine the dummy frame's ID.  */
 	  prev_frame->id = gdbarch_unwind_dummy_id (current_gdbarch,
-						    next_frame);
+						    this_frame);
 	}
-      else if (next_frame->level < 0)
+      else if (this_frame->level < 0)
 	{
 	  /* We're unwinding a sentinel frame, the PC of which is
 	     pointing at a stack dummy.  Fake up the dummy frame's ID
@@ -1431,8 +1432,8 @@
       break;
     case NORMAL_FRAME:
     case SIGTRAMP_FRAME:
-      prev_frame->unwind->id (next_frame, &prev_frame->unwind_cache,
-			      &prev_frame->id);
+      prev_frame->unwind->this_id (this_frame, &prev_frame->unwind_cache,
+				   &prev_frame->id);
       /* Check that the unwound ID is valid.  */
       if (!frame_id_p (prev_frame->id))
 	{
@@ -1449,8 +1450,8 @@
 	 sentinel frame's frame ID to a `sentinel'.  Leave it until
 	 after the switch to storing the frame ID, instead of the
 	 frame base, in the frame object.  */
-      if (next_frame->level >= 0
-	  && frame_id_inner (prev_frame->id, get_frame_id (next_frame)))
+      if (this_frame->level >= 0
+	  && frame_id_inner (prev_frame->id, get_frame_id (this_frame)))
 	error ("Unwound frame inner-to selected frame (corrupt stack?)");
       /* Note that, due to frameless functions, the stronger test of
 	 the new frame being outer to the old frame can't be used -
@@ -1467,8 +1468,8 @@
   prev_frame->frame = prev_frame->id.base;
 
   /* Link it in.  */
-  next_frame->prev = prev_frame;
-  prev_frame->next = next_frame;
+  this_frame->prev = prev_frame;
+  prev_frame->next = this_frame;
 
   /* FIXME: cagney/2002-01-19: This call will go away.  Instead of
      initializing extra info, all frames will use the frame_cache

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