public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Add --devel-dump-dups
@ 2019-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

Add an option --devel-dump-dups that prints the duplicate chains:
...
$ dwz min --devel-dump-dups
duplicate chain:
 4a O e00eb67a e00eb67a int base_type
 9c O e00eb67a e00eb67a int base_type
...

Committed to trunk.

Thanks,
- Tom

Add --devel-dump-dups

2019-11-30  Tom de Vries  <tdevries@suse.de>

	* dwz.c (dump_dups): New var.
	(partition_find_dups): Dump duplicate chains if dump_dups.
	(dwz_options): Add --devel-dump-dups.

---
 dwz.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dwz.c b/dwz.c
index e92e9d8..93c8736 100644
--- a/dwz.c
+++ b/dwz.c
@@ -156,11 +156,13 @@ static int tracing;
 static int ignore_size;
 static int ignore_locus;
 static int dump_dies_p;
+static int dump_dups;
 #else
 #define tracing 0
 #define ignore_size 0
 #define ignore_locus 0
 #define dump_dies_p 0
+#define dump_dups 0
 #endif
 static int unoptimized_multifile;
 static int save_temps = 0;
@@ -5929,6 +5931,15 @@ partition_find_dups (struct obstack *vec, dw_die_ref parent)
 	    }
 	  child->die_nextdup = prev;
 	  obstack_ptr_grow (vec, child);
+	  if (dump_dups)
+	    {
+	      fprintf (stderr, "duplicate chain:\n");
+	      {
+		dw_die_ref d;
+		for (d = child; d; d = d->die_nextdup)
+		  dump_die (d);
+	      }
+	    }
 	}
       else if (child->die_named_namespace)
 	partition_find_dups (vec, child);
@@ -13060,6 +13071,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-unoptimized-multifile",
 			 no_argument,	    &unoptimized_multifile, 1 },
   { "devel-verify-edges",no_argument,	    &verify_edges_p, 1 },

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-01  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [committed] Add --devel-dump-dups Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).