From c1ab66e8ecfb27e1a0dd55fabf18cd322b734d61 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 2 Oct 2009 13:34:41 -0700 Subject: [PATCH] dwarf_comparator fix for individual-item comparison of references. --- libdw/ChangeLog | 5 +++++ libdw/c++/dwarf_comparator | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index df72bf96d..019427d35 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2009-10-02 Roland McGrath + + * c++/dwarf_comparator: Fix overload magic to distinguish reference + comparisons from child comparisons. + 2009-10-01 Roland McGrath * c++/dwarf_tracker (dwarf_path_finder::walk_down_to): Fix sibling diff --git a/libdw/c++/dwarf_comparator b/libdw/c++/dwarf_comparator index 88f656f50..b9bf317f0 100644 --- a/libdw/c++/dwarf_comparator +++ b/libdw/c++/dwarf_comparator @@ -208,7 +208,7 @@ namespace elfutils inline bool operator () (const item1 &a, const item2 &b) { - return _m_cmp.equals (a, b); + return _m_cmp.match_deref (a, b); } }; #define MATCHER(item) \ @@ -242,7 +242,7 @@ namespace elfutils typedef typename dwarf1::debug_info_entry die1; typedef typename dwarf2::debug_info_entry die2; - inline bool match (const cu1_it &a, const cu2_it &b) + inline bool match_deref (const cu1_it &a, const cu2_it &b) { typename tracker::walk in (&_m_tracker, a, b); return equals (*a, *b); @@ -376,7 +376,7 @@ namespace elfutils return equals (*a, *b); } - inline bool match (const cit1 &a, const cit2 &b) + inline bool match_deref (const cit1 &a, const cit2 &b) { // Maybe the tracker has already cached a correspondence of DIEs. typename tracker::reference_match matched; @@ -551,6 +551,12 @@ namespace elfutils return _m_tracker.notice_match (matched, ref1, ref2, result); } + // This is what the public equals method uses for references. + inline bool match (const cit1 &a, const cit2 &b) + { + return reference_match (a, b); + } + public: inline explicit dwarf_comparator (tracker &t) : _m_tracker (t) -- 2.47.3