From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50806 invoked by alias); 9 Dec 2019 11:48:13 -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 50700 invoked by uid 89); 9 Dec 2019 11:48:06 -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.2 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=HX-Languages-Length:1970 X-Spam-Status: No, score=-25.2 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] Add dump_dups Message-ID: <20191209114800.GA20260@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/msg00126.txt.bz2 Hi, Factor out new function dump_dups. Committed to trunk. Thanks, - Tom Add dump_dups 2019-12-09 Tom de Vries * dwz.c (dump_dups): Rename to ... (dump_dups_p): ... this. (dump_dups): New function, factored out of ... (partition_found_dups): ... here. --- dwz.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dwz.c b/dwz.c index 9f28186..f764fca 100644 --- a/dwz.c +++ b/dwz.c @@ -159,14 +159,14 @@ static int tracing; static int ignore_size; static int ignore_locus; static int dump_dies_p; -static int dump_dups; +static int dump_dups_p; static int verify_dups_p; #else #define tracing 0 #define ignore_size 0 #define ignore_locus 0 #define dump_dies_p 0 -#define dump_dups 0 +#define dump_dups_p 0 #define verify_dups_p 0 #endif static int unoptimized_multifile; @@ -4269,6 +4269,14 @@ dump_die (dw_die_ref die) dump_die_with_indent (0, die); } +static void +dump_dups (dw_die_ref die) +{ + dw_die_ref d; + for (d = die; d; d = d->die_nextdup) + dump_die (d); +} + /* Dump DIE tree at tree depth DEPTH. */ static void dump_dies (int depth, dw_die_ref die) @@ -5977,14 +5985,10 @@ partition_found_dups (dw_die_ref die, struct obstack *vec) obstack_ptr_grow (vec, die); if (unlikely (verify_dups_p)) verify_dups (die, true); - if (dump_dups) + if (dump_dups_p) { fprintf (stderr, "duplicate chain:\n"); - { - dw_die_ref d; - for (d = die; d; d = d->die_nextdup) - dump_die (d); - } + dump_dups (die); } } @@ -13338,7 +13342,7 @@ static struct option dwz_options[] = { "devel-ignore-locus",no_argument, &ignore_locus, 1 }, { "devel-save-temps", no_argument, &save_temps, 1 }, { "devel-dump-dies", no_argument, &dump_dies_p, 1 }, - { "devel-dump-dups", no_argument, &dump_dups, 1 }, + { "devel-dump-dups", no_argument, &dump_dups_p, 1 }, { "devel-unoptimized-multifile", no_argument, &unoptimized_multifile, 1 }, { "devel-verify-edges",no_argument, &verify_edges_p, 1 },