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 7F8723858D39 for ; Sun, 18 Sep 2022 21:49:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F8723858D39 Received: from [192.168.11.206] (unknown [185.156.120.200]) (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 5DA0A1E0D5; Sun, 18 Sep 2022 17:49:30 -0400 (EDT) Message-ID: <19725e32-0beb-6287-b61e-9c9cf4ff2a50@simark.ca> Date: Sun, 18 Sep 2022 17:49:28 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH 1/2] [gdb/symtab] Rename all_comp_units to all_units To: Tom de Vries , gdb-patches@sourceware.org References: <20220918081021.19721-1-tdevries@suse.de> Content-Language: fr From: Simon Marchi In-Reply-To: <20220918081021.19721-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, SPF_HELO_PASS, 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: Sun, 18 Sep 2022 21:49:33 -0000 > @@ -1201,7 +1201,7 @@ static void prepare_one_comp_unit (struct dwarf2_cu *cu, > static struct type *set_die_type (struct die_info *, struct type *, > struct dwarf2_cu *, bool = false); > > -static void create_all_comp_units (dwarf2_per_objfile *per_objfile); > +static void create_all_units (dwarf2_per_objfile *per_objfile); I don't know if you intended to rename this, or it just caught up in the sed. It's not necessarily wrong to rename it, given that under it we create comp units and type units. More functions could be renamed the same way (from comp_unit to unit), and dwarf2_per_cu_data also, while at it, since it represents more than just CUs. But that's really some feature creep over what you intended to do in the beginning, so I would suggest just sticking to renaming the all_comp_units vector for now. > diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h > index c2f86a9d367..ce4fe52f4a2 100644 > --- a/gdb/dwarf2/read.h > +++ b/gdb/dwarf2/read.h > @@ -433,7 +433,7 @@ struct dwarf2_per_bfd > /* Return the CU given its index. */ > dwarf2_per_cu_data *get_cu (int index) const > { > - return this->all_comp_units[index].get (); > + return this->all_units[index].get (); This makes me realize that this method (dwarf2_per_bfd::get_cu) should probably be renamed get_unit, since it allows to fetch comp units as well as type units (not in this patch though). Simon