From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31647 invoked by alias); 10 Nov 2006 16:53:07 -0000 Received: (qmail 31618 invoked by uid 22791); 10 Nov 2006 16:53:04 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Nov 2006 16:52:53 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GiZcI-0007Ca-M4 for gdb@sources.redhat.com; Fri, 10 Nov 2006 17:52:34 +0100 Received: from 73-198.umostel.ru ([82.179.73.198]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Nov 2006 17:52:34 +0100 Received: from ghost by 73-198.umostel.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Nov 2006 17:52:34 +0100 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: -var-show-attributes response syntax Date: Fri, 10 Nov 2006 16:53:00 -0000 Message-ID: References: <200611101655.32843.vladimir@codesourcery.com> <17748.43269.740800.782628@kahikatea.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.2 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00056.txt.bz2 Nick Roberts wrote: > Vladimir Prus writes: > > > > Hello! > > > > Here's the docs for -var-show-attributes MI command: > > > > Synopsis > > -var-show-attributes name > > > > List attributes of the specified variable object name: > > status=attr [ ( ,attr )* ] > > where attr is { { editable | noneditable } | TBD }. > > > > What is the reason for using "non" instead of > > "attribute_name=attribute_value" syntax? The above assumes all > > attributes are boolean, which is not very extensible. > > I think the above means output may be something like: > > ^done,attr={"editable","yellow","big"} Yes, and this is exactly what I'm objecting too. > (Perhaps { a | b } should be documented in "Notation and Terminology".) > > Currently it appears that attr="noneditable" for constant types and > attr="editable" otherwise. I don't know what other attributes the authors > had in mind (long?, volatile?, local?, static?). > > > How about changing the above to "editable=0/1"? > > I see no advantage in restricting the output but I've not used this > command. How do you want to use it? I want to add a new attribute there, actually, and I'd prefer to use more regular name=value syntax. > > This sounds like > > breaking > > backward compatibility, but probably is not, because "editable" is > > broken itself: > > > > -var-create C * 1+1 > > ^done,name="C",numchild="0",type="long" > > (gdb) > > -var-show-attributes C > > ^done,attr="editable" > > (gdb) > > Why do you think this is broken? Because you can't assign the value to "1+1" -- it's not lvalue. And trying to do so will result in error from gdb. - Volodya