probing GDB for MI versions

Bob Rossi
2004-10-03T17:01:05Z

Hi,

I want to figure out the best way to probe GDB for the versions of MI
that it supports. If you know of a better way than the one I'm
suggesting below, please let me know.

I want to add a --mi-protocols flag to GDB, and when it is invoked with
this flag, the only thing that it will output is the versions of MI that
it supports each, on it's own line. For example,

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.

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.

Thanks,
Bob Rossi