gdb/mi, new-ui. the console and determining when GDB is ready for the next command

Robert Rossi <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CA+L9JkgmjPjVBrmSJ1xLyWJM7Lmk9gdWK1zUg9ctd2G_8vwDZA@mail.gmail.com>
Hi,

The question I have is, how are people determining when GDB is ready for
the next
command when using the new-ui feature of GDB?
Are people parsing the CLI window for (gdb)?
Am I missing something obvious?

CGDB has historically used annotations to communicate with gdb.
This provided pre-prompt and post-prompt annotations to determine when the
GDB prompt
was available and ready for the next command.

A couple of years ago I decided to try to port CGDB from annotations to MI.
At the time I asked the GDB mailing list how to determine when GDB was
ready for the next
command, Pedro Alves wrote:
    GDB is ready for input when it prints the MI prompt.  There's one
prompt that is
    already printed after ^running that you should ignore. That's an
historical wart.
I got CGDB working but never completed the activity when I realized that
using -i=mi
caused GDB to no longer treat the terminal as an interactive terminal.
Meaning, GDB wouldn't do tab completion and/or ask the user if they were
ready to quit.

Now I'm considering trying this again using the GDB new-ui feature.
In this mode the CLI remains in the starting terminal and the MI is moved
to the new-ui tty.
I noticed that in the new-ui window, the MI end token (gdb)\n isn't put
out. Is this intentional?
In this mode, what's the proper way to determine if GDB is ready for
another command?

Thanks,
Bob Rossi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.