Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Fix 'selected frame' varobjs
@ 2006-12-31  0:02 Vladimir Prus
  2006-12-31 21:42 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Prus @ 2006-12-31  0:02 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]


At the moment, the 'selected frame' varobjs (created with -var-create NAME @) are
somewhat broken.

I've reported that in:

	http://article.gmane.org/gmane.comp.gdb.devel/16381

to which Dan posted a preliminary patch to which I replied with another bug:

	http://article.gmane.org/gmane.comp.gdb.devel/16398

and the story ended there. This patch fixed both problems and causes no
regressions. OK?

- Volodya

2006-12-31  Daniel Jacobowitz  <dan@codesourcery.com>
	    Vladimir Prus  <vladimir@codesourcery.com>

	Fix 'selected frame' varobjs.
	* varobj.c (varobj_update): If we get error getting new
	value of root, reset the value.
	(c_value_of_root): Always reevaluate the value
	of selected frame varobjs in the selected frame.
	Dont call reinit_frame_cache.

[-- Attachment #2: at_varobjs__gdb_mainline.diff --]
[-- Type: text/x-diff, Size: 936 bytes --]

--- gdb/varobj.c	(/mirrors/gdb_mainline)	(revision 3011)
+++ gdb/varobj.c	(/patches/gdb/at_varobjs/gdb_mainline)	(revision 3011)
@@ -1061,6 +1061,14 @@ varobj_update (struct varobj **varp, str
   if (new == NULL)
     {
       (*varp)->error = 1;
+      /* Also set the value to NULL, so that
+	 when the value becomes valid in future,
+	 -var-update notice the change.  */
+      if ((*varp)->value != NULL)
+	{
+	  value_free ((*varp)->value);
+	  (*varp)->value = NULL;
+	}
       return -1;
     }
 
@@ -1950,11 +1958,10 @@ c_value_of_root (struct varobj **var_han
 
 
   /* Determine whether the variable is still around. */
-  if (var->root->valid_block == NULL)
+  if (var->root->valid_block == NULL || var->root->use_selected_frame)
     within_scope = 1;
   else
     {
-      reinit_frame_cache ();
       fi = frame_find_by_id (var->root->frame);
       within_scope = fi != NULL;
       /* FIXME: select_frame could fail */

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-16  2:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-31  0:02 Fix 'selected frame' varobjs Vladimir Prus
2006-12-31 21:42 ` Daniel Jacobowitz
2007-01-09 21:22   ` Vladimir Prus
2007-01-09 21:45     ` Daniel Jacobowitz
2007-01-16  2:14       ` Vladimir Prus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox