Re: -var-show-attributes response syntax

Nick Roberts
2006-11-10T16:34:03Z

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"}

(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?

> 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?

--
Nick http://www.inet.net.nz/~nickrob