libabigail/tests/data
Dodji Seketeli 60cdabd931 Bug 18893 - type degradation from dwarf to abixml on libGLU.so
abidiff-ing libGLU.so against the result of 'abidw libGLU.so' does not
yield the empty set.  This is because hashing certain types when they
are read (de-serialized) from DWARF doesn't give the same result as
when they are de-serialized from abixml.  I call this type
degradation.  And it leads to spurious comparison differences.

This is due to several issues.

  1/ The logical link between a class declaration and its definition
  -- that is built when reading types from DWARF is not preserved in
  abixml.  So, for example, when a class S refers to itself via a
  pointer to its declaration, that type might hash differently when
  read from DWARF and when read from abixml.  When read from abixml
  it's a pointer to S itself.  But then that 'self' can be a copy of S
  that is defined in another file because abixml doesn't enforce the
  One Definition Rule from C++ either.

  2/ As the result of hashing is kept in a cache for var_decl and
  function_decl, hashing those decl before their types are completely
  built caches a value that becomes wrong when their type become
  completely built.

  3/ In DWARF, a class which has a virtual member function can still
  be considered as being declaration-only.  And its definition can
  come later in the DWARF info.  Our DWARF reader removes the
  "declaration-only" flag from a class as soon as it sees virtual
  member functions in that class; that makes us consider that class as
  a definition.  And then later when we read the real definition of
  the class we have two classes of the same name, with different
  layouts/size in the system.  This leads to spurious comparison
  differences too.

This patch addresses issues 1, 2 and 3.

	* src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Do not
	consider that virtual member functions disqualify a class from
	being declaration-only.
	* src/abg-hash.cc (var_decl:#️⃣:operator()): Do not cache the
	result of hashing before we are done building the type of the
	var_decl.
	(function_decl:#️⃣:operator()): Likewise, do not cache the
	result of hashing before we are done building the type of the
	function_decl.
	* src/abg-reader.cc (build_class_decl): Build the link between a
	class declaration and its definition.  If there are several
	definitions of a class in the corpus, keep just one.
	* src/abg-writer.cc (write_class_is_declaration_only): Emit the
	link between a class declaration and its definition.
	(write_class_decl): Emit a class declaration even if it has a
	definition.  The definition is going to be emitted
	separately.
	* tests/data/test-read-dwarf/test14-pr18893.so: New binary test
	input.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: New test
	reference output.
	* tests/data/Makefile.am: Add the new test input files to source
	distribution.
	* tests/test-read-dwarf.cc (in_out_specs): Run the new tests.
	* tests/data/test-abidiff/test-PR18791-report0.txt: Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-30 17:11:36 +02:00
..
test-abicompat Make the name of the removed variable section be consistent 2015-07-24 14:06:29 +02:00
test-abidiff Bug 18893 - type degradation from dwarf to abixml on libGLU.so 2015-08-30 17:11:36 +02:00
test-alt-dwarf-file Make the alt dwarf debug file *not* be a symlink 2014-11-19 16:50:48 +01:00
test-core-diff Fix further reaching reverse path calculation in core diff algo 2014-02-10 15:51:09 +01:00
test-diff-dwarf Detect vtable changes from member function changes 2015-08-29 16:23:17 +02:00
test-diff-filter Remove extra vertical spaces from diff report 2015-07-16 12:27:24 +02:00
test-diff-pkg Make abipkgdiff compare tar archives containing binaries 2015-08-22 14:32:20 +02:00
test-diff-suppr Make applying supp specs through pointer access look through typedefs 2015-08-01 14:34:46 +02:00
test-lookup-syms Re-build a test input file with debug info 2014-05-14 11:32:06 +02:00
test-read-dwarf Bug 18893 - type degradation from dwarf to abixml on libGLU.so 2015-08-30 17:11:36 +02:00
test-read-write Adjust many reference output for the non-regression test suite 2015-08-29 16:23:16 +02:00
test-write-read-archive Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
Makefile.am Bug 18893 - type degradation from dwarf to abixml on libGLU.so 2015-08-30 17:11:36 +02:00