From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32475 invoked by alias); 4 Mar 2014 18:40:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32459 invoked by uid 89); 4 Mar 2014 18:40:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Mar 2014 18:40:16 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s24IX2JJ012442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Mar 2014 13:33:04 -0500 Received: from barimba.redhat.com (ovpn-113-183.phx2.redhat.com [10.3.113.183]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s24IWtjZ012049; Tue, 4 Mar 2014 13:33:01 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC v5 6/8] fix py-finish-breakpoint.exp with always-async Date: Tue, 04 Mar 2014 18:40:00 -0000 Message-Id: <1393957974-4521-7-git-send-email-tromey@redhat.com> In-Reply-To: <1393957974-4521-1-git-send-email-tromey@redhat.com> References: <1393957974-4521-1-git-send-email-tromey@redhat.com> X-SW-Source: 2014-03/txt/msg00091.txt.bz2 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. 2013-10-30 Tom Tromey PR gdb/14135: * top.c (execute_command): Only dispatch events if command started target. --- gdb/ChangeLog | 6 ++++++ gdb/top.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/top.c b/gdb/top.c index e1a1331..fa20025 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -406,6 +406,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. */ @@ -461,7 +463,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) -- 1.8.1.4