This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [MI] -stack-list-variables
Nick Roberts wrote:
> > > How about the format below?:
> > >
> > > -stack-list-variables --no-values
> > > ^done,variables={args=[{name="i"},{name="j"}],
> > > locals=[{name="asdf"},{name="m"},{name="zxcv"},{name="qwert"}]}
> >
> > Why would frontend care about which are locals and which are arguments? I don't
> > think I saw any GUI than distinguish between those in variables view.
>
> CLI treats them as completely different ("info args", "info locals") as MI
> did previously (-stack-list-locals, -stack-list-arguments). To the programmer,
> I think they are quite different: argument values are passed in, local values
> aren't.
That's only the "origin" of the values. Inside the function, parameters and locals
obey exactly the same rules.
> If the front end doesn't care, it can always group these together.
I was saying that all frontends I know do not seem to care, therefore it
does not seem like we should care.
> > Even
> > if we decide this information is necessary, would it not be better to present it
> > like this:
> >
> > ^done,variables=[{name="i", arg="1"},{name="asdf"}]
> >
> > as this format is more extensible in case some other frontend might need
> > even more finer details?
>
> I don't see how this helps. Breaking locals and args down further would require
> a new command for backward compatibilty reasons.
Why? You can always add new field, e.g.
^done,variables=[{name="i", truly-magic-kind-of-symbol="1"},{name="asdf"}]
?
- Volodya