Bug 19023 - Type canonicalization is sensitive to struct-ness
authorDodji Seketeli <dodji@redhat.com>
Tue, 6 Oct 2015 22:08:46 +0000 (00:08 +0200)
committerDodji Seketeli <dodji@redhat.com>
Tue, 6 Oct 2015 22:41:32 +0000 (00:41 +0200)
commit0e3416e7e2f07faa1e2b3fc81380e39a0d40f9df
tree6cf99249b52a2c140bbc198294fcc629f949b7ee
parentca6a5147c679293ba0ad26ca5499fbc27f925f70
Bug 19023 - Type canonicalization is sensitive to struct-ness

In some debug info of some shared library, the same type can be
present as a struct in some translation units, and as a class in
others.  As we are using the "pretty representation" of types to hash
types during type canonicalization, a "class foo" and "struct foo"
are (wrongly) considered different, because those pretty
representations are different.

This patch changes the canonicalization code to make it independent
from the struct-ness of the class being canonicalized.

* include/abg-ir.h (class_decl::is_struct): Declare a setter for the
"is-struct" property.
* src/abg-ir.cc (class_decl::is_struct): And define that setter
here.
(type_base::get_canonical_type_for): Temporarily set the
'is-struct' flag of the class type to 'false' before building its
pretty representation.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so:
New test input binary.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
New test reference output.
* tests/data/Makefile.am: Add the new test material above to the
source distribution.
* tests/test-read-dwarf.cc (in_out_specs): Add the two new test
inputs to the list of test inputs to consider.
* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-ir.h
src/abg-ir.cc
tests/data/Makefile.am
tests/data/test-read-dwarf/test14-pr18893.so.abi
tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so [new file with mode: 0644]
tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi [new file with mode: 0644]
tests/test-read-dwarf.cc