From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 52F7D3858D28 for ; Tue, 11 Oct 2022 20:42:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 52F7D3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4Mn74y31qBz3xl4; Tue, 11 Oct 2022 20:42:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mn74y29chz3TFw; Tue, 11 Oct 2022 20:42:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665520946; 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=btipVad6UfHTBVUbKv4P7f8SfmJwsDNS1ZGl5xVXCMo=; b=ChHWOwkqmMDET0u/++2kW22yEFWKlSW3A6KkTz3RmnqBnF9FIracIsbUijbNu0Da78bumt NRYDhcB2RuI9VejKfwuXsJQjL2A9GyaGeahlDFcgjQWv7vFzTySt88ZpdTUeg1+h8+350V VU1FKa36LDedsVxd97aXeG8ADDURAh2ky3NgVub9e6RHZj+H1hnu0zI4VNHK25LGSCBgI/ /Nn+UoUcH1BeueZPq/gOW9l9rLkDcLmnmkZa5AEQXOw9DZQcL69E4wiBhWa2k4H1Uqg+dl ljOLaiYgMZCFF5ECnSGk/LlWz+ec+Z3ncpCf5hyTu1eUQnGzxiLNq+ldjfjYdg== Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Mn74x5rRTz10bk; Tue, 11 Oct 2022 20:42:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <4fca0778-8533-6f49-f86f-8bcf53b6d45b@FreeBSD.org> Date: Tue, 11 Oct 2022 13:42:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH] gdb: fix auxv caching Content-Language: en-US To: Pedro Alves , Simon Marchi , 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> <9379684a-ec46-6b17-c785-c8c308cb2924@palves.net> From: John Baldwin In-Reply-To: <9379684a-ec46-6b17-c785-c8c308cb2924@palves.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665520946; 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=btipVad6UfHTBVUbKv4P7f8SfmJwsDNS1ZGl5xVXCMo=; b=p5zMJ8JZHYTCMLTsrC6PmK3a88Egbxw2YrkWpzbfDHy9RkNurYDBrOqZriczac6JzkEzt/ qZPZalK0UGSYSMlmDWr4lvCJ+zP3h1lvgcIC861yGFBqFJa2uLx0W1V4KAqWOO80V1dOnJ lQue2dqkMI5WG6+achx+RVanW4HlaSXJXZNPvoKAMfnalziEmhM203blOtHTXRgee4i9dy tAHNI37VRT+7YLxPxwRxXEoanj4EZlEVKJXStL6OCb9PQTfrQYhrH37FYciySkPGuDks81 fL1Iwy4nhYnvkpBLQoUWn+kogvnOfAPSlPyA4jJdurgisc6WshYp/AQScxQokg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665520946; a=rsa-sha256; cv=none; b=HOKSOl7mVzfH+obr9uMmbcYIwPCvEyvRuRAZLzZufReADg2vigd/EeeDZR3BsvQjm4r93A RiwixG3bXAiwdkLj333r6zDZFpI0iYXkcZ/STvQ6pdNqbiQPQLuei9il4olK2QfT+F+Nvf cGNV3kOU8iveYSrVqMQwcXEYM+nfaQONyYzDt6uUW209qj1Fdkp9kRBLXiIdHRp8kJ2dMH FgD/KT/17tEadzsfC9ISFRwETjA/SR5UzzuNmL0qbqOJtNtmibptZYklH5LeTOdMFCGhs9 3JOFadIMiIGYdcRkO72z7u0rIDthfTPiwBr+Zi8UEY2pWZe7QfZL+MoSFUTf0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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:42:31 -0000 On 10/11/22 1:34 PM, Pedro Alves wrote: > > 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. I think "_raw" would be better here as using the cached values should be the default. >> Two overloads that do different things is a sign that they shouldn't be >> overloads, to me. >> -- John Baldwin