From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by sourceware.org (Postfix) with ESMTPS id C83013858D28 for ; Tue, 11 Oct 2022 20:31:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C83013858D28 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-wr1-f44.google.com with SMTP id bv10so19787518wrb.4 for ; Tue, 11 Oct 2022 13:31:44 -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:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sc0taqaFnoDK1fFklzBwKFDxrDX6wm1mTW1kyBfpNLQ=; b=KX2tp4YcxNQir0igl/j0CI7a/h5H8CADRzsDnj+YRabkq3eWKfsAcNByl+wnq41nKI myngMdlBVCnRM1SHVlGQI0Cb6m/ZpIJyN7Z/RXW4Anfc4Qu1fHJXCvftz6mb5PuO2psI NozMGYU+wG7UGF/hsn2FzucD3FNEBnLuqdBMGW9OcrOwlOuREfnK5I8hiGaR/GeTVtIn Wm9M6yld2VqmnBrli/xGyyKC2xREwMo5Jva+m77GLx63chzixDdpRgHc41VdDObjGGdn sRVHGD4lZrE+KQBaAAB7/DW3FvAfzS7EV7C/n9cw7X3cM9Y7TMW/IJfd9JFaE6diLywd eUHQ== X-Gm-Message-State: ACrzQf25cFysuPdHgo09U/AEoffnsK2VpZszVYSVG/wVp2lxAVT3LY7l b83DGyX/B4NHZ05pe19OpEHkHa9EUmXMzg== X-Google-Smtp-Source: AMsMyM5puBIVVkUiUm/E6b6wkgdawOITFl1hgkP7b3hkneS9QelI3+QYW8oa02/Y0ioiBQd6jQ/bdg== X-Received: by 2002:a5d:598c:0:b0:22e:3b2a:acaa with SMTP id n12-20020a5d598c000000b0022e3b2aacaamr16206237wri.451.1665520302152; Tue, 11 Oct 2022 13:31:42 -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 g11-20020a5d488b000000b00228d7078c4esm11987757wrq.4.2022.10.11.13.31.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Oct 2022 13:31:41 -0700 (PDT) Subject: Re: [PATCH] gdb: fix auxv caching 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> From: Pedro Alves Message-ID: Date: Tue, 11 Oct 2022 21:31:40 +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:31:46 -0000 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 ? Two overloads that do different things is a sign that they shouldn't be overloads, to me.