From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YLaVNd3cI2HENQAAWB0awg (envelope-from ) for ; Mon, 23 Aug 2021 13:37:33 -0400 Received: by simark.ca (Postfix, from userid 112) id D94451EE18; Mon, 23 Aug 2021 13:37:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 824411E813 for ; Mon, 23 Aug 2021 13:37:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CF24B3858010 for ; Mon, 23 Aug 2021 17:37:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF24B3858010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629740252; bh=hUuBiPXBrGihs7i5ptlezO9JSYwL6CiI10q8jCOPz2U=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=pDSKqMOdBkQHmCjHiK8F1egsKDCCks8z0LMWHeM0rFlgJ1jUGx62T0e6QAYBYtCVW jSK0/iXTfnLtVFUFvvKrOb6Nz9ceqP/FAvaXZabIQy1Mq5rYarE+OUWW+Q63JWBmyi 2PeiVbW75kmkHQMJvtok0F1w/aNSV5JB+Z8c3z8g= Received: from jupiter.monnerat.net (jupiter.monnerat.net [46.226.111.226]) by sourceware.org (Postfix) with ESMTPS id AA9533858C2C for ; Mon, 23 Aug 2021 17:37:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA9533858C2C Received: from patrick.monnerat (56.82.193.178.dynamic.wline.res.cust.swisscom.ch [178.193.82.56]) by jupiter.monnerat.net (8.14.8/8.14.8) with ESMTP id 17NHal0C004484 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Aug 2021 19:36:53 +0200 DKIM-Filter: OpenDKIM Filter v2.10.3 jupiter.monnerat.net 17NHal0C004484 Subject: Re: [PATCH] Replace deprecated_target_wait_hook by an observer To: Simon Marchi , gdb-patches@sourceware.org References: <20210822164256.144875-1-patrick@monnerat.net> Message-ID: <934649d9-1f4a-0b3c-a6de-5641c49bb0c6@monnerat.net> Date: Mon, 23 Aug 2021 19:36:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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: Patrick Monnerat via Gdb-patches Reply-To: Patrick Monnerat Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 8/23/21 6:26 PM, Simon Marchi wrote: > Can you show to the > corresponding change in Insight? I'm curious to see how Insight uses > this. > Hi Simon, Sure! Here is the important part of the Insight diff: ----- --- a/gdbtk/generic/gdbtk-hooks.c +++ b/gdbtk/generic/gdbtk-hooks.c @@ -685,16 +685,19 @@ gdbtk_post_add_symbol (void)  /* This hook function is called whenever we want to wait for the     target.  */ -static ptid_t -gdbtk_wait (ptid_t ptid, struct target_waitstatus *ourstatus, void *options) +static void +gdbtk_waiting_for_target (bool enter, ptid_t ptid)  { -  gdbtk_force_detach = 0; -  gdbtk_start_timer (); -  ptid = target_wait (ptid, ourstatus, *(target_wait_flags *) options); -  gdbtk_stop_timer (); -  gdbtk_ptid = ptid; - -  return ptid; +  if (enter) +    { +      gdbtk_force_detach = 0; +      gdbtk_start_timer (); +    } +  else +    { +      gdbtk_stop_timer (); +      gdbtk_ptid = ptid; +    }  }  /* ----- For more details, see Insight commit https://sourceware.org/git/?p=insight.git;a=commit;h=16042bf Patrick