This is the mail archive of the
mailing list for the GDB project.
Re: -var-show-attributes response syntax
> > 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.
How about changing the above to "editable=0/1"?
Are you suggesting
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.