This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [mi] -list-features


On Friday 31 August 2007 13:33:03 Nick Roberts wrote:
>  > > 		Example output:
>  > > 
>  > > 			^done,result=["feature1","feature2"]
>  > 
>  > This is much better, IMO; now it's perfectly clear what front ends
>  > should expect.
> 
> Actually, I think that the output syntax means it should be something like:
> 
> ^done,result=[name="feature1",name="feature2"]

From MI grammar:

	result-record â
        	  [ token ] "^" result-class ( "," result )* nl

	result-class â
          "done" | "running" | "connected" | "error" | "exit"

	result â
        	 variable "=" value

Given 

	^done,result=["feature1","feature2"]

"done" is result class, and

	result=["feature1","feature2"]

is the 'result' nonterminal -- where 'result' is the name and

	["feature1","feature2"]

is the value. Now back to grammar:

	value â const | tuple | list

	list â "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
	

So clearly, 

	["feature1","feature2"]

is a valid list and the output I gave is also valid. What you wrote:

	^done,result=[name="feature1",name="feature2"]

is also permitted by the current grammar, but I don't see any possible
meaning in the "name=". I believe using variable names inside lists
is old usage, and new commands should not do that. In contrast, tuples are
in the form:

	{name1=value1,name2=value2,....}

and the names are required for tuples. Are you sure you haven't confused tuples
and lists?

- Volodya


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]