Re:[MI] -stack-list-variables

Nick Roberts
2009-09-19T22:41:04Z

> ...The new command is called -stack-list-variables,
> and it's checked in into CVS HEAD.

I don't like this patch/commit for a couple of reasons. One reason I
proposed such a command was to move away from the loose syntax that MI
uses. In particular to move away from:

`LIST ==>'
` "[]" | "[" VALUE ( "," VALUE )* "]" | "[" RESULT ( "," RESULT )* "]" '

to

`LIST ==>'
` "[]" | "[" VALUE ( "," VALUE )* "]" '

to provide a more JSON-like syntax.

As with -stack-list-locals, the new output can give something like:

-stack-list-variables --no-values
^done,variables=[name="i",name="j",name="asdf",name="m",name="zxcv",name="qwert"]

but to keep JSON-like syntax, this needs to be:

-stack-list-variables --no-values
^done,variables=[{name="i"},{name="j"},{name="asdf"},{name="m"},{name="zxcv"},{name="qwert"}]

which leads to my second point:

Which `variables' are the arguments and which are locals?
Arguments might be a kind of local but they're not identical.

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

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