Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: gdb <gdb@sourceware.org>
Subject: Is gdb script execution intended to work this way in async mode?
Date: Sat, 22 Mar 2014 00:13:00 -0000	[thread overview]
Message-ID: <CADPb22T40jXhHOXiPG7jnHxTXrGEPm=vqZwFMFxGJ+1H4cNwbA@mail.gmail.com> (raw)

Hi.
If I source a script in target-async mode, non-asynchronous execution
commands "finish" immediately in the sense that the following command
in the script is done before the previous command has completed (in
the expected sense - the command completes immediately, so to speak,
but continuations are registered to perform the rest of the command,
e.g. to keep stepping until a "next" has fully completed).

I hope this is a bug.

int
main ()
{
  while (1)
    sleep (1);
}

set target-async on
file a.out
start
source foo.gdb

foo.gdb:
next
next

-->

foo.gdb:2: Error in sourced command file:

Cannot execute this command while the selected thread is running.

Turn on the following for better visualization:
set debug infrun 1
set trace-commands on

The second "next" command is executed before the continuations that
implement the completion of the previous "next" command have, umm,
completed.


             reply	other threads:[~2014-03-22  0:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-22  0:13 Doug Evans [this message]
2014-03-24 20:04 ` Pedro Alves
2014-03-25 11:46   ` 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='CADPb22T40jXhHOXiPG7jnHxTXrGEPm=vqZwFMFxGJ+1H4cNwbA@mail.gmail.com' \
    --to=dje@google.com \
    --cc=gdb@sourceware.org \
    /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