From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id CBAF33857C47 for ; Mon, 31 Aug 2020 21:39:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CBAF33857C47 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 03CFC1E554; Mon, 31 Aug 2020 17:39:39 -0400 (EDT) Subject: Re: [PATCH] Have partial symbol tables own psymbol vectors To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20200828193304.17475-1-tom@tromey.com> <871rjo7xic.fsf@tromey.com> <87sgc27nez.fsf@tromey.com> From: Simon Marchi Message-ID: Date: Mon, 31 Aug 2020 17:39:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87sgc27nez.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 31 Aug 2020 21:39:42 -0000 On 2020-08-31 1:09 p.m., Tom Tromey wrote: > Tom> It occurred to me today that add_psymbol_to_list could now be a method > Tom> on partial_symtab. I'm going to make that change and then resubmit. > > Here's the updated patch. > > Tom > > commit ac9fbb7aa1adcbc81cf8f6b9114e84c9193ae512 > Author: Tom Tromey > Date: Tue Aug 25 11:12:26 2020 -0600 > > Have partial symbol tables own psymbol vectors > > Currently pointers to all partial symbols are stored in two vectors; > and then indices into these vectors are stored in each partial_symtab. > > This patch changes this so that each partial symtab instead has > vectors of symbols. add_psymbol_to_list can now be changed into a > method on partial_symtab as well. > > My main motivation for doing this is that I am looking into calling > sort_pst_symbols in the background. However, I haven't actually > implemented this yet. (Also this may make it more feasible to also > sort the static psymbols, though I haven't tried that either.) > > Also, though, this lets us remove the "current_global_psymbols" > vector, because now the callers can simply refer directly to the > psymtab that they are modifying (formerly this was implicit). > > The main drawback of this patch is that it increases the size of > partial symtab. Hi Tom, I don't have a lot of time to look at this right now, but I'm trying to remember how this all works (notably how things are shared between objfiles). I think it would be a good time to get rid of the objfile parameter in the add_psymbol methods. This parameter shouldn't be there if the partial symtabs are really objfile-independent. Note that partial_symtab::add_psymbol passes the objfile to add_psymbol_to_bcache, which only uses it to get the psymtab_storage. is there a way it could get it some other way? The other use of objfile in partial_symtab::add_psymbol is for stats. I think that could be easily implemented some other way that doesn't require passing the objfile. I'll try to take another look later to better understand the patch. Simon