Re: probing GDB for MI versions

Bob Rossi
2004-10-05T12:11:50Z

On Tue, Oct 05, 2004 at 10:59:37AM +0200, Eli Zaretskii wrote:
> > Date: Mon, 4 Oct 2004 09:12:52 -0400
> > From: Bob Rossi <bob@brasko.net>
> > Cc: gdb@sources.redhat.com
> >
> > Yes, I understand, that was my first idea. However, you can see that
> > it is a "catch 22". If you do not know what version of MI to start GDB
> > with, than you can not understand how to parse the output of the MI
> > commands.
>
> I don't see any catch: the output of this specific command could be
> made very simple so that it will not need any parsing, just some
> trivial string matching or at most regexps.

IMHO, it doesn't matter how easy it is to parse the MI output, it should
be done algorithmically. Simple or complicated, the same MI output
parser that parses the entire MI output syntax should be capable of
parsing the command we are suggesting.

The goal is to find out what versions of MI GDB supports so that you can
start GDB up in the highest compatible mode. Right?

How can you start GDB up in MI mode to ask it for the MI versions it
supports? You don't know what MI modes it supports, so you can not start
it in MI mode. That's the catch 22.

> You will need similar machinery for parsing the output of the
> command-line switch you suggested.

Yes, I understand that adding a new command line switch is not the
greatest idea. However, it is the only thing I can think of that allows
a front end to ask GDB what versions of MI it supports, without actually
needing to know anything about the MI, avoiding the catch 22.

Yes I agree that the output of this command line switch could never
really change, that seems like a pretty negitive point.

> > > To solve that, a front end that is willing to support old versions of
> > > GDB will need to have a database of old GDB versions and the MI
> > > versions they supported.
> >
> > I don't see what the GDB versions have to do with, am I missing
> > something? I am only interested in the MI versions.
>
> New MI versions always come with new GDB versions, right?

I understand now, I think it would be impossible to figure out what
"GDB version" a GDB CVS snapshot is, do you agree? So there would be no
way to use a database.

Thanks,
Bob Rossi