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 1B648385700B for ; Wed, 22 Jul 2020 13:04:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1B648385700B 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 [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (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 5C9931E794; Wed, 22 Jul 2020 09:04:37 -0400 (EDT) Subject: Re: [PATCH, v1] Add code for processing version 5 DWP files (for use with DWARF v5) To: Caroline Tice , Caroline Tice via Gdb-patches Cc: Tom Tromey , Eric Christopher References: From: Simon Marchi Message-ID: <5e77197d-dbb3-5718-bfe8-e263c4006a06@simark.ca> Date: Wed, 22 Jul 2020 09:04:33 -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: Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: Wed, 22 Jul 2020 13:04:39 -0000 On 2020-07-21 12:06 a.m., Caroline Tice wrote: > The DWARF v5 Spec describes a (slightly) new format for V5 .dwp files. > This patch updates GDB to allow it to read/process .dwp files in the > new DWARF v5 format, while continuing to be able to read/process .dwp > files in the older V1 & V2 formats. Can you please describe in the commit message what those differences are? > The one thing I felt a little odd about in this patch: I couldn't > re-use the enum dwarf_sect > definitions, because in version 5 several of the sections have the > same name as in the previous versions, but have a different ordering, > with different numbers attached. So I had to create a new enum, > dwarf_sect_v5 for this purpose. That part would need to be cross-posted to the binutils mailing list. binutils does use the DW_SECT_* enumerators, presumably to read dwp files too, so they would likely use those new DWARF 5 enumerators eventually. > Is this patch ok to commit? It would be useful to precise somewhere, perhaps in the comment on `struct dwp_sections`. that versions 1 and 2 are pre-standard versions, and that version 5 was introduced in DWARF5. And that versions 3 and 4 don't exist. I don't have time to do an in-depth review right now, but one question that came to mind is: is an advantage of having virtual_v2_or_v5_dwo_sections over having separate virtual_v2_dwo_sections and virtual_v5_dwo_sections? Now when using v2 or v5, there are fields you don't use (because they are either v2-specific or v5-specific), so I imagine it's just more error prone. Does it avoid a lot of code duplication? Simon