From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CC8DE3858D1E for ; Tue, 25 Apr 2023 15:59:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC8DE3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682438363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wK0DGqFA3Eld4u5nxsFAlx87IuW5lAOqpijOdkkCEQY=; b=RYnI+dpssLKV5MV/+wiBlJYDVz/hc03fLM6gdD3dGGqtEeKXppcuyY72+Y8clMi0wcyNe7 En/k1N+L9jypr4lsb0uM/SQ/bN9hDnpc8hN2CSZon06oHT01Ed26pC4eGdsTF63hBxNioX MkKVl1sVEMwN2/xHjwyn9zoC4afX0Rw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-63-vwZI9pgSOrSWckcz2yLlpw-1; Tue, 25 Apr 2023 11:59:21 -0400 X-MC-Unique: vwZI9pgSOrSWckcz2yLlpw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F0F388B7A7; Tue, 25 Apr 2023 15:59:21 +0000 (UTC) Received: from [10.22.9.236] (unknown [10.22.9.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 097B914171BB; Tue, 25 Apr 2023 15:59:20 +0000 (UTC) Message-ID: <8c0f108d-d2fb-b5b7-b767-e636db7bff25@redhat.com> Date: Tue, 25 Apr 2023 08:59:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] Environment variable convenience function To: Simon Marchi , gdb-patches@sourceware.org References: <20230423170755.1103121-1-keiths@redhat.com> <331951a0-2148-3489-3dd9-5961489af0bc@simark.ca> From: Keith Seitz In-Reply-To: <331951a0-2148-3489-3dd9-5961489af0bc@simark.ca> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 4/23/23 13:20, Simon Marchi wrote: > On 4/23/23 13:07, Keith Seitz via Gdb-patches wrote: > > I have the feeling that I've seen this before, and had some thoughts > about the name, but I'm not sure I shared it, so here it is. I think it > would be good to disambibuate whether this function reads from GDB's own > environment or the current inferior's environment. Looking at the > implementation it seems, to be GDB's environment. You probably did see this before -- I submitted an RFC which included this feature/patch a while ago. I don't recall seeing your comments before, so I am glad that you're (re)sending them along! > Should we introduce a function that reads the environment of the current > inferior, how would it be named? That is a good idea. I will get that on my TODO list. I presume it would be acceptable to post a follow-up patch? > I'm wondering if, to avoid confusion, this one should be named something > like _gdb_env, and an hypothetical future function that reads the > inferior's environment would be named something like _inferior_env. Yes, I completely agree. I've updated my patch to follow this. I will send a v2. Thank you for the feedback! Keith