From: Doug Evans <dje@google.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 8/9] fix py-finish-breakpoint.exp with always-async
Date: Wed, 31 Jul 2013 19:41:00 -0000 [thread overview]
Message-ID: <20985.26711.794364.332001@ruffy.mtv.corp.google.com> (raw)
In-Reply-To: <1375295281-7040-9-git-send-email-tromey@redhat.com>
Tom Tromey writes:
> With target async enabled, py-finish-breakpoint.exp will trigger an
> assertion failure.
>
> The failure occurs because execute_command re-enters the event loop in
> some circumstances, and in this case resets the sync_execution flag.
> Then later gdb reaches this assertion in normal_stop:
>
> gdb_assert (sync_execution || !target_can_async_p ());
>
> execute_command has a comment explaining why it dispatches events:
>
> /* If the interpreter is in sync mode (we're running a user
> command's list, running command hooks or similars), and we
> just ran a synchronous command that started the target, wait
> for that command to end. */
>
> However, the code did not follow this comment -- it didn't check to
> see if the command started the target, just whether the target was
> executing a sync command at this point.
>
> This patch fixes the problem by noting whether the target was
> executing in sync_execution mode before running the command, and then
> augmenting the condition to test this as well.
>
> Built and regtested on x86-64 Fedora 18.
>
> PR gdb/14135:
> * top.c (execute_command): Only dispatch events if command
> started target.
> ---
> gdb/top.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/top.c b/gdb/top.c
> index 33a78da..03038b6 100644
> --- a/gdb/top.c
> +++ b/gdb/top.c
> @@ -427,6 +427,8 @@ execute_command (char *p, int from_tty)
> {
> const char *cmd = p;
> char *arg;
> + int was_sync = sync_execution;
> +
> line = p;
>
> /* If trace-commands is set then this will print this command. */
> @@ -482,7 +484,7 @@ execute_command (char *p, int from_tty)
> command's list, running command hooks or similars), and we
> just ran a synchronous command that started the target, wait
> for that command to end. */
> - if (!interpreter_async && sync_execution)
> + if (!interpreter_async && !was_sync && sync_execution)
> {
> while (gdb_do_one_event () >= 0)
> if (!sync_execution)
> --
Looks ok to me.
next prev parent reply other threads:[~2013-07-31 19:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 18:28 [PATCH v2 0/9] enable target-async by default Tom Tromey
2013-07-31 18:28 ` [PATCH v2 5/9] PR gdb/13860: make "-exec-foo"'s MI output equal to "foo"'s MI output Tom Tromey
2013-07-31 18:28 ` [PATCH v2 6/9] PR gdb/13860: don't lose '-interpreter-exec console EXECUTION_COMMAND''s output in async mode Tom Tromey
2013-07-31 18:28 ` [PATCH v2 4/9] PR gdb/13860: make -interpreter-exec console "list" behave more like "list" Tom Tromey
2013-07-31 18:28 ` [PATCH v2 7/9] make dprintf.exp pass in always-async mode Tom Tromey
2013-07-31 18:28 ` [PATCH v2 3/9] add target method delegation Tom Tromey
2013-07-31 18:28 ` [PATCH v2 8/9] fix py-finish-breakpoint.exp with always-async Tom Tromey
2013-07-31 19:41 ` Doug Evans [this message]
2013-07-31 18:28 ` [PATCH v2 2/9] add "this" pointers to more target APIs Tom Tromey
2013-07-31 18:28 ` [PATCH v2 9/9] enable target-async Tom Tromey
2013-07-31 20:20 ` Doug Evans
2013-07-31 20:26 ` Tom Tromey
2013-08-01 8:34 ` Yao Qi
2013-08-01 15:47 ` Tom Tromey
2013-08-02 19:26 ` Tom Tromey
2013-07-31 18:28 ` [PATCH v2 1/9] fix latent bugs in ui-out.c Tom Tromey
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=20985.26711.794364.332001@ruffy.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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