From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31332 invoked by alias); 9 Dec 2013 17:53:00 -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 31320 invoked by uid 89); 9 Dec 2013 17:53:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Dec 2013 17:52:59 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB9HqpSD018371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Dec 2013 12:52:51 -0500 Received: from barimba (ovpn-113-93.phx2.redhat.com [10.3.113.93]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB9HqnFl028749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Dec 2013 12:52:50 -0500 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v4 8/9] fix py-finish-breakpoint.exp with always-async References: <1382464769-2465-1-git-send-email-tromey@redhat.com> <1382464769-2465-9-git-send-email-tromey@redhat.com> <52813425.6020709@redhat.com> Date: Mon, 09 Dec 2013 17:53:00 -0000 In-Reply-To: <52813425.6020709@redhat.com> (Pedro Alves's message of "Mon, 11 Nov 2013 19:46:45 +0000") Message-ID: <87fvq1gbda.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-12/txt/msg00349.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Tom> However, the code did not follow this comment -- it didn't check to Tom> see if the command started the target, just whether the target was Tom> executing a sync command at this point. Pedro> Can you explain this a little better, please? We'll see :) Pedro> IIUC (I haven't really stepped through the code): Pedro> - A synchronous execution command is run. sync_execution is set. Pedro> - A python breakpoint is hit, and the corresponding stop Pedro> method is executed. While python commands are executed, Pedro> interpreter_async is forced to 0. Pedro> - The Python stop method happens to execute a not-execution-related Pedro> gdb command ("where 1"). Pedro> - Seeing that sync_execution is set, GDB nests a new event loop, Pedro> although that wasn't necessary. Pedro> - Some event that causes a stop triggers in the inferior, and Pedro> normal_stop is called. Ok to here. And this step is where I think the bug lies -- the comment in execute_command explains the logic here, but the code doesn't faithfully implement it. Pedro> - the nested event loop unwinds/ends, and normal_stop is called Pedro> again. (IOW, normal_stop was called Pedro> twice for the same event.) The assertion triggers. I think the event is not handled twice. Instead the second time the event is TARGET_WAITKIND_NO_RESUMED: infrun: target_wait (-1, status) = infrun: -1 [process -1], infrun: status->kind = no-resumed infrun: TARGET_WAITKIND_NO_RESUMED infrun: stop_stepping No unwaited-for children left. infrun: BPSTAT_WHAT_STOP_NOISY infrun: stop_stepping Pedro> Is that accurate? Pedro> What happens if the Python stop method actually does run an Pedro> execution command? I can find out -- but note that we explicitly disavow this in the manual, so in a sense it doesn't matter. Tom