From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tXz2J2I2HGCRBgAAWB0awg (envelope-from ) for ; Thu, 04 Feb 2021 13:01:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 8FEAE1EFCB; Thu, 4 Feb 2021 13:01:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9499E1EF7A for ; Thu, 4 Feb 2021 13:01:05 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9E3E393BC11; Thu, 4 Feb 2021 18:01:04 +0000 (GMT) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by sourceware.org (Postfix) with ESMTPS id 30C213874C3E for ; Thu, 4 Feb 2021 18:01:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 30C213874C3E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f50.google.com with SMTP id j11so3916790wmi.3 for ; Thu, 04 Feb 2021 10:01:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ky+T6wpChE1OnJ0BVGUbrdmq0XGxiW7B7IPgIKzoBYY=; b=WtvQDndwuSvhdcyqBZpwLbopTq4YGdsLgTcNKFGwC+3v+opf77KwqS3X70tfejDoC5 5WxAAP2MUBGoUNwXH3QXWpnsRq4wVcf2ek1oVhhxVCekfub4345/QGjd/oInlfbalPsn LMD9iiFsk4k0s0+NK+l+tgTH0XsgxS55gIynYojUZYx3cdqnkVjLOwLadg/pm8QG/1eP i+fX8PkXzXyn+7gHm9opheEzD4aKxh8RcaukoVedK/Zj9x+wARQ61v6AnyUdS8GzNnnS scyzsRLhOO2Dl+HCCoo4tbtTEzUdltRIZ7MyGQWUly42vCmhmLYHb2PJQ3tiAurMVLX6 TbOw== X-Gm-Message-State: AOAM530VbFH51G1ZR8yDyKzM3v3cRxUjMa8Q4ZRRBxZG6W9xZFTUebRw orzakwrx3s1BG9OvZhiQOnuguFQO1mIAkg== X-Google-Smtp-Source: ABdhPJwrPPnb7+33zC8qWAl3LiybiaTdYcBPWkf+YTbWIoFBLTIm2PHnasZzUmgc9cE1aiR03kySFA== X-Received: by 2002:a05:600c:2246:: with SMTP id a6mr338580wmm.170.1612461660621; Thu, 04 Feb 2021 10:01:00 -0800 (PST) Received: from ?IPv6:2001:8a0:f91f:e900:642f:5bb0:6cba:b1bd? ([2001:8a0:f91f:e900:642f:5bb0:6cba:b1bd]) by smtp.gmail.com with ESMTPSA id f4sm9033803wrs.34.2021.02.04.10.00.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Feb 2021 10:00:59 -0800 (PST) Subject: Re: [PATCH 2/4] gdb: make remote target clear its async event handler in wait From: Pedro Alves To: Simon Marchi , gdb-patches@sourceware.org References: <20201130165251.830482-1-simon.marchi@efficios.com> <20201130165251.830482-3-simon.marchi@efficios.com> Message-ID: Date: Thu, 4 Feb 2021 18:00:58 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20201130165251.830482-3-simon.marchi@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 30/11/20 16:52, Simon Marchi via Gdb-patches wrote: > However, the code in remote_async_inferior_event_handler checks for for s/for for/for/ > pending events in addition to whether the stop reply queue is empty, so > I've made remote_target::wait check for that as well. I'm not > completely sure this is ok, since I don't understand very well yet how > the pending events mechanism works. But I figured it was safer to do > this in order to avoid missing events, worst case it just leads to > unnecessary calls to remote_target::wait. It won't hurt, but I think it shouldn't be necessary -- if putpkt_binary or getpkt_or_notif_sane_1 see a notification (search for '%'), we end up in handle_notification, which marks state->get_pending_events_token, which then leads us to: -> remote_async_get_pending_events_handler -> remote_notif_get_pending_events -> remote_notif_stop_ack -> remote_target::push_stop_reply -> mark_async_event_handler (rs->remote_async_inferior_event_token); which then ends up in target_target::wait. I don't recall exactly why I had to put the check for the pending event in remote_async_inferior_event_handler, though. Maybe it was necessary because events auto-cleared back then. Anyhow, this LGTM. Patches #3 and #4 LGTM too. Thanks, Pedro Alves