* -var-show-attributes response syntax
@ 2006-11-10 13:55 Vladimir Prus
2006-11-10 16:34 ` Nick Roberts
0 siblings, 1 reply; 13+ messages in thread
From: Vladimir Prus @ 2006-11-10 13:55 UTC (permalink / raw)
To: gdb
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.
How about changing the above to "editable=0/1"? 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)
Thoughts?
- Volodya
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 13:55 -var-show-attributes response syntax Vladimir Prus
@ 2006-11-10 16:34 ` Nick Roberts
2006-11-10 16:53 ` Vladimir Prus
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Nick Roberts @ 2006-11-10 16:34 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 16:34 ` Nick Roberts
@ 2006-11-10 16:53 ` Vladimir Prus
2006-11-10 20:47 ` Nick Roberts
2006-11-10 17:02 ` Andreas Schwab
2006-11-10 21:46 ` Eli Zaretskii
2 siblings, 1 reply; 13+ messages in thread
From: Vladimir Prus @ 2006-11-10 16:53 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 16:34 ` Nick Roberts
2006-11-10 16:53 ` Vladimir Prus
@ 2006-11-10 17:02 ` Andreas Schwab
2006-11-10 21:46 ` Eli Zaretskii
2 siblings, 0 replies; 13+ messages in thread
From: Andreas Schwab @ 2006-11-10 17:02 UTC (permalink / raw)
To: Nick Roberts; +Cc: Vladimir Prus, gdb
Nick Roberts <nickrob@snap.net.nz> writes:
> 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"}
In which case I think status is a typo and should actually have been attr,
like this:
attr=ATTR [ ( ,ATTR )* ]
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 16:53 ` Vladimir Prus
@ 2006-11-10 20:47 ` Nick Roberts
2006-11-10 21:06 ` Vladimir Prus
0 siblings, 1 reply; 13+ messages in thread
From: Nick Roberts @ 2006-11-10 20:47 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb
> > 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.
That's still a bit vague.
You say:
How about changing the above to "editable=0/1"?
Are you suggesting
^done,attr="editable=0", ^done,attr="editable=1"
or
^done,editable="0", ^done,editable="1"
Either case still requires the front end to do some string
manipulation/comparison. Can you state precisely how you would change the
format and precisely what the benefit would be?
> > > 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.
I see, I missed that. In fact it my example was also wrong too, constants
in C appear to be editable. Noneditables appear to be arrays, structures,
unions etc. However I think this a separate issue to changing the syntax.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 20:47 ` Nick Roberts
@ 2006-11-10 21:06 ` Vladimir Prus
2006-11-10 21:23 ` Nick Roberts
0 siblings, 1 reply; 13+ messages in thread
From: Vladimir Prus @ 2006-11-10 21:06 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb
On Friday 10 November 2006 23:43, Nick Roberts wrote:
> > > 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.
>
> That's still a bit vague.
>
> You say:
>
> How about changing the above to "editable=0/1"?
>
> Are you suggesting
>
> ^done,attr="editable=0", ^done,attr="editable=1"
>
> or
>
> ^done,editable="0", ^done,editable="1"
The latter.
> Either case still requires the front end to do some string
> manipulation/comparison.
I don't follow -- every syntax requires some string manipulation. In
fact, "name=value" syntax is used in many other places so frontend already
knows how to parse it.
> Can you state precisely how you would change the
> format and precisely what the benefit would be?
The benefit is consistency with other MI response.
> > > > 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.
>
> I see, I missed that. In fact it my example was also wrong too, constants
> in C appear to be editable. Noneditables appear to be arrays, structures,
> unions etc. However I think this a separate issue to changing the syntax.
I meant to say that this command does not seem to have useful semantic, so
backward compatibility is not that important with it.
- Volodya
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 21:06 ` Vladimir Prus
@ 2006-11-10 21:23 ` Nick Roberts
0 siblings, 0 replies; 13+ messages in thread
From: Nick Roberts @ 2006-11-10 21:23 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb
> > Are you suggesting
> >
> > ^done,attr="editable=0", ^done,attr="editable=1"
> >
> > or
> >
> > ^done,editable="0", ^done,editable="1"
>
> The latter.
>
> > Either case still requires the front end to do some string
> > manipulation/comparison.
>
> I don't follow -- every syntax requires some string manipulation. In
> fact, "name=value" syntax is used in many other places so frontend already
> knows how to parse it.
>
> > Can you state precisely how you would change the
> > format and precisely what the benefit would be?
>
> The benefit is consistency with other MI response.
I'm still not clear as you've not said what new attribute(s) you want to
introduce. Perhaps, as an alternative, they could be added to the output of
-var-info-expression. I think the best thing to do is submit a patch.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 16:34 ` Nick Roberts
2006-11-10 16:53 ` Vladimir Prus
2006-11-10 17:02 ` Andreas Schwab
@ 2006-11-10 21:46 ` Eli Zaretskii
2006-11-10 21:54 ` Nick Roberts
2 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2006-11-10 21:46 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb
> From: Nick Roberts <nickrob@snap.net.nz>
> Date: Sat, 11 Nov 2006 05:29:57 +1300
> Cc: gdb@sources.redhat.com
>
> (Perhaps { a | b } should be documented in "Notation and Terminology".)
It already is, AFAICS.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 21:46 ` Eli Zaretskii
@ 2006-11-10 21:54 ` Nick Roberts
2006-11-10 23:10 ` Eli Zaretskii
0 siblings, 1 reply; 13+ messages in thread
From: Nick Roberts @ 2006-11-10 21:54 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
> > (Perhaps { a | b } should be documented in "Notation and Terminology".)
>
> It already is, AFAICS.
What's to say {} aren't literal? (Which, of course, they are in the output
syntax.)
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 21:54 ` Nick Roberts
@ 2006-11-10 23:10 ` Eli Zaretskii
2006-11-10 23:33 ` Nick Roberts
0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2006-11-10 23:10 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb
> From: Nick Roberts <nickrob@snap.net.nz>
> Date: Sat, 11 Nov 2006 10:50:07 +1300
> Cc: gdb@sources.redhat.com
>
> > > (Perhaps { a | b } should be documented in "Notation and Terminology".)
> >
> > It already is, AFAICS.
>
> What's to say {} aren't literal? (Which, of course, they are in the output
> syntax.)
Sorry, I no longer understand the problem you were talking about.
AFAICS, the `{}' are literal (and so don't need to be discussed),
while `|' is _not_ a literal character and is already documented in
"Notation and Terminology". What am I missing?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 23:10 ` Eli Zaretskii
@ 2006-11-10 23:33 ` Nick Roberts
2006-11-11 9:26 ` Eli Zaretskii
0 siblings, 1 reply; 13+ messages in thread
From: Nick Roberts @ 2006-11-10 23:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
> Sorry, I no longer understand the problem you were talking about.
> AFAICS, the `{}' are literal (and so don't need to be discussed),
> while `|' is _not_ a literal character and is already documented in
> "Notation and Terminology". What am I missing?
From "GDB/MI Variable Objects" in the manual:
lang=LANG-SPEC,exp=EXPRESSION
where LANG-SPEC is `{"C" | "C++" | "Java"}'.
means e.g lang="C" not lang={"C"}
status=ATTR [ ( ,ATTR )* ]
where ATTR is `{ { editable | noneditable } | TBD }'.
means e.g attr="editable" not attr={{"editable"}}
As Andreas says, status=ATTR should be attr=ATTR. Also editable | noneditable
should presumably be strings:
where ATTR is `{ { "editable" | "noneditable" } | TBD }'.
Having said that I always find it hard to use one syntax to describe another
in an unambiguous way and it's not that hard to find out what is meant by
invoking GDB with MI.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-10 23:33 ` Nick Roberts
@ 2006-11-11 9:26 ` Eli Zaretskii
2006-11-11 10:03 ` Nick Roberts
0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2006-11-11 9:26 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb
> From: Nick Roberts <nickrob@snap.net.nz>
> Date: Sat, 11 Nov 2006 12:29:50 +1300
> Cc: gdb@sources.redhat.com
>
> >From "GDB/MI Variable Objects" in the manual:
>
> lang=LANG-SPEC,exp=EXPRESSION
>
> where LANG-SPEC is `{"C" | "C++" | "Java"}'.
>
> means e.g lang="C" not lang={"C"}
Then I think the braces `{}' should be simply removed from the
description in the manual.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: -var-show-attributes response syntax
2006-11-11 9:26 ` Eli Zaretskii
@ 2006-11-11 10:03 ` Nick Roberts
0 siblings, 0 replies; 13+ messages in thread
From: Nick Roberts @ 2006-11-11 10:03 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
> > lang=LANG-SPEC,exp=EXPRESSION
> >
> > where LANG-SPEC is `{"C" | "C++" | "Java"}'.
> >
> > means e.g lang="C" not lang={"C"}
>
> Then I think the braces `{}' should be simply removed from the
> description in the manual.
Yes that would work here but not in other places:
-var-create {NAME | "-"}
{FRAME-ADDR | "*"} EXPRESSION
-var-update [PRINT-VALUES] {NAME | "*"}
where the braces make the extent of the alternatives unambiguous.
I think the section is intelligible even if not formally correct. Since MI
is likely to change I suggest we improve it later.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-11-11 10:03 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-10 13:55 -var-show-attributes response syntax Vladimir Prus
2006-11-10 16:34 ` Nick Roberts
2006-11-10 16:53 ` Vladimir Prus
2006-11-10 20:47 ` Nick Roberts
2006-11-10 21:06 ` Vladimir Prus
2006-11-10 21:23 ` Nick Roberts
2006-11-10 17:02 ` Andreas Schwab
2006-11-10 21:46 ` Eli Zaretskii
2006-11-10 21:54 ` Nick Roberts
2006-11-10 23:10 ` Eli Zaretskii
2006-11-10 23:33 ` Nick Roberts
2006-11-11 9:26 ` Eli Zaretskii
2006-11-11 10:03 ` Nick Roberts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox