From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80865 invoked by alias); 1 Dec 2019 09:07:18 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 80854 invoked by uid 89); 1 Dec 2019 09:07:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=HTo:D*redhat.com X-Spam-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx1.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Tue, 01 Jan 2019 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [committed] Factor out dump_die_with_indent Message-ID: <20191201090711.GA31244@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-q4/txt/msg00106.txt.bz2 Hi, Factor out dump_die_with_indent out of dump_dies. Committed to trunk. Thanks, - Tom Factor out dump_die_with_indent 2019-11-30 Tom de Vries * dwz.c (dump_die_with_indent): New function, factored out of ... (dump_dies): ... here. --- dwz.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dwz.c b/dwz.c index e07f24b..f7b2cae 100644 --- a/dwz.c +++ b/dwz.c @@ -4128,16 +4128,23 @@ find_dups_fi (dw_die_ref parent) return 0; } -/* Debugging helper function to dump hash values to stdout. */ +/* Dump DIE to stderr with INDENT. */ static void -dump_dies (int depth, dw_die_ref die) +dump_die_with_indent (int indent, dw_die_ref die) { - dw_die_ref child; const char *name = get_AT_string (die, DW_AT_name); - fprintf (stderr, "%*s %x %c %x %x %s\n", depth, "", die->die_offset, + fprintf (stderr, "%*s %x %c %x %x %s\n", indent, "", die->die_offset, die->die_ck_state == CK_KNOWN ? 'O' : 'X', (unsigned) die->u.p1.die_hash, (unsigned) die->u.p1.die_ref_hash, name ? name : ""); +} + +/* Dump DIE tree at tree depth DEPTH. */ +static void +dump_dies (int depth, dw_die_ref die) +{ + dw_die_ref child; + dump_die_with_indent (depth, die); for (child = die->die_child; child; child = child->die_sib) dump_dies (depth + 1, child); }