From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2NAXJsy8h2I+SQcAWB0awg (envelope-from ) for ; Fri, 20 May 2022 12:07:40 -0400 Received: by simark.ca (Postfix, from userid 112) id 983E01E221; Fri, 20 May 2022 12:07:40 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=os3X1VG3; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C28141E21F for ; Fri, 20 May 2022 12:07:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72CC1384F010 for ; Fri, 20 May 2022 16:07:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72CC1384F010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653062859; bh=FrgqNggnu8nf+LGWKEAkcvE3cdM9UvWdFWZQQNKexrA=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=os3X1VG3mSdnep5dkaK4HdpSXhFZh8EvzaCehil+KogBpQled/bbq364/HeoZHg9d X6DABnUTeEIQ9kPsYa5ZbAaiWiRclg5QocUq8iW4hefKjjs8slxeY6z/HrhE234Jsv h11JSm7t5CpVEdljx6JDMZD37Qey8xpXxi3NihxI= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 90F47385842B for ; Fri, 20 May 2022 16:07:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 90F47385842B Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 7946E1E143; Fri, 20 May 2022 12:07:19 -0400 (EDT) Message-ID: Date: Fri, 20 May 2022 12:07:19 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v2 2/2] gdb: Simplify psymbol_functions::require_partial_symbols Content-Language: tl To: Lancelot SIX , gdb-patches@sourceware.org References: <20220519184557.2169347-1-lancelot.six@amd.com> <20220519184557.2169347-3-lancelot.six@amd.com> In-Reply-To: <20220519184557.2169347-3-lancelot.six@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: lsix@lancelotsix.com Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-05-19 14:45, Lancelot SIX via Gdb-patches wrote: > The previous patch ensured that partial symbols are read before calling > most of the quick_function's methods. > > The psymbol_functions class has the require_partial_symbols method which > serves this exact purpose. This method does not need to try to read partial > symbols anymore, but it can instead assert that any partial symbol have > been read at this point. > > Regression tested on x86_64-linux. > --- > gdb/psymtab.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/psymtab.c b/gdb/psymtab.c > index 402d6085fe6..2bf6cbc5848 100644 > --- a/gdb/psymtab.c > +++ b/gdb/psymtab.c > @@ -84,7 +84,7 @@ psymtab_storage::install_psymtab (partial_symtab *pst) > psymtab_storage::partial_symtab_range > psymbol_functions::require_partial_symbols (struct objfile *objfile) > { > - objfile->require_partial_symbols (true); > + gdb_assert ((objfile->flags & OBJF_PSYMTABS_READ) != 0); > return m_partial_symtabs->range (); > } It sounds like the method should be renamed then. The "require" meant that it would read the psymbols if needed. Now it's really just a getter, so it could probably be named just "partial_symbols". Simon