From: Roland McGrath Date: Thu, 20 Aug 2009 05:03:58 +0000 (-0700) Subject: Diagnose reference mismatches with more detail. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef870bb4ec2830326947ac47a1268bf4d6e471a0;p=thirdparty%2Felfutils.git Diagnose reference mismatches with more detail. --- diff --git a/src/ChangeLog b/src/ChangeLog index 25d50f640..feecbf297 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2009-08-19 Roland McGrath + Diagnose reference mismatches with more detail. + * dwarfcmp.cc (talker::reference_mismatch): New method. + (talker::mismatch): Call it. + * dwarfcmp.cc (talker): Update constructor for tracker changes. 2009-08-16 Roland McGrath diff --git a/src/dwarfcmp.cc b/src/dwarfcmp.cc index 910815877..d62a2edee 100644 --- a/src/dwarfcmp.cc +++ b/src/dwarfcmp.cc @@ -207,9 +207,33 @@ struct talker : public dwarf_ref_tracker for (location () << " missing attributes:"; it1 != end1; ++it1) cout << " " << to_string (*it1); else - location () << to_string (*it1) << " vs " << to_string (*it2); + { + location () << to_string (*it1) << " vs " << to_string (*it2); + if ((*it1).second.what_space () == dwarf::VS_reference + && (*it2).second.what_space () == dwarf::VS_reference) + reference_mismatch ((*it1).second.reference (), + (*it2).second.reference ()); + } cout << endl; } + + inline void reference_mismatch (const die1 &ref1, const die2 &ref2) + { + dwarf_comparator cmp (*(_tracker *) this); + if (cmp.equals (*ref1, *ref2)) + cout << " (identical but contexts mismatch)"; + else + { + _base notracker; + dwarf_comparator cmp_norefs (notracker); + if (cmp_norefs.equals (*ref1, *ref2)) + cout << " (" << ref1->to_string () << " with reference mismatches)"; + else + cout << " (" << ref1->to_string () + << " != " << ref2->to_string () + << ")"; + } + } }; template