Re: -var-show-attributes response syntax

Nick Roberts
2006-11-10T20:47:51Z

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