This is the mail archive of the gdb-patches@sourceware.org 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]

[RFA] Clarify varobj block/frame interaction.


This patch clarifies some invariants in varobj_root.
The current behaviour does not cause any problem, because
while we set root's frame even if block is NULL, we don't
use it, but clarity matters. 

Checked in.

- Volodya

	* varobj.c (struct varobj_root): Clarify
	comment on the frame field.
	(varobj_create): Don't set frame if we have no
	block.
---
 gdb/varobj.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/varobj.c b/gdb/varobj.c
index 2236931..c5df325 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -62,7 +62,8 @@ struct varobj_root
   /* Block for which this expression is valid */
   struct block *valid_block;
 
-  /* The frame for this expression */
+  /* The frame for this expression.  This field is set iff valid_block is
+     not NULL.  */
   struct frame_id frame;
 
   /* If 1, "update" always recomputes the frame & valid block
@@ -497,7 +498,7 @@ varobj_create (char *objname,
          we must select the appropriate frame before parsing
          the expression, otherwise the value will not be current.
          Since select_frame is so benign, just call it for all cases. */
-      if (fi != NULL)
+      if (innermost_block && fi != NULL)
 	{
 	  var->root->frame = get_frame_id (fi);
 	  old_fi = get_selected_frame (NULL);
-- 
1.5.3.5


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