From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15695 invoked by alias); 26 Mar 2008 14:54:36 -0000 Received: (qmail 15685 invoked by uid 22791); 26 Mar 2008 14:54:35 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Mar 2008 14:54:13 +0000 Received: (qmail 2831 invoked from network); 26 Mar 2008 14:54:10 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 26 Mar 2008 14:54:10 -0000 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: -var-update @ Date: Wed, 26 Mar 2008 14:54:00 -0000 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_SOm6HNOoCi5sBau" Message-Id: <200803261754.10513.vladimir@codesourcery.com> 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: 2008-03/txt/msg00398.txt.bz2 --Boundary-00=_SOm6HNOoCi5sBau Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 755 I've checked it the attached patch which allows one to issue -var-update @ and have all @-varobjs (or floating varobjs, as Nick suggested to name them), updated. I believe this is the only reasonable way to make @ varobjs, which are not bound to thread/frame/block to adequately work in MT program. Otherwise, if frontend switches thread or frame and wishes to update floating varobjs, it should either to "-var-update *", which is extra work, or update varobjs one-by-one, which is also not very nice. - Volodya 2008-03-26 Vladimir Prus * varobj.h (varobj_floating_p): Declare. * varobj.c (varobj_floating_p): New. * mi/mi-cmd-var.c (mi_cmd_var_update): When passed '@' as the name, update all floating varobjs. --Boundary-00=_SOm6HNOoCi5sBau Content-Type: text/x-diff; charset="utf-8"; name="commit.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="commit.diff" Content-length: 2232 Index: varobj.c =================================================================== RCS file: /cvs/src/src/gdb/varobj.c,v retrieving revision 1.107 diff -u -p -r1.107 varobj.c --- varobj.c 26 Mar 2008 14:11:18 -0000 1.107 +++ varobj.c 26 Mar 2008 14:48:37 -0000 @@ -1868,6 +1868,15 @@ varobj_value_is_changeable_p (struct var return r; } +/* Return 1 if that varobj is floating, that is is always evaluated in the + selected frame, and not bound to thread/frame. Such variable objects + are created using '@' as frame specifier to -var-create. */ +int +varobj_floating_p (struct varobj *var) +{ + return var->root->floating; +} + /* Given the value and the type of a variable object, adjust the value and type to those necessary for getting children of the variable object. Index: varobj.h =================================================================== RCS file: /cvs/src/src/gdb/varobj.h,v retrieving revision 1.16 diff -u -p -r1.16 varobj.h --- varobj.h 24 Mar 2008 17:33:30 -0000 1.16 +++ varobj.h 26 Mar 2008 14:48:37 -0000 @@ -124,4 +124,6 @@ extern void varobj_invalidate (void); extern int varobj_editable_p (struct varobj *var); +extern int varobj_floating_p (struct varobj *var); + #endif /* VAROBJ_H */ Index: mi/mi-cmd-var.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmd-var.c,v retrieving revision 1.46 diff -u -p -r1.46 mi-cmd-var.c --- mi/mi-cmd-var.c 24 Mar 2008 17:33:30 -0000 1.46 +++ mi/mi-cmd-var.c 26 Mar 2008 14:48:39 -0000 @@ -558,7 +558,7 @@ mi_cmd_var_update (char *command, char * /* Check if the parameter is a "*" which means that we want to update all variables */ - if ((*name == '*') && (*(name + 1) == '\0')) + if ((*name == '*' || *name == '@') && (*(name + 1) == '\0')) { nv = varobj_list (&rootlist); cleanup = make_cleanup (xfree, rootlist); @@ -574,7 +574,8 @@ mi_cmd_var_update (char *command, char * cr = rootlist; while (*cr != NULL) { - varobj_update_one (*cr, print_values, 0 /* implicit */); + if (*name == '*' || varobj_floating_p (*cr)) + varobj_update_one (*cr, print_values, 0 /* implicit */); cr++; } do_cleanups (cleanup); --Boundary-00=_SOm6HNOoCi5sBau--