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 4AD36385781A for ; Thu, 24 Sep 2020 19:43:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4AD36385781A 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-48-FXLnvZ12MfinPohAe5xSDA-1; Thu, 24 Sep 2020 15:43:38 -0400 X-MC-Unique: FXLnvZ12MfinPohAe5xSDA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F4C064091; Thu, 24 Sep 2020 19:43:37 +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 EF9EC7882B; Thu, 24 Sep 2020 19:43:36 +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 08OJhY7u025986; Thu, 24 Sep 2020 21:43:34 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 08OJhXAp025985; Thu, 24 Sep 2020 21:43:33 +0200 Date: Thu, 24 Sep 2020 21:43:33 +0200 From: Jakub Jelinek To: Mark Wielaard Cc: dwz@sourceware.org Subject: Re: [PATCH 2/4] Handle DW_FORM_data16. Message-ID: <20200924194333.GP2176@tucnak> Reply-To: Jakub Jelinek References: <20200924162557.15870-1-mark@klomp.org> <20200924162557.15870-3-mark@klomp.org> MIME-Version: 1.0 In-Reply-To: <20200924162557.15870-3-mark@klomp.org> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Thu, 24 Sep 2020 19:43:41 -0000 On Thu, Sep 24, 2020 at 06:25:55PM +0200, Mark Wielaard wrote: > This is a simple form to handle, it just encodes 16 bytes of DIE data. > > * dwz.c (read_abbrev): Accept DW_FORM_data16. > (skip_attr_no_dw_form_indirect): Handle DW_FORM_data16. > (checksum_die): Likewise. > (checksum_ref_die): Likewise. > (die_eq_1): Likewise. > (mark_refs): Likewise. > (read_debug_info): Likewise. > (build_abbrevs_for_die): Likewise. > (DW_FORM_ref_sig8): Likewise. > --- > dwz.c | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > > diff --git a/dwz.c b/dwz.c > index 8291333..9719ee6 100644 > --- a/dwz.c > +++ b/dwz.c > @@ -1260,7 +1260,8 @@ read_abbrev (DSO *dso, unsigned char *ptr) > nattr++; > form = read_uleb128 (p); > if (form == 2 > - || (form > DW_FORM_flag_present && form != DW_FORM_ref_sig8)) > + || (form > DW_FORM_flag_present && (form != DW_FORM_ref_sig8 > + || form != DW_FORM_data16))) This should have been changed to: || (form > DW_FORM_ref_sig8 && form != DW_FORM_data16)) The point is that the code now handles everything up to DW_FORM_ref_sig8 inclusive except 2, and then DW_FORM_data16 with gaps in between. > { > error (0, 0, "%s: Unknown DWARF %s", > dso->filename, get_DW_FORM_str (form)); > @@ -1709,6 +1710,9 @@ skip_attr_no_dw_form_indirect (unsigned int cu_version, uint32_t form, > case DW_FORM_ref_sig8: > ptr += 8; > break; > + case DW_FORM_data16: > + ptr += 16; > + break; > case DW_FORM_sdata: > case DW_FORM_ref_udata: > case DW_FORM_udata: > @@ -2975,6 +2979,9 @@ checksum_die (DSO *dso, dw_cu_ref cu, dw_die_ref top_die, dw_die_ref die) > die->die_no_multifile = 1; > ptr += 8; > break; > + case DW_FORM_data16: > + ptr += 16; > + break; Also, wonder if DW_FORM_ref_sig8 has a separate case from DW_FORM_data8, if it wouldn't be more readable to stick DW_FORM_data16 case below the DW_FORM_data8 one. When both are the same case, that isn't possible of course. Otherwise LGTM. Jakub