From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id 9E6C83857C57 for ; Mon, 14 Sep 2020 10:38:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9E6C83857C57 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-589-bFt8_U97PvGM7V5rExH6Gg-1; Mon, 14 Sep 2020 06:38:14 -0400 X-MC-Unique: bFt8_U97PvGM7V5rExH6Gg-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 43DE310BBEDA; Mon, 14 Sep 2020 10:38:13 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-113-252.ams2.redhat.com [10.36.113.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E12207654A; Mon, 14 Sep 2020 10:38:12 +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 08EAcAPi031654; Mon, 14 Sep 2020 12:38:10 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 08EAc9K6031653; Mon, 14 Sep 2020 12:38:09 +0200 Date: Mon, 14 Sep 2020 12:38:09 +0200 From: Jakub Jelinek To: Mark Wielaard Cc: dwz@sourceware.org Subject: Re: [PATCH 2/4] Handle DWARF5 headers for compile and partial units. Message-ID: <20200914103809.GY21814@tucnak> Reply-To: Jakub Jelinek References: <20200914102355.8137-1-mark@klomp.org> <20200914102355.8137-3-mark@klomp.org> MIME-Version: 1.0 In-Reply-To: <20200914102355.8137-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.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-12.6 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_H2, 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: Mon, 14 Sep 2020 10:38:17 -0000 On Mon, Sep 14, 2020 at 12:23:53PM +0200, Mark Wielaard wrote: > DWARF5 also has separate unit headers for types (replacing .debug_types) > and unit types for split-DWARF both a skeleton tree as compile and split > trees. Which aren't handled yet. > > * dwz.c (get_DW_UT_str): New function. > (read_debug_line): Add .debug_line in version message error string. > (try_debug_info): Parse cu_version 5 header for DW_UT_compile and > DW_UT_partial. Add explicit error message for failing to read > abbrev. > (read_debug_info): Likewise. > --- > dwz.c | 146 +++++++++++++++++++++++++++++++++++++++++++++++----------- > 1 file changed, 120 insertions(+), 26 deletions(-) > > diff --git a/dwz.c b/dwz.c > index 6a4c96c..5d4b004 100644 > --- a/dwz.c > +++ b/dwz.c > @@ -670,6 +670,28 @@ get_DW_AT_str (unsigned int at) > return buf; > } > > +/* Retrun a DW_UT_* name. */ > +static const char * > +get_DW_UT_str (unsigned int ut) > +{ > + const char *name; > + static char buf[7 + 3 * sizeof (int)]; > + switch (ut) > + { > + case DW_UT_compile: name = "DW_UT_compile"; break; > + case DW_UT_type: name = "DW_UT_type"; break; > + case DW_UT_partial: name = "DW_UT_partial"; break; > + case DW_UT_skeleton: name = "DW_UT_partial"; break; Pasto? > + case DW_UT_split_compile: name = "DW_UT_split_compile"; break; > + case DW_UT_split_type: name = "DW_UT_split_type"; break; > + default: name = 0; break; > + } > @@ -5572,24 +5594,41 @@ try_debug_info (DSO *dso) > } > > cu_version = read_16 (ptr); > - if (cu_version < 2 || cu_version > 4) > + if (kind == DEBUG_TYPES && > + (cu_version < 2 || cu_version > 4)) I think dwz follows e.g. the GCC formatting and &&s etc. go to the start of line rather than end of it. Ok with the nits fixed. Jakub