Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jonah Graham <jonah@kichwacoders.com>
To: Robert Rossi <bob@brasko.net>
Cc: Pedro Alves <palves@redhat.com>, GDB Development <gdb@sourceware.org>
Subject: Re: gdb/mi, new-ui. the console and determining when GDB is ready for the next command
Date: Sat, 02 Nov 2019 17:39:00 -0000	[thread overview]
Message-ID: <CAPmGMvgbJdwvOjNWvpO3ux75cZ-1tHXZM5n_9OBsLwpgUTvG3A@mail.gmail.com> (raw)
In-Reply-To: <CA+L9JkjNN6WS-Uone-sWPOt_9WxCJ3bY0rBzpo66ZzkhVqt+SA@mail.gmail.com>

Hi Bob,

Robert Rossi <bob@brasko.net> 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


  reply	other threads:[~2019-11-02 17:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+L9JkgmjPjVBrmSJ1xLyWJM7Lmk9gdWK1zUg9ctd2G_8vwDZA@mail.gmail.com>
2019-10-25  9:58 ` Robert Rossi
2019-10-29 13:21 ` Pedro Alves
2019-11-02 10:35   ` Robert Rossi
2019-11-02 17:39     ` Jonah Graham [this message]
2019-11-05 14:06     ` Pedro Alves
2020-04-11 12:12       ` Bob Rossi
2020-04-11 14:09         ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPmGMvgbJdwvOjNWvpO3ux75cZ-1tHXZM5n_9OBsLwpgUTvG3A@mail.gmail.com \
    --to=jonah@kichwacoders.com \
    --cc=bob@brasko.net \
    --cc=gdb@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox