From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id C9B3D3858D33 for ; Tue, 14 Feb 2023 19:37:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C9B3D3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 31EJb3f2013272 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Feb 2023 14:37:07 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 31EJb3f2013272 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1676403428; bh=2mMUWnmqIBfnu3buqyo50ejvc5tYh7XINsAvBCxcWwo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=gU2KJx+wuP4f/q34gERqWwAsGrawQK256jNsvAlxXsi4+jEOYoj0ITqRPbq0kqN8I JiHoSTpZzSWcD3W5u8fLFr7kv1a4kg/zM+bMsQZf6cyMAysvpHHVkLs8ohjFm/XpsE EQ3u1XtgulZINwwqSxTJ6E/eGXtayyXLELCsCkSQ= Received: from [172.16.0.192] (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 DC71A1E110; Tue, 14 Feb 2023 14:37:02 -0500 (EST) Message-ID: <926cd3db-c686-78b3-ea8c-965f66f77f91@polymtl.ca> Date: Tue, 14 Feb 2023 14:37:02 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH 2/4] gdb/dwarf2: move some things to read.h Content-Language: fr To: Tom Tromey , Simon Marchi via Gdb-patches References: <20230213145559.46676-1-simon.marchi@polymtl.ca> <20230213145559.46676-3-simon.marchi@polymtl.ca> <873579dttn.fsf@tromey.com> From: Simon Marchi In-Reply-To: <873579dttn.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 14 Feb 2023 19:37:03 +0000 X-Spam-Status: No, score=-3032.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 List-Id: On 2/13/23 18:33, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> The following 2 patches move .gdb_index and .debug_names reading code to > Simon> their own file. Prepare this by exposing some things used by that code > Simon> to read.h. > > Simon> +/* If FILE_MATCHER is NULL or if PER_CU has > Simon> + dwarf2_per_cu_quick_data::MARK set (see > Simon> + dw_expand_symtabs_matching_file_matcher), expand the CU and call > Simon> + EXPANSION_NOTIFY on it. */ > Simon> + > Simon> +bool > Simon> +dw2_expand_symtabs_matching_one > Simon> + (dwarf2_per_cu_data *per_cu, > Simon> + dwarf2_per_objfile *per_objfile, > Simon> + gdb::function_view file_matcher, > Simon> + gdb::function_view expansion_notify); > > Don't we normally write "extern" in headers? I added those. > Also normally in declarations the type is on the same line as the > function name. My bad, I just copy pasted the line from the definition and forgot to adjust them. Done now. > Simon> +/* This is a view into the index that converts from bytes to an > Simon> + offset_type, and allows indexing. Unaligned bytes are specifically > Simon> + allowed here, and handled via unpacking. */ > Simon> + > Simon> +class offset_view > Simon> +{ > Simon> +public: > Simon> + offset_view () = default; > > I think this type should be specific to .gdb_index. It shouldn't be > needed anywhere else -- it's there to work around the lack of alignment. Nice find, I thought it was used in .debug_names too, but no. I will revert this part of this patch, and the class will go to read-gdb-index.c in the following patch. Simon