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

Jonah Graham <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAPmGMvgbJdwvOjNWvpO3ux75cZ-1tHXZM5n_9OBsLwpgUTvG3A@mail.gmail.com>
Hi Bob,

Robert Rossi <[email protected]> wrote:
>
> 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?
>

Eclipse CDT uses gdb for the backend debugger, and it does not actually use
the (gdb) prompt except to establish initial connection with gdb. After
that Eclipse tracks state of gdb to know when it can send commands. So in
your example, CDT looks for messages such as *stopped to know when gdb is
stopped and can accept commands. In non-stop mode you further track the
running threads to know which you can communicate with. For MI commands CDT
sends, it knows when they are done by tracking their ^done messages, it
also sends multiple commands at a time before waiting for answers.

> In this case also there is no gdb prompt.

This happens in the reverse case too, when MI issues a step or similar the
CLI terminal does not get a new (gdb) prompt.

> Is this expected behavior or an oversight?

I am used to this behaviour, but I can't comment on whether it is expected
or not, e.g I can type cont<enter> even though no fresh (gdb) prompt:

(gdb)
Breakpoint 5, main () at ../src/helloworld.c:26
26              printf("&x=%p\n", &x);
cont
Continuing.
[Inferior 1 (process 15248) exited normally]
(gdb)

HTH
Jonah
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.