From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 2E2AF3857C5C for ; Fri, 25 Sep 2020 16:39:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2E2AF3857C5C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-136-WYDKbYa8Mk2sibE9yV4gEQ-1; Fri, 25 Sep 2020 12:39:43 -0400 X-MC-Unique: WYDKbYa8Mk2sibE9yV4gEQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8AE6188C13C; Fri, 25 Sep 2020 16:39:41 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-37.ams2.redhat.com [10.36.112.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91D145578A; Fri, 25 Sep 2020 16:39:41 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 08PGdcbX016654; Fri, 25 Sep 2020 18:39:38 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 08PGda3c016653; Fri, 25 Sep 2020 18:39:36 +0200 Date: Fri, 25 Sep 2020 18:39:36 +0200 From: Jakub Jelinek To: Mark Wielaard Cc: dwz@sourceware.org Subject: Re: [PATCH 1/4] Calculate size and write correct DWARF5 header Message-ID: <20200925163936.GA2176@tucnak> Reply-To: Jakub Jelinek References: <20200924162557.15870-1-mark@klomp.org> <20200924162557.15870-2-mark@klomp.org> <20200924193935.GO2176@tucnak> <0cad96489340d16298a27c8e9971606e6c53084a.camel@klomp.org> MIME-Version: 1.0 In-Reply-To: <0cad96489340d16298a27c8e9971606e6c53084a.camel@klomp.org> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, 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: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2020 16:39:46 -0000 On Fri, Sep 25, 2020 at 06:35:43PM +0200, Mark Wielaard wrote: > > > - unsigned int headersz = cu->cu_kind == CU_TYPES ? 23 : 11; > > > + unsigned int headersz = (cu->cu_kind == CU_TYPES > > > + ? 23 : (cu->cu_version >= 5 ? 12 : 11)); > > > > Is the DWARF 5 .debug_info types header also 23 bytes long? > > DW_UT_type units are length (4) + version (2) + unit_type (1) + > ptr_size (1) + abbrev_off (4) + signature (8) + type_off (4) = 28 bytes > long. But we don't support those yet. When we do we need to distinguish > between CU_TYPES_4 and CU_TYPES_5 because they can be both present. > > For my first pass of adding DWARF5 support I was not planning on doing > CU_TYPES_5 because as far as I know nothing produces it at the moment. > But it shouldn't be too hard to add it at the same level that dwz > supports CU_TYPES_4. > > Is the patch (with the above fix) as attached for just compile and > partial DWARF5 unit headers OK for now? Ok, thanks. > From c2cf77e0cdf05611bb0aa6ee6261acb13dff5634 Mon Sep 17 00:00:00 2001 > From: Mark Wielaard > Date: Wed, 23 Sep 2020 01:48:39 +0200 > Subject: [PATCH] Calculate size and write correct DWARF5 compile and partial > unit headers. > > * dwz.c (try_debug_info): Add header size check for cu_version 5. > (read_debug_info): Likewise. > (partition_dups_1): Add 1 to pu_size for cu_version 5. > (create_import_tree): Include header_size, 13 or 14 depending on > cu_version, in cost comparision. > (compute_abbrevs): Adjust headersz depending on cu_version. > (recompute_abbrevs): Likewise. > (write_info): Write cu_version 5 unit type. Jakub