Work around old dwarf producers forgetting mangled names for functions

* src/abg-comparison.cc
	(corpus_diff::priv::ensure_lookup_tables_populated): If lookup
	using mangled name for a deleted function yields nada, try the
	lookup with the pretty representation for the function.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2014-04-07 13:52:40 +02:00
parent 435f1520d7
commit 7639b2d3ab

View File

@ -5350,6 +5350,18 @@ corpus_diff::priv::ensure_lookup_tables_populated()
assert(added_fns_.find(n) == added_fns_.end());
string_function_ptr_map::const_iterator j =
deleted_fns_.find(n);
if (j == deleted_fns_.end())
{
// It can happen that an old dwarf producer might not
// have emitted the mangled name of the first diff
// subject. Int hat case, we need to try to use the
// function synthetic signature here.
// TODO: also query the underlying elf file's .dynsym
// symbol table to see if the symbol is present in the
// first diff subject before for real.
if (!added_fn->get_mangled_name().empty())
j = deleted_fns_.find(added_fn->get_pretty_representation());
}
if (j != deleted_fns_.end())
{
if (*j->second != *added_fn)