Re[2]: complete GDB MI specification

Konstantin Karganov
2004-12-07T18:42:26Z

Hello Eli,

>> I'm going to implement a GUI debugger over GDB and need a complete
>> description of MI commands and their result formats. Where can I find
>> it?
> In general, in the manual.
"Note that the current ``grammar'' in the MI documentation, at least as
far as I'm concerned, is meant to be an informal introduction of the
MI syntax, not a rigurous grammar description." (Ã±) Eli Zaretskii :)

And this is the problem! MI is supposed to be a program-to-program
interface and thus needs a complete formal description (at least, to be
sure that all possible output is handled correctly).

> There was a long series of discussions about a month ago, either here
> or on gdb-patches. Search for "MI" in the archives, and you will find
> a patch with a formal parser grammar for the MI interface.
Looked through several (a lot, actually!) discussions and didn't found
what I need. There were several syntax patches and grammar
transformations (mostly by Bob Rossi and Michael Chastain), but all of
them concern general syntax of MI output but don't go into details and
the output semantics.

> Please report all such unclear cases, and I will try to fix them.
Look at the structure of MI description: there are the command syntax
with explanation and the example of the output. Just an example
instead of complete output specification. Yes, it fits the general case
of " var=value (,var=value)* " syntax but the actual semantics and
possible value pairs are not specified. That is for all commands.

Another practical example: displaying the value of the array variable.
It turns out, that the value of the array fits the "c-string" grammar
terminal symbol. But the inner structure of this string is not
specified. I expected that there should be a list of values of the
array length, but it turned out that there is at least one
optimization in the form of "X <repeated N times>". What other tricks
are possible in value string? :)

Anyway, it looks weird if no rigorous specification of MI output
exist. IMHO it means (if it is) that no one uses MI in real systems
(except the tests and demo purposes)...

--
Best regards,
Konstantin