This is the mail archive of the
mailing list for the GDB project.
Output of CLI commands under --interpreter=mi
- From: Jim Ingham <jingham at apple dot com>
- To: <gdb at sources dot redhat dot com>
- Date: Sun, 21 Apr 2002 11:47:15 -0700
- Subject: Output of CLI commands under --interpreter=mi
I don't think you want any CLI command to output with the cli printer.
There are still cli commands that don't have an equivalent mi command, and
these need to come out properly packaged...
We did this for Apple's GDB and use with Project Builder in a slightly
different way. First we made interpreters switchable (so there is a "set
interpreter" command that you can use within gdb). When you are debugging
MI stuff in gdb, this itself is a big bonus! Then I added a command to the
mi: "-interpreter-exec", which allows you to run a command as if it were run
under another interpreter - for instance "-interpreter-exec console list".
For symmetry, we should probably add an "interpreter exec" command to gdb,
but I haven't needed it yet, so I haven't done that...
This will do what you want, I think... This code is all in the gdb on
Apple's OpenSource site if you want to have a look at it. The part of it
that is done works well, we use it all the time.
I have not yet submitted any of this because this bit is only half of a
larger project, which is to include the Tcl interpreter from Insight as a
third interpreter in this setup. Tcl is harder because to do it you also
have to get the event loops coordinated between the two. I think I know
roughly how to do this, but since we don't actually need this for anything
we use gdb for at Apple, I have never had time to complete it.
> Nick Roberts is working on changing gud.el in Emacs to use the GDB/MI
> interface instead of the current --fullname option. I think it's a
> terrific move, but there's a snag which I believe should be hit by
> almost any front end to GDB: the MI output format.
> The problem is that a front end, certainly the GUD, should be able to
> let the user type the normal CLI commands as well. GDB/MI does
> accept CLI input (and should continue doing so), but the output is
> always in MI format, which is unpalatable to humans.
> Is it possible to change GDB/MI so that CLI commands get responded with
> the CLI-style output, while MI commands get the MI style output?
Jim Ingham email@example.com
Developer Tools - gdb