From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6805 invoked by alias); 21 Jun 2007 20:17:50 -0000 Received: (qmail 6796 invoked by uid 22791); 21 Jun 2007 20:17:49 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 21 Jun 2007 20:17:45 +0000 Received: from kahikatea.snap.net.nz (191.63.255.123.dynamic.snap.net.nz [123.255.63.191]) by viper.snap.net.nz (Postfix) with ESMTP id C25153D967D; Fri, 22 Jun 2007 08:17:41 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id DDB3B8FBF6; Fri, 22 Jun 2007 08:17:40 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18042.56547.598273.973421@kahikatea.snap.net.nz> Date: Thu, 21 Jun 2007 20:17:00 -0000 To: "Srrr" Cc: Subject: Re: BUG: MI reporting wrong attributes for casted variables In-Reply-To: <000001c7b427$5822d330$02b2a8c0@insanenotebook> References: <000001c7b427$5822d330$02b2a8c0@insanenotebook> X-Mailer: VM 7.19 under Emacs 22.1.50.4 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00179.txt.bz2 > unsigned int myValue; > > It is possible to create a casted MI variable like > > 1096-var-create - * (int)myValue > 1096^done,name="var4",numchild="0",value="0",type="int" > > GDB reports this to be an editable variable: > > 1097-var-show-attributes var4 > 1097^done,attr="editable" > > But in fact, it is not. GDB does not allow assiging values to casted > variables. So GDB should not report this to be editable. > > 1100-var-assign var4 1 > 1100^error,msg="mi_cmd_var_assign: Could not assign expression to varible > object" > > This bug is causing trouble in Eclipse CDT because casted vars show up as > editable when they are not. > > GDB Snapshot from around 26.5.2007. Report it as a bug to the Eclipse CDT team. They have misinterpreted the meaning of the "editable" attribute. This has been reported at leasted once before, possibly by you (or at least another Sascha using Eclipse CDT) when I said: The fact that the var has the attribute "editable" is a bit of a red herring. A value can't be assigned because (int)myValue isn't an lvalue. You get the same error if you do: -var-create - * 2*myValue ^done,name="var36",numchild="0",value="2",type="int" -var-assign var36 0x1234 I think it only makes sense to watch such values. Having said all that, I think we should add another field "lvalue" or "unassignable", say, to the output of -var-show-attributes so that IDE's like Eclipse can determine which variables can be assigned a value. -- Nick http://www.inet.net.nz/~nickrob