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] Use frame_relative_level() + bitrot comment


Hello,

This patch fixes a use of frame->level, changing it to the method.

It has an interesting history.

In 2002-04-10 I added the field struct frame_info.level and on 2002-04-21 I added the accessor method frame_relative_level. By 2002-05-23 code accesed the field directly, instead of using the accessor method, had been added to GDB.

I think this highlights why `struct frame_info' should be truely opaque; you just can't rely on people remembering to use / checking for accessor methods implemented as say macros.

enjoy,
Andrew
2003-01-08  Andrew Cagney  <cagney@redhat.com>

	* d10v-tdep.c (d10v_init_extra_frame_info): Use
	frame_relative_level.

Index: d10v-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/d10v-tdep.c,v
retrieving revision 1.68
diff -u -r1.68 d10v-tdep.c
--- d10v-tdep.c	8 Jan 2003 17:21:28 -0000	1.68
+++ d10v-tdep.c	8 Jan 2003 18:00:36 -0000
@@ -907,7 +907,8 @@
   /* If get_frame_pc (fi) is zero, but this is not the outermost frame, 
      then let's snatch the return_pc from the callee, so that
      DEPRECATED_PC_IN_CALL_DUMMY will work.  */
-  if (get_frame_pc (fi) == 0 && fi->level != 0 && get_next_frame (fi) != NULL)
+  if (get_frame_pc (fi) == 0
+      && frame_relative_level (fi) != 0 && get_next_frame (fi) != NULL)
     deprecated_update_frame_pc_hack (fi, d10v_frame_saved_pc (get_next_frame (fi)));
 
   /* The call dummy doesn't save any registers on the stack, so we can

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