From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20047 invoked by alias); 31 Dec 2006 00:02:32 -0000 Received: (qmail 20039 invoked by uid 22791); 31 Dec 2006 00:02:32 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 31 Dec 2006 00:02:28 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1H0o9b-0002Dc-Be for gdb-patches@sources.redhat.com; Sun, 31 Dec 2006 03:02:25 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1H0o9b-0002DZ-4J for gdb-patches@sources.redhat.com; Sun, 31 Dec 2006 03:02:19 +0300 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: Fix 'selected frame' varobjs Date: Sun, 31 Dec 2006 00:02:00 -0000 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_m3vlFMD+JiniF7V" Message-Id: <200612310301.42649.ghost@cs.msu.su> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00380.txt.bz2 --Boundary-00=_m3vlFMD+JiniF7V Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 765 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 Vladimir Prus 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. --Boundary-00=_m3vlFMD+JiniF7V Content-Type: text/x-diff; charset="us-ascii"; name="at_varobjs__gdb_mainline.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="at_varobjs__gdb_mainline.diff" Content-length: 936 --- 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 */ --Boundary-00=_m3vlFMD+JiniF7V--