From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11211 invoked by alias); 29 Jul 2013 16:45:38 -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 11159 invoked by uid 89); 29 Jul 2013 16:45:38 -0000 X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL,BAYES_20,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Jul 2013 16:45:37 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6TGjTGX012439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 29 Jul 2013 12:45:30 -0400 Received: from barimba.redhat.com (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6TGjPbK023425; Mon, 29 Jul 2013 12:45:29 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 7/8] fix py-finish-breakpoint.exp with always-async Date: Mon, 29 Jul 2013 16:45:00 -0000 Message-Id: <1375116324-32092-8-git-send-email-tromey@redhat.com> In-Reply-To: <1375116324-32092-1-git-send-email-tromey@redhat.com> References: <1375116324-32092-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-07/txt/msg00714.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. 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. * top.c (execute_command): Only dispatch events if command started target. --- gdb/top.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/top.c b/gdb/top.c index 467e6a2..6af0fad 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -426,6 +426,8 @@ execute_command (char *p, int from_tty) { const char *cmd = p; char *arg; + int was_executing = sync_execution && target_has_execution; + line = p; /* If trace-commands is set then this will print this command. */ @@ -481,7 +483,8 @@ 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_executing + && sync_execution && target_has_execution) { while (gdb_do_one_event () >= 0) if (!sync_execution) -- 1.8.1.4