This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: MI handshaking
Here is a patch for the MI handshaking code. In case you forgot, here is
how it acts from the client's perspective,
$ ./gdb -i=mi
handshake={stable_protocols={mi2}}
~"GNU gdb 6.3.50.20050105-cvs\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\"."
~"\n"
~"Setting up the environment for debugging gdb.\n"
&"No symbol table is loaded. Use the \"file\" command.\n"
&"No symbol table is loaded. Use the \"file\" command.\n"
&".gdbinit:8: Error in sourced command file:\n"
&"No breakpoint number 0.\n"
(gdb)
-handshake-info
^done,stable_protocol="2"
(gdb)
There are several things to note from this patch,
1. The new 'handshake-info' command. It is intended to give all the
information that the user selected during the handshaking phase of
the MI protocol. So far the only thing worth showing is the protocol
version that was selected
2. If the GDB being queried was tested with and supports multiple
protocols of MI, then GDB will block waiting for a response.
3. The handshaking protocol is not in the typical MI syntax. Is this
OK?
Finally, the testsuite will have to change before this commit is OK. Any
pointers on how to add the 'handshake={stable_protocols={mi2}}' to every
testcase?
Thanks,
Bob Rossi