This is the mail archive of the gdb@sources.redhat.com 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: probing GDB for MI versions


On Mon, Oct 04, 2004 at 07:01:28AM +0200, Eli Zaretskii wrote:
> > Date: Sun, 3 Oct 2004 13:01:04 -0400
> > From: Bob Rossi <bob@brasko.net>
> > 
> > gdb --mi-protocols
> > MI1
> > MI2
> > MI3
> > 
> > What does everyone think? With this command, it would be safe to say
> > that I could always probe GDB to figure out what version of MI the front
> > end should use with the current GDB.
> 
> If at all, I'd prefer this to be an MI command, not a command-line
> switch.

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. So, you can not call an MI function to figure out what version
to start GDB with.

I think it has to be a command line switch, although I'm open to
suggestions.

The more I think about it, we could change the command to be something
like --list-interfaces and it could look something like,

gdb --list-interfaces
annotate1
annotate2
annotate3
mi1
mi2
mi3

> It won't solve this problem, of course:
> 
> > The only problem with this approach is that it obviously won't work for
> > GDB's before this command was implemented. However, in that case, the
> > user can either assume MI1 (if that's the only publically released
> > version) or they can try MI2.
> 
> 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.

Thanks, 
Bob Rossi


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