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: [PATCH] doc: Add table of MI versions


On 2019-01-16 12:03, Eli Zaretskii wrote:
I don't think we require front ends to use the lowest common
denominator.  Instead, it should request
max(version_known_by_the_front_end, version_known_by_gdb).

And I think version_known_by_gdb needs this command, doesn't it?

There are multiple strategies to find this information, this could be one. A front end could start GDB with "-i=mi" and issue -mi-version to get it. It can then determine whether that version is satisfactory or if it should restart GDB with an earlier version of MI.

Another strategy, for a frontend that knows mi1, mi2 and mi3, could be to try to start GDB with "-i=mi3" first. If GDB exits immediately with "Interpreter `mi3' unrecognized", try with mi2, and so forth.

The frontends I have worked with parse the output of "gdb --version" to find the GDB version, so they could deduce which MI version to use based on that. It's not pretty, since different builds of GDB can have different looking version strings but it works well enough. Knowing the GDB version is usually needed anyway, because they need to work around a variety of bugs, not necessarily related to MI.

Simon


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