From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by sourceware.org (Postfix) with ESMTPS id 5BE993858D39 for ; Tue, 11 Oct 2022 20:35:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5BE993858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f42.google.com with SMTP id fn7-20020a05600c688700b003b4fb113b86so53344wmb.0 for ; Tue, 11 Oct 2022 13:35:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+lSs2gwLZtP9V4vNN5D7pk5RH/nYdh3pqvISJsDrHtQ=; b=6aM4U77j10ufg6mMs+ygOrOx/gcpJrs9xr0V2XVaIOR1NAIvgg7u6HSHVF7ay3dOfG mHHhzH5Tez0HAtAg634e8xzvx67QhDAxTtfa1CApdD8G4lIBauzLePkXohQ8BO7WKGhw QDuc/zSj1LY2AO1Nifxo+Wd3iZ6F86zTAGXpDQGJPvy6qBuEPx9rUMV3XEC+GZ2rJ80b nWiVgyUG3xqk0s0uyUPBGEbo8HWvkOfPZQ+aB2IGUuAkFa+M+bJDbU1iWrYAjTWOJI0+ 07U2u2dacphAUgWhcxpXictNn/cxXDFVbUGyT9tVNnqBNmTEK3v0XbNu/mvcG1uihFmW FYTg== X-Gm-Message-State: ACrzQf3245tBCTtbxpoMRWXbRzGePI/xfIxuz2X9/V6XHdQMHwJrpf30 EvSTeEnjop1MgbRM1x9gJZAj9A7OkXHFLA== X-Google-Smtp-Source: AMsMyM63iylbT1RcHIryDrJmNYEOfWXMYg42rJ4yBNrMoOEV/oRy/x0hN7JerzjJ4yEq+fZWky6gRw== X-Received: by 2002:a05:600c:524d:b0:3b4:91ee:933c with SMTP id fc13-20020a05600c524d00b003b491ee933cmr534931wmb.100.1665520499115; Tue, 11 Oct 2022 13:34:59 -0700 (PDT) Received: from ?IPv6:2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653? ([2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653]) by smtp.gmail.com with ESMTPSA id j11-20020a5d448b000000b0022efc4322a9sm10708003wrq.10.2022.10.11.13.34.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Oct 2022 13:34:57 -0700 (PDT) Subject: Re: [PATCH] gdb: fix auxv caching From: Pedro Alves To: Simon Marchi , John Baldwin , gdb-patches@sourceware.org References: <20220920122828.188190-1-luis.machado@arm.com> <20221007204440.3041413-1-simon.marchi@polymtl.ca> <6e3e1ac0-0afc-d053-b48e-a7d20549d1d7@FreeBSD.org> Message-ID: <9379684a-ec46-6b17-c785-c8c308cb2924@palves.net> Date: Tue, 11 Oct 2022 21:34:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, 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 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: , X-List-Received-Date: Tue, 11 Oct 2022 20:35:05 -0000 On 2022-10-11 9:31 p.m., Pedro Alves wrote: > On 2022-10-09 1:39 a.m., Simon Marchi via Gdb-patches wrote: >> >>> I think this approach is fine.  Having two variants of target_read_auxv is >>> a bit verbose, and I'm not sure it's abundantly clear to a new person when >>> to use one vs the other.  That said, these are used rarely, so probably >>> will intuit the right thing by looking at existing uses.  I agree with the >>> idea that the auxv reads during gdbarch_core_read_description should >>> effectively all be "raw" and uncached. >> >> The second one is perhaps not essential, call sites could call >> >> target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL) >> >> themselves. But I find it convenient to have this little wrapper. >> >> As to how to know which overload to call, perhaps that can be improved >> with better documentation and comments. I'm not sure what to add >> though, the problem is so fresh in my mind that it's obvious to me. So >> I'm open to suggestions. > > Maybe call the one that works with the cache, target_read_auxv_cached ? > Or the other one target_read_auxv_raw, of course. > Two overloads that do different things is a sign that they shouldn't be > overloads, to me. >