From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17291 invoked by alias); 31 Jul 2013 19:41:21 -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 17263 invoked by uid 89); 31 Jul 2013 19:41:21 -0000 X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO mail-ye0-f201.google.com) (209.85.213.201) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 31 Jul 2013 19:41:20 +0000 Received: by mail-ye0-f201.google.com with SMTP id m14so116366yen.0 for ; Wed, 31 Jul 2013 12:41:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:mime-version:content-type:content-transfer-encoding:message-id :date:to:cc:subject:in-reply-to:references:x-mailer :x-gm-message-state; bh=FCgsUMQbCWwiV6Ee+hWAxr6cqFqdy1iMd4+t8ESAX7g=; b=jejKVFY8tAJjjJ5M8O5+6O/1/zAjbGQA8Lva2GOvjrHGhkflGrOW7PM0+0lLTdtYoL tOzGHjsUWDze0frsMQeKpvacGOMnVZPR3+Sxg1FSlRxrQqjkAIfLvM0DS5Dve+e6lOdo uq2vObLPVU8+OQaxLO9mITwR9bKnZPXjJSNM1N+Euw80/gtpRExwLXhoImtieC3/h+ZJ 5FARgQ1MceXeLxy/6n+DW6iUHKTVgoVunK5/10TKTlKesvpeYiRHg7UWqjXR0SuAiM5G Sq8kzNN5d1mWtZUhguNbXbM6rebCesQ8F7a391edONZAT+RuXegHOXXJnjSPOE8qfWIz hPKQ== X-Received: by 10.236.153.202 with SMTP id f50mr34197436yhk.48.1375299673035; Wed, 31 Jul 2013 12:41:13 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id e64si1271096yhj.1.2013.07.31.12.41.13 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 31 Jul 2013 12:41:13 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 686F531C1EE; Wed, 31 Jul 2013 12:41:12 -0700 (PDT) From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20985.26711.794364.332001@ruffy.mtv.corp.google.com> Date: Wed, 31 Jul 2013 19:41:00 -0000 To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 8/9] fix py-finish-breakpoint.exp with always-async In-Reply-To: <1375295281-7040-9-git-send-email-tromey@redhat.com> References: <1375295281-7040-1-git-send-email-tromey@redhat.com> <1375295281-7040-9-git-send-email-tromey@redhat.com> X-Gm-Message-State: ALoCoQm3R5DMo9xFhuf1AhrGYwS3TFP5FeOTYAYyjmCskJvmRblcHJglIfv4NdSmjqMvXNfqn4E5jVTtNHpcmOQ5h3AcSDC/C1NGTVc6+hU+CXB1ZqaOA91YhMl2nIqwR68D8zdTgAgm6f3lRFkQmeXpeqTfbLMbxZPdLgARPNUpt4zadwgd+6KFkQQl+OFZuAuJVzP0UAlba6NWCvfaLVsTUStP32kAdQ== X-SW-Source: 2013-07/txt/msg00841.txt.bz2 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.