From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0KPMI3//JmEPGQAAWB0awg (envelope-from ) for ; Wed, 25 Aug 2021 22:42:07 -0400 Received: by simark.ca (Postfix, from userid 112) id 7DDDE1EE1B; Wed, 25 Aug 2021 22:42:07 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED 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 BD24F1EDF5 for ; Wed, 25 Aug 2021 22:42:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C68C63858001 for ; Thu, 26 Aug 2021 02:42:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C68C63858001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629945725; bh=sRqso8VACkEmMKRxwvp33KUU51GZn4ogTacdNfQBUrI=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=DOv70ojaXSgBZI/jjvyJ9W0XSFbqowLMIxwzBAnfC6Wf9F1hcL1Z6gpnDId2Z4HIW hLDgtBa09SfLVxyOqn1L7z08FUSTCZudcEvYKd+v/qVBmdFAT7mUPib5o4cyN/F5IE 9Z2XU77d2JqRBUcUyJSrqPX6Il4KtW4y3ezYNjw4= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 143823858D34 for ; Thu, 26 Aug 2021 02:41:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 143823858D34 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 17Q2fJVv027749 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Aug 2021 22:41:24 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 17Q2fJVv027749 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AD81D1EDF5; Wed, 25 Aug 2021 22:41:19 -0400 (EDT) Subject: Re: [PATCH] Replace deprecated_target_wait_hook by an observer To: Andrew Burgess , Patrick Monnerat References: <20210822164256.144875-1-patrick@monnerat.net> <20210824161411.GE2581@embecosm.com> <3c65f6cf-0198-2efc-3db9-bbe8aafc58dc@monnerat.net> <20210825161914.GH2581@embecosm.com> Message-ID: <89b1b06a-b45c-c5e6-addd-cc6d37cd83a0@polymtl.ca> Date: Wed, 25 Aug 2021 22:41:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210825161914.GH2581@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 26 Aug 2021 02:41:20 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-08-25 12:19 p.m., Andrew Burgess wrote: > * Patrick Monnerat [2021-08-25 15:30:28 +0200]: > >> >> On 8/24/21 6:14 PM, Andrew Burgess wrote: >>> * Patrick Monnerat via Gdb-patches [2021-08-22 18:42:56 +0200]: >>> >>>> +DEFINE_OBSERVABLE (waiting_for_target); >>> Given we already have events 'target_changed' and 'target_resumed', I >>> wonder if it would be more consistent to name this event 'target_wait'? >>> >> Yes, it's possible. Here are the two reasons why I did not name this >> observer 'target_wait': >> >> 1) Because the observer is not supposed to wait by itself, I fear it will be >> a source of confusion. >> >> 2) As a good old C programmer, I still have some reluctance naming an object >> as a global procedure. Not being declared in the same namespace though! >> >> Comments are welcome! > > How about 'target_waiting' then? This seems more inline with the > existing naming, seems to indicate that the target _is_ waiting, not > the that observer _should_ wait (so avoiding #1), and is a new name > (so avoiding #2). Oh, I have always seen it as the caller waiting for the target to produce some event (in a context where everything was blocking / not async... nowadays, with async, I always find using the term "wait" for "fetch an event" confusing). So the event would be "target_waited_on". Another way (it's not our current style so I wouldn't choose that) would be to name all events "on something". So "on_target_wait". Regardless, since we are debating this, I would suggest splitting the observer in two actuall: - target_pre_wait (or target_wait_pre or whatever) - target_post_wait (or target_wait_post or whatever) I think it's better to keep 1 observable == 1 event, rather than having two events in one with a boolean to differentiate. >> That would make sense, but in case we have an exception, event_ptid is not >> known. How would you handle it? pass it as null_ptid? > > Yeah I guess that would make sense. I think that's ok, I don't think target_ops::wait implementations ever return null_ptid (although I haven't checked, it's just from memory). Simon