From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 638AE3846454 for ; Tue, 23 Feb 2021 09:24:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 638AE3846454 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 81441AEE5; Tue, 23 Feb 2021 09:24:33 +0000 (UTC) Date: Tue, 23 Feb 2021 10:24:31 +0100 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org Subject: [committed] Don't print die_hash2 for ODR_UNKNOWN in dump_die_with_indent Message-ID: <20210223092430.GA3417@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, 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: Tue, 23 Feb 2021 09:24:35 -0000 Hi, With the following debugging session where we dwz exec hello using odr: ... $ gdb -q --args dwz hello -o hello.z --odr Reading symbols from dwz... (gdb) b checksum_die Breakpoint 1 at 0x409778: file dwz.c, line 3348. (gdb) r Starting program: dwz hello -o hello.z --odr Breakpoint 1, checksum_die (...) at dwz.c:3348 3348 switch (die->die_ck_state) (gdb) call dump_die (die) b X 0(0) 0 ../sysdeps/x86_64/start.S compile_unit (gdb) p die->die_odr_state $1 = ODR_UNKNOWN ... we see that we're printing the die_hash2 for a die with die_odr_state == ODR_UNKNOWN, while this is only supposed to trigger for ODR_DECL and ODR_DEF. Fix this in dump_die_with_indent, by not printing die_hash2 when die_odr_state == ODR_UNKNOWN. Committed to trunk. Thanks, - Tom Don't print die_hash2 for ODR_UNKNOWN in dump_die_with_indent 2021-02-23 Tom de Vries * dwz.c (dump_die_with_indent): Don't print die_hash2 when die_odr_state == ODR_UNKNOWN. --- dwz.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dwz.c b/dwz.c index 86863ce..6c516cf 100644 --- a/dwz.c +++ b/dwz.c @@ -5482,7 +5482,8 @@ dump_die_with_indent (int indent, dw_die_ref die) fprintf (stderr, "%*s %x %c %x", indent, "", die->die_offset, die->die_ck_state == CK_KNOWN ? 'O' : 'X', (unsigned) die->u.p1.die_hash); - if (odr && die->die_odr_state != ODR_NONE) + if (odr && die->die_odr_state != ODR_NONE + && die->die_odr_state != ODR_UNKNOWN) fprintf (stderr, "(%x)", (unsigned) die->u.p1.die_hash2); fprintf (stderr, " %x %s %s", (unsigned) die->u.p1.die_ref_hash, name ? name : "", get_DW_TAG_name (die->die_tag) + 7);