+2010-07-13 Roland McGrath <roland@redhat.com>
+
+ * c++/dwarf_comparator (dwarf_tracker_base): Replace visit method with
+ visitor type.
+ (dwarf_comparator): Update caller.
+
2010-07-01 Roland McGrath <roland@redhat.com>
* c++/values.cc (is_list, what_space): Handle v4 CU rules.
/* elfutils::dwarf_comparator -- -*- C++ -*- templates for comparing DWARF data
- Copyright (C) 2009 Red Hat, Inc.
+ Copyright (C) 2009-2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
}
};
- inline void visit (const typename dwarf1::debug_info_entry &,
- const typename dwarf2::debug_info_entry &)
+ /* This is enough like step that they should probably be merged.
+ But it's separate. */
+ struct visitor
{
- }
+ inline visitor (dwarf_tracker_base *,
+ const typename dwarf1::debug_info_entry &,
+ const typename dwarf2::debug_info_entry &)
+ {
+ }
+ inline ~visitor ()
+ {
+ }
+ };
inline bool mismatch (cu1 &, const cu1 &, // at, end
cu2 &, const cu2 &)
inline bool match (const die1 &a, const die2 &b)
{
- _m_tracker.visit (a, b);
+ typename tracker::visitor visit (&_m_tracker, a, b);
if (a.tag () != b.tag ())
return nomatch (a, b, "DIE tag");
if (!equals (a.attributes (), b.attributes ()))
+2010-07-13 Roland McGrath <roland@redhat.com>
+
+ * dwarfcmp.cc (talker): Replace visit method with visitor type.
+ (noisy_compare): Update caller.
+
2010-06-22 Roland McGrath <roland@redhat.com>
* readelf.c (print_debug_line_section): Fix braino in DW_LNS_set_isa.
<< ": ";
}
- inline void visit (const typename dwarf1::debug_info_entry &a,
- const typename dwarf2::debug_info_entry &b)
+ struct visitor
{
- a_ = &a;
- b_ = &b;
- visiting_result_ = a.tag () == b.tag ();
- if (!visiting_result_)
- location () << dwarf::tags::name (a.tag ())
- << " vs "
- << dwarf::tags::name (b.tag ())
- << endl;
- }
+ talker *t_;
+ const typename dwarf1::debug_info_entry *const save_a_;
+ const typename dwarf2::debug_info_entry *const save_b_;
+ inline visitor (talker *t,
+ const typename dwarf1::debug_info_entry &a,
+ const typename dwarf2::debug_info_entry &b)
+ : t_ (t), save_a_ (t->a_), save_b_ (t->b_)
+ {
+ t_->a_ = &a;
+ t_->b_ = &b;
+ t_->visiting_result_ = a.tag () == b.tag ();
+ if (!t_->visiting_result_)
+ t_->location () << dwarf::tags::name (a.tag ())
+ << " vs "
+ << dwarf::tags::name (b.tag ())
+ << endl;
+ }
+ inline ~visitor ()
+ {
+ t_->a_ = save_a_;
+ t_->b_ = save_b_;
+ }
+ };
inline bool keep_going ()
{
}
// This prints the differences if it finds some.
- visit (*path_top (left), *path_top (right));
+ visitor visit (this, *path_top (left), *path_top (right));
if (!visiting_result_)
{
cout << endl;
if (cmp (file1, file2, a, b))
{
- cmp._m_tracker.visit (a, b);
+ typename noisy_cmp<dwarf, dwarf, print_all>::my_tracker::visitor
+ visit (&cmp._m_tracker, a, b);
cmp._m_tracker.location () << "match" << endl;
}
else