From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 9024B3858D20 for ; Fri, 2 Dec 2022 19:36:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9024B3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca 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 2B2JaqiJ026944 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Dec 2022 14:36:57 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 2B2JaqiJ026944 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1670009818; bh=uHR9tL151eOzMrPkUo90mqT+iR+jsixlvc2iwCyGvrU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=jEYhC5eHS3gf5R8AkAV6v1MdmQMZHhegqyAMGh2J+InbBEHsNdZgM8GdDgvWibvqu Ii/fM89HKjreiLjjezJ+LEF7fdx9AIAnTk+eDU1RMRCNRP26gdUCwpfaoLHlbKOBkK NJF+ax248QpDh9+W1RNBcqvGVdS/xgFtLZfvPaxU= Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id ABFE41E112; Fri, 2 Dec 2022 14:36:52 -0500 (EST) Message-ID: <7f956f4e-1418-2e15-c2f1-418d0f2e84d4@polymtl.ca> Date: Fri, 2 Dec 2022 14:36:51 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH 1/3] gdb: add inferior_target_stack_changed observer, use it to clear auxv cache Content-Language: en-US To: Tom Tromey , Simon Marchi via Gdb-patches References: <20221129025048.44490-1-simon.marchi@polymtl.ca> <874jugo3av.fsf@tromey.com> From: Simon Marchi In-Reply-To: <874jugo3av.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 2 Dec 2022 19:36:52 +0000 X-Spam-Status: No, score=-3032.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/30/22 10:44, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> Add an inferior_target_stack_changed observable, and attach > Simon> invalidate_auxv_cache_inf to it. Notify this observable in the > Simon> push_target and unpush_target methods of inferior. > > This looks good to me, thanks. Thanks, will push once the rest of the series is approved. > It seems like overall it would be better to have the auxv cache just be > some member of 'inferior'. Then these indirections and observers > wouldn't be needed -- the inferior could just manage it directly. I kind of like observers, it gives the impression that things are decoupled... but yeah in practice it just adds unnecessary layers of indirection. Simon