From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5ukLNTwwBmogrjoAWB0awg (envelope-from ) for ; Thu, 14 May 2026 16:27:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1778790460; bh=FQeMMQXaNi2Zv3ONO3AT8dYnZcHiZRfV80Sllp9pKJA=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=xCaHNwWmDQSbwXlhJkY92wE5IW6+/n12l++pkFsy1lyA1RIsayLQLn4VRFJRuShAb fuvBIxUEYcR2+zfyuHlp4nE2BZ2rM886+uomitaAz4q2fqU9MtNM7QJU2b6BiOV5bT 169Am7D5e2WgtmWWp33aQVS/orjLg3I+ZFhTG+2c= Received: by simark.ca (Postfix, from userid 112) id BE7E21E067; Thu, 14 May 2026 16:27:40 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ukX8lGM3; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 295B61E067 for ; Thu, 14 May 2026 16:27:39 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D565E4C91779 for ; Thu, 14 May 2026 20:27:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D565E4C91779 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ukX8lGM3 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 6AD064BA2E0F for ; Thu, 14 May 2026 20:26:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AD064BA2E0F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6AD064BA2E0F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778790416; cv=none; b=Q49SEVnpFPxNd983MXy9wwoSFVABuGNhwYog29+hoMK06srNAwDvcNfDHkiCNZbcMTHAahs479GzSZgFPdjNYyO6mUZ7ub4ie/4nQZUL1NuF0MnrXf4dcso3H7r/9MYTgLEpfxYMcilSgfO1LiNQbJMh0GI6f0zknxQeALa0Gsk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778790416; c=relaxed/simple; bh=FQeMMQXaNi2Zv3ONO3AT8dYnZcHiZRfV80Sllp9pKJA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=UkqOriPgpO0RrPO76PsrSYaRAKFd3Jx32AuPIkGTcktHs0BjWxRjDXnHXdQVOpB7Nyc+lO9KD/rn5y4KGHa0bxEwHD6kMUYG3jaKGan3fIuX47LRwVb8MPywXKpMuWdLMLkgyqpj/or6m4Rq5BcB3BdpufN03WANLQPR5g1k+PY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ukX8lGM3 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AD064BA2E0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1778790414; bh=FQeMMQXaNi2Zv3ONO3AT8dYnZcHiZRfV80Sllp9pKJA=; h=Date:Subject:To:References:From:In-Reply-To:From; b=ukX8lGM3kgHzkG7VvkbPUN2pAlEf4nDzgXhhdkmrm4EXVAi4AAMj3DLtOOsTSb0MJ 35kgwdn2P5gH9x+QdGBTbVw1iyMMYmyTlUdSU7usIbm2BlwWjgfTim1k0WISzP9sfL KgdK6G/U/pyne0sJP1p4uU5B1JMfJE4lohfvNwd0= Received: by simark.ca (Postfix) id 724501E067; Thu, 14 May 2026 16:26:54 -0400 (EDT) Message-ID: <1f7b28b1-6929-47f0-b183-abaabc94e46b@simark.ca> Date: Thu, 14 May 2026 16:26:54 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb: pass inferior argument to inf_child_target::maybe_unpush_target To: Andrew Burgess , gdb-patches@sourceware.org References: <4a06ca5986e36021a3ca4c47020cd3f8daee16a7.1778600715.git.aburgess@redhat.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <4a06ca5986e36021a3ca4c47020cd3f8daee16a7.1778600715.git.aburgess@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2026-05-12 11:45, Andrew Burgess wrote: > @@ -2594,9 +2594,9 @@ procfs_target::mourn_inferior () > destroy_procinfo (pi); > } > > + inferior *inf = current_inferior (); > generic_mourn_inferior (); > - > - maybe_unpush_target (); > + maybe_unpush_target (inf); You wrote it this particular way because generic_mourn_inferior could switch inferior, as you explained in your commit message. I think it would deserve a comment at all these spots to explain that we capture the current inferior before "generic_mourn_inferior", because that function can switch the current inferior. Otherwise, it would be very easy for someone (like me) to "optimize out" the temporary variable without realizing the behavior change. Otherwise I think it's fine, one little baby steps towards using less "current inferior" everywhere. Simon