[committed] Add --devel-dump-pus
Tom de Vries
tdevries@suse.de
Wed Jan 1 00:00:00 GMT 2020
Hi,
Add an option --devel-dump-pus to print information about which duplicate
chains have been selected by partition_dups to be copied into partial units.
Output looks like this:
...
$ dwz hello --devel-dump-pus
Partial unit (phase one):
60 O 6649b943 6649b943 long unsigned int base_type
75 O e00eb67a e00eb67a int base_type
81 O 7df8cdbf 7df8cdbf long int base_type
88 O 6fe25160 6fe25160 char base_type
Partial unit (phase one):
4b O 6737a1ef 6737a1ef unsigned char base_type
52 O 168f1291 168f1291 short unsigned int base_type
59 O 8b473491 8b473491 unsigned int base_type
67 O 4ab0f4e6 4ab0f4e6 signed char base_type
6e O 8a462495 8a462495 short int base_type
...
Committed to trunk.
Thanks,
- Tom
Add --devel-dump-pus
2020-01-09 Tom de Vries <tdevries@suse.de>
* dwz.c (dump_pus_p): New variable.
(partition_dups_1): Handle dump_pus_p.
(dwz_options, usage): Add dump_pus_p entry.
---
dwz.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dwz.c b/dwz.c
index 99ef704..0087ac7 100644
--- a/dwz.c
+++ b/dwz.c
@@ -190,6 +190,7 @@ static int ignore_size;
static int ignore_locus;
static int dump_dies_p;
static int dump_dups_p;
+static int dump_pus_p;
static int verify_dups_p;
static int verify_edge_freelist;
static int stats_p;
@@ -199,6 +200,7 @@ static int stats_p;
#define ignore_locus 0
#define dump_dies_p 0
#define dump_dups_p 0
+#define dump_pus_p 0
#define verify_dups_p 0
#define stats_p 0
#endif
@@ -6819,6 +6821,9 @@ partition_dups_1 (dw_die_ref *arr, size_t vec_size,
else
stats->pu_ph2_cnt++;
}
+ if (dump_pus_p)
+ fprintf (stderr, "Partial unit (%s):\n",
+ second_phase ? "phase two" : "phase one");
partial_cu->cu_kind = CU_PU;
partial_cu->cu_offset = *last_partial_cu == NULL
? 0 : (*last_partial_cu)->cu_offset + 1;
@@ -6848,6 +6853,8 @@ partition_dups_1 (dw_die_ref *arr, size_t vec_size,
continue;
if (odr && odr_mode != ODR_BASIC)
arr[k] = reorder_dups (arr[k]);
+ if (dump_pus_p)
+ dump_die (arr[k]);
child = copy_die_tree (die, arr[k]);
if (stats_p)
stats->pu_toplevel_die_cnt++;
@@ -14310,6 +14317,7 @@ static struct option dwz_options[] =
{ "devel-save-temps", no_argument, &save_temps, 1 },
{ "devel-dump-dies", no_argument, &dump_dies_p, 1 },
{ "devel-dump-dups", no_argument, &dump_dups_p, 1 },
+ { "devel-dump-pus", no_argument, &dump_pus_p, 1 },
{ "devel-unoptimized-multifile",
no_argument, &unoptimized_multifile, 1 },
{ "devel-verify-edges",no_argument, &verify_edges_p, 1 },
@@ -14555,6 +14563,7 @@ usage (void)
" --devel-ignore-locus\n"
" --devel-save-temps\n"
" --devel-dump-dies\n"
+ " --devel-dump-dups\n"
" --devel-unoptimized-multifile\n"
" --devel-verify-dups\n"
" --devel-verify-edges\n"
More information about the Dwz
mailing list