From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31563 invoked by alias); 4 Nov 2019 23:26:12 -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 31554 invoked by uid 89); 4 Nov 2019 23:26:12 -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=20191105, 2019-11-05, tracing 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 --devel-dump-dies Message-ID: <20191104232606.GA3657@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/msg00033.txt.bz2 Hi, Currently the dumping of DIEs and their checksum state is enabled by -DDEBUG_DUMP_DIES. Make the functionality availabe with --devel-dump-dies. Committed to trunk. Thanks, - Tom Add --devel-dump-dies 2019-11-05 Tom de Vries * dwz.c (dump_dies_p): Define. (dump_dies): Enable with -DDEVEL. Print to stderr. (read_debug_info): Call dump_dies if dump_dies_p. (dwz_options): Add devel-dump-dies entry. --- dwz.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/dwz.c b/dwz.c index bd92e47..6b95216 100644 --- a/dwz.c +++ b/dwz.c @@ -150,10 +150,12 @@ static struct obstack alt_ob, alt_ob2; static int tracing; static int ignore_size; static int ignore_locus; +static int dump_dies_p; #else #define tracing 0 #define ignore_size 0 #define ignore_locus 0 +#define dump_dies_p 0 #endif static int save_temps = 0; @@ -3982,17 +3984,17 @@ find_dups_fi (dw_die_ref parent) return 0; } -#ifdef DEBUG_DUMP_DIES +#if DEVEL /* Debugging helper function to dump hash values to stdout. */ static void dump_dies (int depth, dw_die_ref die) { dw_die_ref child; const char *name = get_AT_string (die, DW_AT_name); - printf ("%*s %x %c %x %x %s\n", depth, "", 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 : ""); + fprintf (stderr, "%*s %x %c %x %x %s\n", depth, "", 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 : ""); for (child = die->die_child; child; child = child->die_sib) dump_dies (depth + 1, child); } @@ -4941,9 +4943,10 @@ read_debug_info (DSO *dso, int kind) for (cu = cuf; cu; cu = cu->cu_next) checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL); -#ifdef DEBUG_DUMP_DIES - for (cu = cuf; cu; cu = cu->cu_next) - dump_dies (0, cu->cu_die); +#if DEVEL + if (dump_dies_p) + for (cu = cuf; cu; cu = cu->cu_next) + dump_dies (0, cu->cu_die); #endif for (cu = cuf; cu; cu = cu->cu_next) @@ -5361,8 +5364,9 @@ read_debug_info (DSO *dso, int kind) goto fail; checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL); -#ifdef DEBUG_DUMP_DIES - dump_dies (0, cu->cu_die); +#if DEVEL + if (dump_dies_p) + dump_dies (0, cu->cu_die); #endif if (find_dups (cu->cu_die)) @@ -5432,9 +5436,10 @@ read_debug_info (DSO *dso, int kind) for (cu = first_cu; cu; cu = cu->cu_next) checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL); -#ifdef DEBUG_DUMP_DIES - for (cu = first_cu; cu; cu = cu->cu_next) - dump_dies (0, cu->cu_die); +#if DEVEL + if (dump_dies_p) + for (cu = first_cu; cu; cu = cu->cu_next) + dump_dies (0, cu->cu_die); #endif if (rd_multifile) @@ -12599,6 +12604,7 @@ static struct option dwz_options[] = { "devel-ignore-size", no_argument, &ignore_size, 1 }, { "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 }, #endif { NULL, no_argument, 0, 0 } };