From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11229 invoked by alias); 3 Jul 2007 16:16:08 -0000 Received: (qmail 11219 invoked by uid 22791); 3 Jul 2007 16:16:07 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 03 Jul 2007 16:16:05 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 161CA982C3; Tue, 3 Jul 2007 16:16:04 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id E78529829C; Tue, 3 Jul 2007 16:16:03 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1I5l2L-0003FI-Ur; Tue, 03 Jul 2007 12:15:33 -0400 Date: Tue, 03 Jul 2007 16:16:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: gdb-patches@sourceware.org Subject: Re: [MI] lvalues and variable_editable Message-ID: <20070703161533.GF2868@caradoc.them.org> Mail-Followup-To: Nick Roberts , gdb-patches@sourceware.org References: <18048.64048.398970.186217@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18048.64048.398970.186217@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes 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: 2007-07/txt/msg00069.txt.bz2 On Tue, Jun 26, 2007 at 11:36:16PM +1200, Nick Roberts wrote: > > I've been wondering what the difference is between varobj_value_is_changeable_p > and variable_editable. Recent discussion on the gdb mailing list makes > me think that, in essence, a value is only changeable but not editable when > it's an lvalue -- but currently varobj.c doesn't capture this difference. > > Here are two experimental patches: > > 1) varobj.c: Test if the value of variable object is an lvalue. I think this > can only occur for root values. I'm still a bit confused but I think this is because I read "lvalue" and think of the C language meaning. An lvalue is something which can occur on the left hand side of an assignment. So it can happen for children too, for instance. Right now a value is "changeable" unless it is a fake child (e.g. "public"), a struct, a union, or an array. This makes some sense since the value we print out for those cases is not useful for editing. For instance "{...}". Their children will, I believe, be changeable. A value is editable in C unless it is a struct, union, array, function, or method. C++ adds the fake access children again. So the only things which are editable but not changeable are functions and methods. That doesn't seem like a useful distinction. Back in revision 1.1, fake children and structs and unions were not changeable. Those and arrays, functions, methods, and members were not editable. That doesn't make considerably more sense to me either. The difference in usage seems to be that we forbid attempts to modify non-editable variables, and we omit reporting changes for non-changeable variables. > It would seem sensible to define variable_editable using > varobj_value_is_changeable_p and I don't think language dependent versions > aren't needed. I agree. But is there anything which should be one and not the other? Maybe we can dispense with changeable entirely. -- Daniel Jacobowitz CodeSourcery