Commit Graph

476 Commits

Author SHA1 Message Date
Dodji Seketeli
4ce7f69dac Identify a function using its symbol name and version
When a function symbol S has several versions and several different
functions with different names have those different versions of S as
underlying symbols, libabigail could mistakenly take one function for
another.  This is because there are cases where libabigail identifies
the function using its symbol name without taking the version name
into account.

This patch fixes that.

	* src/abg-default-reporter.cc (default_reporter::report): In C,
	tell the user about the underlying function symbol name only if
	said symbol name is different from the name of the function.
	* src/abg-ir.cc (function_decl::get_id): If the function has an
	underlying symbol, use the symbol name and version as the function
	ID.  But if the function symbol has an alias then use the linkage
	name as the ID.
	* tests/data/test-diff-pkg/elfutils-debuginfo-0.170-4.el7.x86_64.rpm:
	New binary test input.
	* tests/data/test-diff-pkg/elfutils-debuginfo-0.171-1.el7.x86_64.rpm: Likewise.
	* tests/data/test-diff-pkg/elfutils-devel-0.170-4.el7.x86_64.rpm: Likewise.
	* tests/data/test-diff-pkg/elfutils-devel-0.171-1.el7.x86_64.rpm: Likewise.
	* tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64.rpm: Likewise.
	* tests/data/test-diff-pkg/elfutils-libs-0.171-1.el7.x86_64.rpm: Likewise.
	* tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64-multiple-sym-vers-report-0.txt:
	New reference test output.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-pkg.cc (in_out_specs): Integrate the new test
	inputs above into the harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-06-08 05:12:24 +02:00
Dodji Seketeli
af5e660fba Explicitely detect anonymous data member changes
This patch detects when a data member becomes anonymous or when an
anonymous data member becomes non anonymous and emits an explicit
message.

	* include/abg-comp-filter.h (has_anonymous_data_member_change):
	Add new function declaration.
	* include/abg-fwd.h (is_data_member, is_anonymous_data_member):
	declare new overloads.
	* src/abg-comp-filter.cc (has_anonymous_data_member_change):
	Define new overloads.
	* src/abg-ir.cc (is_data_member, is_anonymous_data_member): Define
	new overloads.
	* src/abg-reporter-priv.cc (represent): In the var_diff overload,
	detect when we have anonymous data member changes and emit
	explicit error messages then.
	* tests/data/test-diff-dwarf/test45-anon-dm-change-report-0.txt:
	New test material.
	* tests/data/test-diff-dwarf/test45-anon-dm-change-v0.cc: Likewise.
	* tests/data/test-diff-dwarf/test45-anon-dm-change-v0.o: Likewise.
	* tests/data/test-diff-dwarf/test45-anon-dm-change-v1.cc: Likewise.
	* tests/data/test-diff-dwarf/test45-anon-dm-change-v1.o: Likewise.
	* tests/data/Makefile.am: Add the new test material above to source
	distribution.
	* tests/test-diff-dwarf.cc (in_out_specs): Add the new test
	material above to the test harness.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-06-06 14:07:10 +02:00
Dodji Seketeli
12c04fe2d9 Add test44-anon-struct-union-v{0,1}.o to source distribution
In the previous commit, I forgot to add the files
test-diff-dwarf/test44-anon-struct-union-v{0,1}.o to source
distribution.  This commit fixes that.

	* tests/data/Makefile.am: Add
	test-diff-dwarf/test44-anon-struct-union-v{0,1}.o files to source
	distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-06-05 13:49:37 +02:00
Dodji Seketeli
2638a26360 Use the flat representation for anonymous struct/unions
When referring to an anonymous struct or union, libabigail used to
name it __anonymous_struct__ or __anonymous_union__.

Now, with this patch, libabigail rather uses the flat representation
of the struct/union, e.g, struct {int foo; char bar;}.

	* src/abg-ir.cc (get_class_or_union_flat_representation): Take a
	const class_or_union* (like what the declaration in the header
	file says), rather than just a class_or_union*.
	({class,union}_decl::get_pretty_representation): For anonymous
	classes and unions, use the flat representation.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-annotate/test13-pr18894.so.abi: Likewise.
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test44-anon-struct-union-report-0.txt:
	New test reference output.
	* tests/data/test-diff-dwarf/test44-anon-struct-union-v{0,1}.cc:
	Source code of new test binary outputs.
	* tests/data/test-diff-dwarf/test44-anon-struct-union-v{0,1}.o:
	New test binary outputs.
	* tests/data/Makefile.am: Add the new test materials above to
	source districution.
	* tests/test-diff-dwarf.cc (in_out_specs): Add the new test
	material above to the test harness here.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-06-04 17:40:39 +02:00
Dodji Seketeli
7c16fa9a7f Better detect when pointer and qualified types carry local changes
This is a fixup of the previous commit entitled:

    "Better detect when diff nodes only carry local type changes"

In that previous commit, I missed some things about pointer, reference
and qualified types, as far as local changes detection and management
is concerned.

This commit handles those points.

	* src/abg-comparison.cc
	(leaf_diff_node_marker_visitor::visit_begin): Do not mark
	qualified types as leaf diff nodes.
	(redundancy_marking_visitor::visit_end): Changes to qualified type
	are never considered local.  This is just as for pointer and
	reference types.
	* src/abg-default-reporter.cc
	(default_reporter::report_local_reference_type_changes): Display
	structural changes of the pointed-to type.
	(default_reporter::report): In the overload for reference_diff,
	better detect and handle when we have local changes, or not.
	* src/abg-ir.cc (equals): In the overload for qualified_type_def
	and reference_type_de, report local type changes of the underlying
	type as local changes.  Add comments in the overload for pointer
	type, and make it look like the the overload for reference_type.
	* src/abg-leaf-reporter.cc (leaf_reporter::report): In the
	overload for pointer_diff, remove end of line.
	* tests/data/test-diff-filter/libtest45-basic-type-change-report-1.txt: Adjust.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-06-01 14:49:46 +02:00
Dodji Seketeli
11c2437a19 Better detect when diff nodes only carry local type changes
For some fine grain redundancy filtering, we need to know when a diff
node carries *only* a basic type change.  This is because basic type
changes should not be marked as redundant; we want to see all of them
-- unlike for class or union (user defined) type changes.

And so to know if a diff node carries only a basic type change, we
need to know if a diff node only carries a local type change.  If it
carries only a type change, we can safely just look at that type
change and see if it's a basic type change or not.

So, we then need to know what kind of local changes a diff node
carries: type change or non-type change.  That way, we can analyze the
local changes a node carries and infer that it only carries a local
type change or if it also carries a non-type change.

This patch thus changes the diff::has_local_changes() pure virtual member
function to make it return the enum change_kind bitmask, which
describes the different kinds of local changes the diff node has.

Note that two new bit values were added to that enum:
LOCAL_TYPE_CHANGE_KIND and LOCAL_NON_TYPE_CHANGE_KIND.  The first one
says that the diff node carries a local type change, while the second
one says that the diff node carries a local non-type change kind.

The various implementations of that interface are thus amended to make
them return the right bitmask.  To do this, the patch updates the
various 'equals' overloads to make them return the proper enum
change_kind bitmap with the LOCAL_TYPE_CHANGE_KIND and
LOCAL_NON_TYPE_CHANGE_KIND set, if need be.

	* include/abg-comparison.h ({diff, type_diff_base, decl_diff_base,
	distinct_diff, var_diff, pointer_diff, reference_diff, array_diff,
	qualified_type, enum_diff, class_or_union_diff, class_diff,
	base_diff, scope_diff, fn_parm_diff, function_type_diff,
	function_decl_diff, typedef_diff,
	translation_unit_diff}::has_local_changes): Return an enum
	change_kind, rather than just a bool.
	(is_diff_of_basic_type): Declare an overload that takes a boolean
	flag.
	(is_qualified_type_diff, peel_pointer_diff, peel_reference_diff)
	(peel_qualified_type, peel_pointer_or_qualified_type): Declare new
	functions
	* include/abg-fwd.h (peel_qualified_type):
	* include/abg-ir.h (enum change_kind::{LOCAL_TYPE_CHANGE_KIND,
	LOCAL_NON_TYPE_CHANGE_KIND, ALL_LOCAL_CHANGES_MASK}): Add these
	three new enumerators.
	* src/abg-comparison.cc ({distinct_diff, var_diff, pointer_diff,
	array_diff, reference_diff, qualified_type_diff, enum_diff,
	class_or_union_diff, class_diff, base_diff, scope_diff,
	fn_parm_diff, function_type_diff, function_decl_diff,
	type_decl_diff, typedef_diff,
	translation_unit_diff}::has_local_changes): Adjust to return an
	enum change_kind, rather than just a bool.
	(has_local_type_change_only): Define new functions.
	(has_basic_type_change_only): Use the new
	has_local_type_change_only function and the new overload for
	is_diff_of_basic_type.
	(is_diff_of_basic_type): Define an overload that takes a boolean
	flag.
	(is_qualified_type_diff, peel_pointer_diff, peel_reference_diff)
	(peel_qualified_type, peel_pointer_or_qualified_type): Define new
	functions.
	* src/abg-ir.cc (equals): In the overloads for decl_base,
	scope_decl, type_base, qualified_type_diff, pointer_type_def,
	reference_type_def, array_type_def, enum_type_decl, typedef_decl,
	var_decl, function_type, function_decl, function_decl::parameter,
	class_or_union, class_decl::base_spec and class_decl, properly set
	the new abigail::ir::{LOCAL_CHANGE_KIND,
	LOCAL_NON_TYPE_CHANGE_KIND, LOCAL_TYPE_CHANGE_KIND} bits.
	(types_have_similar_structure): Peel qualified types and typedefs
	off, first thing.
	(peel_qualified_or_typedef_type): Define new function.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt:
	Adjust.
	* tests/data/test-diff-filter/libtest45-basic-type-change-report-{0,1}.txt:
	New reference test reports.
	* tests/data/test-diff-filter/libtest45-basic-type-change-v{0,1}.so:
	New input test binaries.
	* tests/data/test-diff-filter/test45-basic-type-change-v{0,1}.cc:
	Source code of the input test binaries above.
	* tests/data/Makefile.am: Add the new test file above to source
	distribution.
	* tests/test-diff-filter.cc: Add the test input above to the test
	harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-05-24 16:04:44 +02:00
Dodji Seketeli
1ef833b38d Improve detection of local *type* changes
For variables and data member, we are quite gross in the way we detect
a local type change.  Basically, if a textual representation of the
variable (and thus of its type) changes, then we consider that the
variable has a local (possibly type) change.

This leads us to (wrongly) report changes like this:

'struct S1 at test-44-anonymous-data-member-v0.c:1:1' changed:
  type size hasn't changed
  there are data member changes:
   anonymous data member at offset 32 (in bits) changed from:
     union {int b; float c;}
   to:
     union {int b; float c; char e;}

Here, you see that the textual representation of the anonymous data
member (of union type) changed from:

    union {int b; float c;}
to:
    union {int b; float c; char e;}

You see that although the textual representation of the type changed,
the *structure* of the type hasn't really changed.  I am using the
"vague" term structure, on purpose.  Here, in the case of a union, the
structure hasn't change because the size of the union hasn't changed.

This patch thus introduces the concept of "similarity of type
structures".  That is, even if two types are different, if "their
structure is similar", then the type change is not a local type
change.

More precisely, here is what we mean by type similarity:

    Two indirect types (pointers, references) have similar structure
    if their underlying types are of the same kind and have the same
    name.  In this indirect types case, the size of the underlying
    type does not matter.

    Two direct types (i.e, non indirect) have a similar structure if
    they have the same kind, name and size.  Two class types have
    similar structure if they have the same name, size, and if their
    data members have similar types.

This patch then uses that similarity concept to detect local type
changes.

	* include/abg-fwd.h (is_type_decl): Declare new overload for
	type_base*.
	(types_have_similar_structure): Declare new function.
	* src/abg-comparison.cc
	(class_or_union_diff::priv::count_filtered_changed_dm): Even when
	looking at local changes only, do not forget to count nodes that
	were filtered out.
	* src/abg-ir.cc (types_have_similar_structure): Define new
	function.
	(is_type_decl): Define new overload for
	type_base*.
	(is_enum_type):
	(equals): In the overload for var_decl, use the new
	types_have_similar_structure function to detect local (type)
	changes.
	* src/abg-reporter-priv.cc (represent): In the overload for
	var_decl, use the diff::has_local_changes function to detect local
	changes, now that we can better detect local changes.
	* tests/data/test-diff-filter/test44-anonymous-data-member-report-1.txt:
	Adjust.
	* tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-05-24 10:49:11 +02:00
Dodji Seketeli
81770b4284 Remove references, arrays and fn parms from leaf diff nodes
It doesn't make sense to report about I leaf diff nodes that are
either references, arrays of function parameters.  It makes more sense
to have these be reported as part of their containing diff nodes.

This patch fixes that.

	* src/abg-comparison.cc
	(leaf_diff_node_marker_visitor::visit_begin): Do not mark
	references, array and fn parms diff nodes as leaf nodes.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt:
	Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-05-24 10:49:11 +02:00
Dodji Seketeli
a0d8a4d3e5 Fix typo in tests/runtestdefaultsupprs.py
* tests/runtestdefaultsupprs.py.in: Fix typo.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-05-24 10:48:56 +02:00
Dodji Seketeli
899cc4b601 Use the correct python interpreter in runtestdefaultsupprs.py
* configure.ac: Make the PYTHON environemnt variable usable in
	auto-generated files.
	* tests/runtestdefaultsupprs.py.in: Use the python interpreter
	detected by configure.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-05-16 14:24:31 +02:00
Dodji Seketeli
277100a15c Sort the output of the leaf reporter
It turned out we were not sorting the output of the leaf report.  This
patch fixes that.

	* include/abg-comparison.h (diff_ptrs_type): Define new typedef.
	* src/abg-comparison-priv.h (sort_string_diff_ptr_map): Declare
	new function.
	* src/abg-comparison.cc (sort_string_diff_sptr_map): Update
	comment.
	(sort_string_diff_ptr_map): Define new function.
	* src/abg-leaf-reporter.cc (report_diffs): Sort the diff nodes
	before reporting about them.
	* tests/data/test-diff-suppr/test36-leaf-report-0.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-05-14 10:02:56 +02:00
Dodji Seketeli
d053ff708e Show data member offsets in bytes too
I forgot to express data members in bytes (if the user wants it) when
the feature got initially baked.  This patch fixes it.

	* src/abg-reporter-priv.cc (represent): In the overload for
	var_diff_sptr, use the function show_offset_or_size, rather than
	emit_num_value.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Adjust.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Adjust.
	* tests/data/test-diff-filter/test44-anonymous-data-member-report-0.txt: Adjust.
	* tests/data/test-diff-filter/test44-anonymous-data-member-report-1.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-05-14 07:11:34 +02:00
Dodji Seketeli
ef7198310d Initial support of anonymous data members
An anonymous data member is a data member of a struct or a union which
has no name.  The type of such data member is either a struct or a
union.  For instance:

    struct foo {
      int a;
      struct { // <-- this is an anonymous data member
	char a;
	char b;
      };
      int c;
    };

In DWARF (as emitted by GCC at least), an anonymous data member is
represented as a data member with an empty name.  Libabigail sees it
just fine, but then when representing *changes* to that kind of data
member, it needs special treatment, otherwise users cannot make sense
of the reports.

This patch adds initial support to represent changes to anonymous data
members.

	* include/abg-comparison.h (is_class_or_union_diff)
	(is_anonymous_class_or_union_diff): Declare new functions.
	* include/abg-fwd.h (is_class_type): Declare new overload for
	type_or_decl_base&.
	(is_data_member): Declare new overload for decl_base*.
	(is_anonymous_data_member)
	(anonymous_data_member_to_class_or_union)
	(get_class_or_union_flat_representation)
	(data_member_has_anonymous_type): Declare new functions.
	(is_at_class_scope): Return the class or union scope.
	* include/abg-ir.h (var_decl::get_qualified_name): New virtual
	data member which overloads decl_base::get_qualified_name.
	* src/abg-comparison.cc (is_class_or_union_diff)
	(is_anonymous_class_or_union_diff): Define new functions
	(leaf_diff_node_marker_visitor::visit_begin): Don't mark anonymous
	class or union diff nodes as diff nodes.
	* src/abg-ir.cc (is_data_member): Define new overload for
	decl_base*.
	(is_class_type, is_union_type): Define new overload for type_or_decl_base&.
	(is_anonymous_data_member)
	(anonymous_data_member_to_class_or_union)
	(get_class_or_union_flat_representation)
	(data_member_has_anonymous_type): Define new function overloads.
	(var_decl::get_qualified_name): Define new virtual member
	function.
	(is_at_class_scope): Return the class or union scope.
	(var_decl::get_pretty_representation): Support anonymous data
	members.
	(equals): In the overload for class_or_union_diff, mark data
	member textual representation changes as local changes.
	* src/abg-reporter-priv.cc (represent): In the overload for
	var_diff, support changes to anonymous data members.
	* src/abg-leaf-reporter.cc (leaf_reporter::report): Report sorted
	-- by offset -- data member changes before the ones that are
	sorted by other things.
	* tests/data/test-diff-filter/libtest44-anonymous-data-member-v{0,1}.so:
	New binary test input
	* tests/data/test-diff-filter/test44-anonymous-data-member-report-{0,1}.txt:
	New reference test outputs.
	* tests/data/test-diff-filter/test44-anonymous-data-member-v{0,1}.c:
	Source code of the new binary test output above.
	* tests/data/Makefile.am: Add the new test files above to the
	source distribution.
	* tests/data/test-annotate/libtest23.so.abi: Adjust test reference
	output.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-annotate/test13-pr18894.so.abi: Likewise.
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-05-14 06:41:38 +02:00
Dodji Seketeli
ee5f2f06a6 Represent sizes and offsets in bytes and hexadecimal values
In current change reports, sizes and offsets are represented in bits,
and as decimal values.  Some users prefer having those offsets be in
bytes and as hexadecimal values.

This commits adds 4 new options to let users see sizes and offsets be
represented either in bits, bytes, decimal or hexadecimal values.

	* doc/manuals/abidiff.rst: Add documentation for the new
	--show-bits, --show-bytes, --show-hex and --show-dec options.
	* doc/manuals/abipkgdiff.rst: Likewise.
	* doc/manuals/kmidiff.rst: Likewise.
	* include/abg-comparison.h (diff_context::{show_hex_values,
	show_offsets_sizes_in_bits}): Declare new member functions.
	* src/abg-comparison-priv.h (diff_context::priv::{hex_values_,
	show_offsets_sizes_in_bits_}): Declare new data members.
	(diff_context::priv::priv): Initialize them.
	* src/abg-comparison.cc (diff_context::{show_hex_values,
	show_offsets_sizes_in_bits}): Define new member functions.
	* src/abg-default-reporter.cc (default_reporter::report): Adjust
	the call to maybe_report_diff_for_symbol.
	* src/abg-leaf-reporter.cc (leaf_reporter::report): Likewise.
	* src/abg-reporter-priv.h (convert_bits_to_bytes)
	(maybe_convert_bits_to_bytes, emit_num_value, show_offset_or_size)
	(show_numerical_change): Declare new functions.
	(maybe_report_diff_for_symbol): Take a diff_context in parameter.
	* src/abg-reporter-priv.cc (convert_bits_to_bytes, emit_num_value)
	(maybe_convert_bits_to_bytes, show_numerical_change)
	(show_offset_or_size): Define new functions.
	(represent): In the overload for method_decl, var_decl, use the
	new emit_num_value function.
	(represent_data_member): Use the new show_offset_or_size function.
	(maybe_show_relative_offset_change): Use the new
	convert_bits_to_bytes, diff_context::show_offsets_sizes_in_bits,
	emit_num_value functions.
	(maybe_show_relative_offset_change): Likewise.
	(report_size_and_alignment_changes): Use the new emit_num_value
	and show_numerical_change functions.
	(maybe_report_diff_for_symbol): Tak a diff_context in argument.
	Use the new show_numerical_change function.
	* tests/test-diff-filter.cc (in_out_spec): Add a new entry to test
	hexa and bytes output.
	* tools/abidiff.cc (options::{show_hexadecimal_values,
	show_offsets_sizes_in_bits}): New data members.
	(options::options): Initialize them.
	(display_usage): New help strings for the new
	--show{bytes,bits,hex,dec} options.
	(parse_command_line): Parse the new --show{bytes,bits,hex,dec} options.
	(set_diff_context_from_opts) Set the diff context wrt hex and
	bytes values.
	* tools/abipkgdiff.cc (options::{show_hexadecimal_values,
	show_offsets_sizes_in_bits}): New data members.
	(options::options): Initialize them.
	(display_usage): New help strings for the new
	--show{bytes,bits,hex,dec} options.
	(set_diff_context_from_opts): Set the diff context wrt hex and
	bytes values.
	(parse_command_line): Parse the new --show{bytes,bits,hex,dec}
	options.
	* tools/kmidiff.cc (options::{show_hexadecimal_values,
	show_offsets_sizes_in_bits}): New data members.
	(options::options): Initialize them.
	(display_usage):New help strings for the new
	--show{bytes,bits,hex,dec} options.
	(parse_command_line): Parse the new --show{bytes,bits,hex,dec}
	options.
	(set_diff_context): Set the diff context wrt hex and bytes values.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt:
	New reference test output.
	* tests/data/Makefile.am: Add the new reference test output above
	to source distribution.
	* tests/data/test-abicompat/test0-fn-changed-report-0.txt: Adjust.
	* tests/data/test-abicompat/test0-fn-changed-report-2.txt: Likewise.
	* tests/data/test-abicompat/test5-fn-changed-report-0.txt: Likewise.
	* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
	* tests/data/test-abicompat/test6-var-changed-report-0.txt: Likewise.
	* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
	* tests/data/test-abicompat/test7-fn-changed-report-0.txt: Likewise.
	* tests/data/test-abicompat/test7-fn-changed-report-1.txt: Likewise.
	* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
	* tests/data/test-abicompat/test8-fn-changed-report-0.txt: Likewise.
	* tests/data/test-abicompat/test9-fn-changed-report-0.txt: Likewise.
	* tests/data/test-abidiff/test-PR18791-report0.txt: Likewise.
	* tests/data/test-abidiff/test-qual-type0-report.txt: Likewise.
	* tests/data/test-abidiff/test-struct0-report.txt: Likewise.
	* tests/data/test-abidiff/test-struct1-report.txt: Likewise.
	* tests/data/test-abidiff/test-var0-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test0-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test1-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test10-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test11-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test13-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test21-redundant-fn-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test22-changed-parm-c-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test26-added-parms-before-variadic-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test27-local-base-diff-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test3-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test32-fnptr-changes-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test33-fnref-changes-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test34-pr19173-libfoo-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test36-ppc64-aliases-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test37-union-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test39-union-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test40-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test8-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test9-report.txt: Likewise.
	* tests/data/test-diff-filter/test0-report.txt: Likewise.
	* tests/data/test-diff-filter/test01-report.txt: Likewise.
	* tests/data/test-diff-filter/test1-report.txt: Likewise.
	* tests/data/test-diff-filter/test10-report.txt: Likewise.
	* tests/data/test-diff-filter/test11-report.txt: Likewise.
	* tests/data/test-diff-filter/test13-report.txt: Likewise.
	* tests/data/test-diff-filter/test14-0-report.txt: Likewise.
	* tests/data/test-diff-filter/test14-1-report.txt: Likewise.
	* tests/data/test-diff-filter/test15-0-report.txt: Likewise.
	* tests/data/test-diff-filter/test15-1-report.txt: Likewise.
	* tests/data/test-diff-filter/test16-report-2.txt: Likewise.
	* tests/data/test-diff-filter/test16-report.txt: Likewise.
	* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
	* tests/data/test-diff-filter/test17-1-report.txt: Likewise.
	* tests/data/test-diff-filter/test2-report.txt: Likewise.
	* tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt: Likewise.
	* tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt: Likewise.
	* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-1.txt: Likewise.
	* tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test3-report.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise.
	* tests/data/test-diff-filter/test32-ppc64le-struct-change-report0.txt: Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt: Likewise.
	* tests/data/test-diff-filter/test37-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test39/test39-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test42-leaf-report-output-0.txt: Likewise.
	* tests/data/test-diff-filter/test6-report.txt: Likewise.
	* tests/data/test-diff-filter/test9-report.txt: Likewise.
	* tests/data/test-diff-pkg/dirpkg-1-report-1.txt: Likewise.
	* tests/data/test-diff-pkg/dirpkg-3-report-1.txt: Likewise.
	* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
	* tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise.
	* tests/data/test-diff-pkg/symlink-dir-test1-report0.txt: Likewise.
	* tests/data/test-diff-pkg/tarpkg-0-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/tarpkg-1-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-7.txt: Likewise.
	* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test11-add-data-member-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test12-add-data-member-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test12-add-data-member-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test13-suppr-through-pointer-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test13-suppr-through-pointer-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test14-suppr-non-redundant-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test14-suppr-non-redundant-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test17-suppr-added-var-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test17-suppr-added-var-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test17-suppr-added-var-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test18-suppr-removed-var-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test18-suppr-removed-var-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test18-suppr-removed-var-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test2-struct-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-10.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-12.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-14.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-16.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test25-typedef-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test26-loc-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test26-loc-suppr-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-6.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-8.txt: Likewise.
	* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test30-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test31-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test32-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test32-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test33-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test35-leaf-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test4-local-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test4-local-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
	* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt: Likewise.
	* tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test8-redundant-fn-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test9-changed-parm-c-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test9-changed-parm-c-report-1.txt: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-04-30 17:11:40 +02:00
Dodji Seketeli
6824e5c968 Use absolute builddir paths in automake test files
When switching to a more recent automake version on EL7, I realized
that @top_builddir@ wasn't being resolved to an absolute path anymore,
leading to errors when tests/runtestdefaultsupprs.py wasn't being run
in the "right" directory.  This is annoying.

So this patches uses the absolute build path, explicitely.

	* tests/runtestdefaultsupprs.py.in: Use abs_top_builddir rather
	than top_builddir.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-04-18 10:21:40 +02:00
Dodji Seketeli
b2608d9ccb Update tests for the "better leaf mode redundancy management" patchset
This commit is the last of the set whose commit titles are:

    Do not show decl-only-to-def changes in the leaf reporter
    Overhaul of the report diff stats summary
    Do not mark "distinct" diff nodes as being redundant
    Fix meaning of "harmless name change" to avoid overfiltering
    Better handle category propagation of pointer changes
    Improve function changes reporting in leaf and default mode
    Don't filter out typedef changes with redundant underlying type changes
    Only show leaf type changes in the leaf type changes section
    Fix leaf report of class data member changes
    Always show redundant changes in leaf mode
    Avoid reporting an enum change if it has already been reported
    When we say an a change was reported earlier give its source location
    [abipkgdiff]: in leaf mode we always show redundant changes
    Update tests for the "better leaf mode redundancy management" patchset

This commit updates the tests reference output files for that
patchset.

	* tests/data/test-abidiff-exit/test1-voffset-change-report1.txt: Adjust.
	* tests/data/test-abidiff/test-PR18791-report0.txt: Likewise.
	* tests/data/test-abidiff/test-enum0-report.txt: Likewise.
	* tests/data/test-abidiff/test-enum1-report.txt: Likewise.
	* tests/data/test-diff-filter/test1-report.txt: Likewise.
	* tests/data/test-diff-filter/test14-0-report.txt: Likewise.
	* tests/data/test-diff-filter/test15-0-report.txt: Likewise.
	* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
	* tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test3-report.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise.
	* tests/data/test-diff-filter/test32-ppc64le-struct-change-report0.txt: Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt: Likewise.
	* tests/data/test-diff-filter/test4-report.txt: Likewise.
	* tests/data/test-diff-filter/test41-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test42-leaf-report-output-0.txt: Likewise.
	* tests/data/test-diff-pkg/dirpkg-3-report-1.txt: Likewise.
	* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
	* tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt: Likewise.
	* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test13-suppr-through-pointer-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test14-suppr-non-redundant-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test14-suppr-non-redundant-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test17-suppr-added-var-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test17-suppr-added-var-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test17-suppr-added-var-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test17-suppr-added-var-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test18-suppr-removed-var-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test18-suppr-removed-var-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test18-suppr-removed-var-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test2-struct-suppr-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test2-struct-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test25-typedef-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test27-add-aliased-function-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test27-add-aliased-function-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test27-add-aliased-function-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-report-6.txt: Likewise.
	* tests/data/test-diff-suppr/test30-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test34-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test35-leaf-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-report-9.txt: Likewise.
	* tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-04-13 11:13:09 +02:00
Dodji Seketeli
a8e68d9620 Do not show decl-only-to-def changes in the leaf reporter
As an introduction, this patch is the first one of a patchset which
improves the handling of the leaf reporting mode.  The patchset
focuses mainly on handling redundancy filtering when in leaf reporting
mode, but it doesn't do only that.  It also fixes other issues that
are related to the leaf reported mode.

Note that there are so many changes that we couldn't not possibly
update the reference outputs of the regression tests in each change.
Rather we update the reference test outputs in on patch, at the end of
the set.

Here are the titles of the patches of the set:

    Do not show decl-only-to-def changes in the leaf reporter
    Overhaul of the report diff stats summary
    Do not mark "distinct" diff nodes as being redundant
    Fix meaning of "harmless name change" to avoid overfiltering
    Better handle category propagation of pointer changes
    Improve function changes reporting in leaf and default mode
    Don't filter out typedef changes with redundant underlying type changes
    Only show leaf type changes in the leaf type changes section
    Fix leaf report of class data member changes
    Always show redundant changes in leaf mode
    Avoid reporting an enum change if it has already been reported
    When we say an a change was reported earlier give its source location
    [abipkgdiff]: in leaf mode we always show redundant changes
    Update tests for the "better leaf mode redundancy management" patchset

And below is is the definition of what this first patch does.

In the leaf reporter, we are current showing decl-only-classes to
def-only-classes changes in the leaf reporter.  We should not, as it
might be considered as noise.

This patch fixes that.

	* include/abg-comp-filter.h (has_class_decl_only_def_change):
	Declare this function.
	* src/abg-comp-filter.cc (has_class_decl_only_def_change): Make
	this function be non-static.
	* src/abg-comparison.cc
	(leaf_diff_node_marker_visitor::visit_begin): Use it to avoid
	marking class-decl-only-def changes as being leaf changes.
	* libtest43-decl-only-def-change-leaf-report-v0.so: New test input file.
	* libtest43-decl-only-def-change-leaf-report-v1.so: Likewise.
	* test43-decl-only-def-change-leaf-report-0.txt: Likewise.
	* test43-decl-only-def-change-leaf-report-v0.cc: Likewise.
	* test43-decl-only-def-change-leaf-report-v1.cc: Likewise.
	* tests/test-diff-filter.cc (in_out_specs): Run the test over the
	new test input.
	* tests/data/Makefile.am: Add the new test materials to source
	distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-04-13 11:09:35 +02:00
Dodji Seketeli
08f04ab6b2 Do not enable fedabipkgdiff tests if fedabipkgdiff itself is disabled
Fix tests/Makefile.am to avoid enabling fedabipkgdiff tests when
fedabipkgdiff itself is disabled because, e.g, of missing
dependencies.

	* tests/Makefile.am: Run runtestfedabipkgdiff{py3?}.py only if
	fedabipkgdiff itself is enabled.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-30 10:38:23 +02:00
Chenxiong Qi
1ac0c055fa Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2
This patch makes fedabipkgdiff Python 3 compatible.  All tests written
in Python are updated and compatible with Python 3 as well.

The patch looks for a Python 3 interperter.  If it finds one then it
runs the tests using that interpreter.  Otherwise it just tries to use
the Python 2 interpreter.

This behaviour can be disabled by the new --disable-python3 option.

	* configure.ac: Add new option --enable-python3. Add new
	test runner file tests/runtestdefaultsupprs-py3 and
	tests/runtestfedabipkgdiffpy3.sh. Add required six Python module.
	* tests/Makefile.am: Add new test files
	tests/runtestdefaultsupprspy3.sh and
	tests/runtestfedabipkgdiffpy3.sh accordingly.
	* tests/mockfedabipkgdiff.in: Convert print statement to
	six.print_. Replace call to function filter with list
	comprehension. Replace basestring with six.string_types.
	* tests/runtestdefaultsupprspy3.sh.in: New shell script to run
	test runtestdefaultsupprs with Python 3.
	* tests/runtestdefaultsupprs.py.in: Repalce a few tabs with
	proper number of spaces which is detected by Python 3
	interpreter.
	* tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run
	test runtestfedabipkgdiff with Python 3.
	* tests/runtestfedabipkgdiff.py.in: Use python from env in
	shebang instead of a fixed path to a Python interpreter.
	* tools/fedabipkgdiff: Globally replace print statement with a
	function call to print which is available by importing
	print_function from __future__ module. Use six.print_ to output
	string to stderr instead. Convert function call to map to
	for-loop. (cmp_nvr): Change argument to handle a Koji build
	mapping instead of only the nvr. (Brew.listBuilds): use the new
	cmp_nvr to sort builds.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-29 13:46:50 +02:00
Dodji Seketeli
2939397c13 Make abipkgdiff avoid comparing private DSOs from RPMs
When an RPM contains a DSO which SONAME is not listed in the
"provides" property of the package, abipkgdiff ought to consider that
DSO as private to the RPM.  It should thus *NOT* consider that DSO
when comparing ABIs, at least, by default.

This is as per the discussion that was held at
https://pagure.io/task-abicheck/issue/8 and that led to the proposal
https://pagure.io/task-abicheck/issue/8#comment-492466.

This patch implements that scheme.

Basically, the patch looks at the SONAMEs listed in the "provides"
property of the RPM and consider them as the SONAMEs of the set of
"public" DSOs of the RPM.

Thus, if the RPM has a DSO that has no SONAME of one that is not
listed in the set of public SONAMEs of the package, then that DSO is
not considered for ABI comparison.

The patch also introduces a new --private-dso option that disables
this behaviour and compares all DSOs, including those that would be
meant to be private.

	* doc/manuals/abipkgdiff.rst: Add documentation for the new
	--private-dso option.
	* include/abg-tools-utils.h (execute_command_and_get_output)
	(execute_command_and_get_output, remove_trailing_white_spaces):
	Declare new functions.
	* src/abg-tools-utils.cc (execute_command_and_get_output)
	(get_dsos_provided_by_rpm, remove_trailing_white_spaces): Define
	new functions.
	* tests/test-diff-pkg.cc (in_out_specs): Add the new --private-dso
	option where it makes sense.
	* tools/abipkgdiff.cc (options::compare_private_dsos): Add new
	data member.
	(options::options): Initialize it.
	(package::public_dso_sonames_): Add new data member.
	(package::public_dso_sonames): Add new accessors pair.
	(display_usage): Add a help string for the new --private-dso
	option.
	(maybe_create_public_dso_sonames_set)
	(must_compare_public_dso_only): Define new static functions.
	(create_maps_of_package_content): Call the new
	maybe_create_public_dso_sonames_set.  Skip packages which SONAME
	is not in the set of public SONAMES.
	(parse_command_line): Parse the new --private-dso option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-28 14:22:35 +02:00
Dodji Seketeli
584f669a6a Report change locations in leaf reports
While working on something else, I noticed that in the leaf report,
source locations of changed ABI artifacts are not reported, even when
they should.

This patch fixes that.

	* src/abg-leaf-reporter.cc (report_diffs): Report the source
	location of the diff.
	* tests/data/test-diff-filter/test42-leaf-report-output-0.txt:
	Update test reference output.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt:
	Likewise.
	* tests/data/test-diff-suppr/test35-leaf-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-16 15:00:03 +01:00
Dodji Seketeli
30314e3a62 Bug 22913 - Correctly de-duplicate pointers to anonymous structs inside a given
During type DIE canonicalization, libabigail performs an optimization
while comparing two types defined in the same translation unit.  That
is, inside a given translation unit two pointers that point to a type
named T (that is, two T*) are considered equal.  They are considered
equal without having to structurally compare the two types named T.

This generally makes sense, because if two types of the same kind,
defined in the same translation unit, have the same name then we can
safely conclude that they are actually the same type.  Unless the two
T are anonymous structs.

If the two T are anonymous structs defined in the same translation
unit, we really need to compare them structurally to know if they are
equal or not.

This is what this patch does.

	* src/abg-dwarf-reader.cc
	(pointer_or_qual_die_of_anonymous_class_type)
	(die_is_qualified_type): Define new functions.
	(compare_dies): If pointers, reference or qualified type have an
	anonymous struct as their underlying type, then we need to
	structurally compare the underlying anonymous struct.
	* tests/data/test-diff-dwarf/libtest43-PR22913-v{0,1}.so: New
	binary test input files.
	* tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: New
	reference output of the comparison of the two binaries above.
	* tests/data/test-diff-dwarf/test43-PR22913-v{0,1}.c: Source code
	of the binaries above.
	* tests/test-diff-dwarf.cc (in_out_specs): Make the test harness
	compare the two binaries above.
	* tests/data/Makefile.am: Add the new test files above to the
	source distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-03-02 16:49:17 +01:00
Dodji Seketeli
59c0a2ac7c Initial support for Ada ranges
In order for abipkgdiff to handle the gnat sub-packages GCC,
Libabigail needs to understand some Ada-specific constructs.  So far,
the only unsupported construct that was problematic is the Ada Range
type.  This patch thus adds support for that Range type and so makes
it possible to handle the gnat sub-packages of GCC.

In Ada, the range type is emitted as a DW_TAG_subrange_type that is
not necessarily emitted as a property of an array type.  In C and C++
however, that DW_TAG_subrange_type is always a property of an array
type.  So the patch adds support for a so-called "free-form"
DW_TAG_subrange_type.

First, in the IR, the abigail::array_type_def::subrange_types is now a
real full blown type which can have a name and an underlying type.
That type can now be created by the both the DWARF and abixml readers.
It can also be serialized by the abixml writer.

Note that changes in the underlying type and on the name of the range
are not yet reported by the reporting engine.  That would have to be
added in a subsequent patch set.

	* include/abg-ir.h (type_maps::subrange_types): Declare new
	accessors.
	(is_ada_language, is_subrange_type): Declare new functions.
	(class array_type_def::subrange_type): Make this extend type_base
	and decl_base.
	(array_type_def::subrange_type::{get_language, operator==,
	get_pretty_representation, traverse}): Declare new member
	functions.
	(ir_node_visitor::visit_begin): Add new overloads for
	array_type::def::subrange_type.
	* src/abg-dwarf-reader.cc (build_subrange_type): Define new static
	function.
	(build_subranges_from_array_type_die): Cleanup the parameters of
	this function.
	(build_array_type): Adjust.
	(build_ir_node_from_die): Support free-form DW_TAG_subrange_type.
	(read_context::odr_is_relevant): Handle Ada.
	(die_qualified_type_name): Support DW_TAG_subrange_type.
	(die_pretty_print_type): Likewise.  Make the handling of
	DW_TAG_subrange_type use die_qualified_type_name.  Adjust the use
	of build_subranges_from_array_type_die.
	(get_scope_die): a DW_TAG_array_type cannot be a scope.  Rather,
	it's its scope that can be a scope.
	* src/abg-ir.cc (type_maps::priv::subrange_types_): New data
	member.
	(type_maps::empty): Adjust.
	(type_maps::subrange_types): Define new accessors.
	(is_ada_language, is_subrange_type): Define new functions.
	(odr_is_relevant): Support Ada.
	(maybe_update_types_lookup_map): Add an overload for
	array_type_def::subrange_type.  In the decl_base_sptr overload,
	add support for the array_type_def::subrange_type type.
	(struct array_type_def::subrange_type::priv::location_): Remove
	this as it's now carried by the parent decl_base type.
	(array_type_def::subrange_type::subrange_type): Adjust.  Take an
	environement pointer, a name, an underlying type and a language.
	(array_type_def::subrange_type::{g,s}et_underlying_type): Define
	new accessors.
	(array_type_def::subrange_type::{get_language,
	get_pretty_representation, traverse}): Define new member
	functions.
	(array_type_def::subrange_type::as_string): Add a representation
	for Ada.
	(equals): Define new overload for array_type_def::subrange_type.
	(array_type_def::subrange_type::operator==): Define three new
	overloads for decl_base, type_base and subrange_type.
	(array_type_def::subrange_type::operator!=): Define new operator.
	(get_type_representation): In the overload for array_type_def,
	support Ada.
	(array_type_def::get_language): Define new member function.
	(ir_node_visitor::visit_{begin,end}): Define new overloads for
	array_type_def::subrange_type.
	* src/abg-reader.cc (build_subrange_type): Adjust documentation.
	Support the new 'id', 'name', and 'type-id' properties.
	* src/abg-writer.cc (write_array_subrange_type): Define new static
	function.
	(write_array_type_def): Use the new write_array_subrange_type
	function.
	* tests/data/test-abidiff/test-PR18166-libtirpc.so.abi: Adjust.
	* tests/data/test-annotate/libtest23.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-annotate/test13-pr18894.so.abi: Likewise.
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-annotate/test7.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest23.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns.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.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise.
	* tests/data/test-read-dwarf/test7.so.abi: Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
	* tests/data/test-read-write/test25.xml: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-02-28 16:24:45 +01:00
Dodji Seketeli
4274691cdf Skip class types with changed names in leaf reports
In leaf reports, a class type which is said to have changed name
should not be reported because it doesn't make sense there.  In the
full report however, a class sub-type of a type foo changed name is
worth mentioning.

This patch detects name changes of class types in the context of leaf
reports and avoid reporting impacted types.

	* include/abg-comp-filter.h (has_class_or_union_type_name_change)
	(has_basic_or_class_type_name_change): Declare new functions.
	* include/abg-comparison.h (is_diff_of_class_or_union_type):
	Likewise.
	* src/abg-comp-filter.cc (has_class_or_union_type_name_change)
	(has_basic_or_class_type_name_change):
	* src/abg-comparison.cc
	(leaf_diff_node_marker_visitor::visit_begin): Use the new
	filtering::has_basic_or_class_type_name_change to test if a basic
	or class/union diff type carries a name change.  Update comment.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt:
	Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-01-18 15:56:13 +01:00
Dodji Seketeli
b3c3049fdd Update copyright notice for all source files
Happy New Year 2018, I guess :-)

	* update-copyright.sh: New sed-based script to update the year
	in the copyright notice.
	* include/abg-comp-filter.h: Updated the year in the copyright
	notice.
	* include/abg-comparison.h: Likewise.
	* include/abg-config.h: Likewise.
	* include/abg-corpus.h: Likewise.
	* include/abg-diff-utils.h: Likewise.
	* include/abg-dwarf-reader.h: Likewise.
	* include/abg-fwd.h: Likewise.
	* include/abg-hash.h: Likewise.
	* include/abg-ini.h: Likewise.
	* include/abg-interned-str.h: Likewise.
	* include/abg-ir.h: Likewise.
	* include/abg-libxml-utils.h: Likewise.
	* include/abg-libzip-utils.h: Likewise.
	* include/abg-reader.h: Likewise.
	* include/abg-reporter.h: Likewise.
	* include/abg-sptr-utils.h: Likewise.
	* include/abg-suppression.h: Likewise.
	* include/abg-tools-utils.h: Likewise.
	* include/abg-traverse.h: Likewise.
	* include/abg-viz-common.h: Likewise.
	* include/abg-viz-dot.h: Likewise.
	* include/abg-viz-svg.h: Likewise.
	* include/abg-workers.h: Likewise.
	* include/abg-writer.h: Likewise.
	* src/abg-comp-filter.cc: Likewise.
	* src/abg-comparison-priv.h: Likewise.
	* src/abg-comparison.cc: Likewise.
	* src/abg-config.cc: Likewise.
	* src/abg-corpus-priv.h: Likewise.
	* src/abg-corpus.cc: Likewise.
	* src/abg-default-reporter.cc: Likewise.
	* src/abg-diff-utils.cc: Likewise.
	* src/abg-dwarf-reader.cc: Likewise.
	* src/abg-hash.cc: Likewise.
	* src/abg-ini.cc: Likewise.
	* src/abg-internal.h: Likewise.
	* src/abg-ir-priv.h: Likewise.
	* src/abg-ir.cc: Likewise.
	* src/abg-leaf-reporter.cc: Likewise.
	* src/abg-libxml-utils.cc: Likewise.
	* src/abg-libzip-utils.cc: Likewise.
	* src/abg-reader.cc: Likewise.
	* src/abg-reporter-priv.cc: Likewise.
	* src/abg-reporter-priv.h: Likewise.
	* src/abg-sptr-utils.cc: Likewise.
	* src/abg-suppression-priv.h: Likewise.
	* src/abg-suppression.cc: Likewise.
	* src/abg-tools-utils.cc: Likewise.
	* src/abg-traverse.cc: Likewise.
	* src/abg-viz-common.cc: Likewise.
	* src/abg-viz-dot.cc: Likewise.
	* src/abg-viz-svg.cc: Likewise.
	* src/abg-workers.cc: Likewise.
	* src/abg-writer.cc: Likewise.
	* tests/print-diff-tree.cc: Likewise.
	* tests/test-abicompat.cc: Likewise.
	* tests/test-abidiff-exit.cc: Likewise.
	* tests/test-abidiff.cc: Likewise.
	* tests/test-alt-dwarf-file.cc: Likewise.
	* tests/test-core-diff.cc: Likewise.
	* tests/test-diff-dwarf-abixml.cc: Likewise.
	* tests/test-diff-dwarf.cc: Likewise.
	* tests/test-diff-filter.cc: Likewise.
	* tests/test-diff-pkg.cc: Likewise.
	* tests/test-diff-suppr.cc: Likewise.
	* tests/test-diff2.cc: Likewise.
	* tests/test-ir-walker.cc: Likewise.
	* tests/test-lookup-syms.cc: Likewise.
	* tests/test-read-dwarf.cc: Likewise.
	* tests/test-read-write.cc: Likewise.
	* tests/test-types-stability.cc: Likewise.
	* tests/test-utils.cc: Likewise.
	* tests/test-utils.h: Likewise.
	* tests/test-write-read-archive.cc: Likewise.
	* tools/abiar.cc: Likewise.
	* tools/abicompat.cc: Likewise.
	* tools/abidiff.cc: Likewise.
	* tools/abidw.cc: Likewise.
	* tools/abilint.cc: Likewise.
	* tools/abipkgdiff.cc: Likewise.
	* tools/abisym.cc: Likewise.
	* tools/binilint.cc: Likewise.
	* tools/kmidiff.cc: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-01-08 18:24:26 +01:00
Dodji Seketeli
8028cdd236 Bug 22488 - Make abipkgdiff handle different binaries with same basename
Some packages might have different binaries with the same soname and
basename, but at different paths.  In that case, abipkgdiff messes
things up because it only either consider the soname or the basename
of the binary.

This patch makes abipkgdiff to always consider the full path of the
binary inside the package.

	* include/abg-tools-utils.h (string_suffix)
	(sorted_strings_common_prefix): Declare new functions.
	(dir_name): Take a new keep_separator_at_end parameter at the end.
	* src/abg-tools-utils.cc (dir_name): Take a new
	keep_separator_at_end parameter at the end.  Add a comment for it
	and update.
	(string_suffix, sorted_strings_common_prefix): Define new
	functions.
	(common_prefix): Define new static function.
	* tools/abipkgdiff.cc (get_interesting_files_under_dir): Forward
	declare this pre-existing static function.
	(package::{common_paths_prefix_, elf_file_paths_}): New data
	members.
	(package::{common_paths_prefix, elf_file_paths,
	convert_path_to_relative, convert_path_to_unique_suffix,
	load_elf_file_paths}): New member functions.
	(create_maps_of_package_content): Use the new
	package::{load_elf_file_paths, convert_path_to_unique_suffix}
	functions.
	(compare_prepared_userspace_packages): Show relative paths of
	package elements in reported.
	* tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt:
	Update test ouptut.
	* tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt:
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-12-06 16:01:55 +01:00
Dodji Seketeli
eead00efb0 Bug 22436 - make abipkgdiff accept several debuginfo packages
Sometimes, the debug information for one given package P can have been
split into several packages.  In that case, we need abipkgdiff to
consider several debug info packages for a given input binary package.

This patch makes abipkgdiff to accept several --d{1,2} <debug-info-package>
option, for a given input package.

	* doc/manuals/abipkgdiff.rst: Document the fact that --d{1,2} can
	be provided several times on the command line.
	* tools/abipkgdiff.cc (options::debug_packages{1,2}): Rename the
	debug_package{1,2} data members into this, and make them be vector
	of strings, rather than just strings.
	(package::debug_info_packages_): Renamed
	package::debug_info_package_ into this and make it be a vector of
	package_sptr, rather than just a package_sptr.
	(package::debug_info_packages): Renamed the method
	package::debug_info_package into this and -- for the getter
	overload -- make it return a vector of package_sptr, rather than
	just a package_sptr.  Likewise for the setter overload.  Add a
	non-const getter overload.
	(package::erase_extraction_directories)
	(extract_package_and_map_its_content): Adjust.
	(extract_rpm, extract_deb): Do not erase the content of the
	extraction directory (if it was pre-existing) prior to extracting
	the RPM/deb into it.
	(pkg_extraction::pkgs): Renamed pkg_extraction::pkg into this and
	make it be a vector of packages, rather than just a package.
	(pkg_extraction::pkg_extraction): Adjust to take a package_sptr
	rather than just a package.  Add an overload to take a vector of
	packages_sptr.
	(pkg_extraction::perform): Extract the vector of package that the
	task is not responsible for, not just one random package.
	(extract_package_and_map_its_content): Adjust.
	(prepare_packages): Take smart pointers to package rather than
	just packages.  Adjust accordingly.
	(compare_prepared_package): Make the overload that takes two
	packages to take two smart pointers of packages.
	(compare): Make the overload that takes two package take two
	package_sptr.
	(parse_command_line): Parse having --d{1,2} several times for a
	given input package.
	(main): Take several debug info packages for one input file.
	* include/abg-tools-utils.h (split_string): Declare ...
	* src/abg-tools-utils.cc (split_string): ... new function.
	* tests/data/test-diff-pkg/libxfce4ui-debuginfo-4.12.1-8.fc27.ppc64.rpm:
	Add a new RPM test input file.
	* tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-ok-0.txt:
	new reference output file.
	* tests/data/Makefile.am: Add the new test input files above to source
	distribution.
	* tests/test-diff-pkg.cc (in_out_spec): Add new test entry to
	specify two debug info packages for one input package.
	(test_task::perform): Support having several debug info package
	paths in the IntOutSpec::{first,second}_in_debug_package_path data
	member.  The debug info packages paths are separated by either a
	white space or commas.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-11-27 17:15:20 +01:00
Dodji Seketeli
933c744034 Bug 22438 - Emit a clear message when debug info is not found
The alternate debug info file referred to a binary can be missing,
even though the rest of the debug info is not.  In that case,
libabigail starts loading the debug info and then it crashes when
trying to get DIEs that are part of the missing alternate debug info.

This patch detects when the alternate debug info is missing, so that
abidiff and abipkgdiff can gracefully bail out, yielding a meaningful
error message.

	* include/abg-dwarf-reader.h (enum abigail::dwarf_reader::status):
	Add a new STATUS_ALT_DEBUG_INFO_NOT_FOUND enumerator there.
	(refers_to_alt_debug_info): Declare new function.
	* src/abg-dwarf-reader.cc (read_corpus_from_elf): Detect when the
	referred-to alternate debug info file is not found and flip the
	STATUS_ALT_DEBUG_INFO_NOT_FOUND bit of the status accordingly.  If
	the debug info was found but not the alternate debug info, then do
	not try to read the debug info at all.
	(refers_to_alt_debug_info): Define new function.
	* tools/abidiff.cc (handle_error): Define new static function.
	(main): Use it, rather than handling errors preventing libabigail
	from reading the corpus on a case by case basis.
	tools/abipkgdiff.cc (compare): Handle the case where no alternate
	debug info was found.
	* tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt:
	New test output reference.
	* tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64.rpm:
	New test input RPM.
	* tests/data/test-diff-pkg/libxfce4ui-devel-debuginfo-4.12.1-8.fc27.ppc64.rpm:
	Likewise.
	* tests/data/Makefile.am: Add the new test files above to source
	distribution.
	* tests/test-diff-pkg.cc (in_out_specs): Add a new test case from
	the new input files above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-11-21 11:09:00 +01:00
Dodji Seketeli
8c51a89525 Wire the --no-show-locs option to abidw
Up until now, the --no-show-locs option only had effect when abidiff
was used with the --abidiff option.  It had no effect on the ABIXML
output of abidw.

This patch changes that to make it so that --no-show-locs avoids
emitting source location to the ABIXML output.

	* doc/manuals/abidw.rst: Update the documentation.
	* tests/test-annotate.cc: Now that --no-show-locs has an effect on
	the ABIXML output, let's not use it here, because it changes the
	output and we don't want that.
	* tools/abidw.cc (display_usage): Fix a typo in the help string.
	(load_corpus_and_write_abixml): Set the "show-locs" option to the
	write_context object that we use.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-11-02 12:57:11 +01:00
Dodji Seketeli
d3ddf609d9 Add a --leaf-changes-only option to abipkgdiff
This patch adds the --leaf-changes-only option to abipkgdiff, just
like what we have for abidiff.  The patch also emit leaf changes
report by default when comparing two Linux Kernel packages.

The patch also adds the --impacted-interfaces and --full-impact
options.

	* doc/manuals/abipkgdiff.rst: Add documentation for the new
	--leaf-change-only, --impacted-interfaces and --full-impact
	options.
	* tools/abipkgdiff.cc (options::{leaf_changes_only,
	show_impacted_interfaces, show_full_impact_report): Add new data
	members.
	(options::options): Initialize them.
	(display_usage): Add help strings for the new --leaf-change-only,
	--impacted-interfaces and --full-impact|-f options.
	(set_diff_context_from_opts): Set the diff context for the
	'leaf-changes-only' and 'show-impacted-interfaces' flags.
	(parse_command_line): Parse the --leaf-change-only,
	--impacted-interfaces and --full-impact options.  Handle the case
	where the --linux-kernel-abi-whitelist|-w option is given a
	whitelist *package*.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt:
	New test output reference.
	* tests/test-diff-pkg.cc (in_out_spec): Compare
	data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64.rpm and
	data/test-diff-pkg/spice-server-0.12.8-1.el7.x86_64.rpm with the
	new --leaf-changes-only and --impacted-interfaces options, using
	the new output reference above.
	* tests/data/Makefile.am: Add the new test material to source
	distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-10-08 18:51:35 +02:00
Dodji Seketeli
108a6074a5 Initial implementation of a --leaf-changes-only option to abidiff
This patch allows abidiff to take the --leaf-changes-only option and
then to display only the changes that are local to any given type.
That means the reporting agent won't follow pointers when displaying
changes.  That gives less context to the ABI change reports but then
they are less cluttered.

To do this, the patch introduces a new reporting agent to libabigail:
abigail::comparison::leaf_reporter.  When given a graph of diff nodes,
this agent only reports about the leaf (local) changes.  That is, it
will *NOT* follow pointers, references, underlying types of qualified
and typedef types and things like that. It will just report about
changes that are local to a given type.

This reporting agent is then used (in lieu of the default
abigail::comparison::default_reporter agent) when the
--leaf-changes-only option is provided by the user on the command line
of abidiff.

Note that abidiff also takes the --impacted-interfaces option to so
that the leaf reporter shows the set of interfaces impacted
by each leaf change.

	* doc/manuals/abidiff.rst: Add documentation the new
	--leaf-changes-only and --impacted-interfaces options.
	* src/abg-leaf-reporter.cc: New file.
	* src/Makefile.am: Add the new src/abg-leaf-reporter.cc file to
	source distribution.
	* include/abg-fwd.h (get_var_size_in_bits)
	(function_decl_is_less_than): Declare new functions.
	(get_name): Add new overload for type_or_decl_base*.
	* include/abg-ir.h (struct type_or_decl_hash, type_or_decl_equal)
	(type_or_decl_base_comp): Define new types.
	(artifact_sptr_set_type, artifact_ptr_set_type): Define new
	typedefs.
	* include/abg-comp-filter.h: Update copyright year.
	(has_basic_type_name_change): Add new function declaration.
	* src/abg-comp-filter.cc (decl_name_changed): Take a
	type_or_decl_base rather than just a decl.  Add an overload for
	diff*.
	(has_basic_type_name_change): Define new function.
	* include/abg-comparison.h: Update copyright year.
	(string_diff_ptr_map): Define this new typedef.
	(class diff_maps): Define this new class.
	(diff_context::{set_corpora}): Remove this member function.
	(diff_context::{set_corpus_diff, get_corpus_diff,
	show_leaf_changes_only, show_impacted_interfaces,
	forbid_visiting_a_node_twice_per_interface}): Declare these new
	member functions.
	(diff_node_visitor::priv_): Add a new pimpl data member.
	(diff_node_visitor::{diff_node_visitor, get_visiting_kind,
	set_visiting_kind}): Turn these into out-of-line member functions.
	(diff_node_visitor::{set,get}_current_topmost_iface_diff): Add new
	member functions.
	(class {scope_diff, function_type_diff, corpus_diff}): Add class
	leaf_reporter as a friend.
	(corpus_diff::mark_leaf_diff_nodes, get_leaf_diffs): Declare new
	member functions.
	(diff::{visiting_a_node_twice_is_forbidden_per_interface,
	parent_interface_node}): Define new member functions.
	(is_diff_of_basic_type): Return a type_decl_diff* rather than just
	a bool.
	(is_enum_diff, is_array_diff, is_function_type, is_typedef_diff)
	(is_corpus_diff): Declare new functions.
	(corpus_diff::diff_stats::{num_leaf_changes,
	num_leaf_changes_filtered_out, net_num_leaf_changes}): Add new
	member functions.
	(is_distinct_diff): Declare new function.
	* include/abg-reporter.h: Forward-declare "class diff_maps".
	(reporter_base::diff_to_be_reported): Declare a new virtual member
	function.
	(reporter_base::{report_local_typedef_changes,
	report_local_reference_type_changes,
	report_local_function_type_changes}): Declare new member
	functions.
	(class leaf_reporter): Define new type.
	* src/abg-comparison-priv.h (struct diff_hash, diff_equal): Define
	new types.
	(diff_artifact_set_map_type): Define new typedef.
	(diff_context::priv::{first_corpus_, second_corpus_}): Remove
	these data members.
	(diff_context::priv::{corpus_diff_, leaf_changes_only_,
	reset_visited_diffs_for_each_interface_,
	show_impacted_interfaces_}): Add new data members.
	(diff_context::priv::priv): Adjust.
	(corpus_diff::priv::{leaf_diffs_, parent_interface_}): Add new
	data member.
	(corpus_diff::diff_stats::priv::{num_leaf_changes,
	num_leaf_changes_filtered_out}): Add new data members.
	(corpus_diff::priv::count_leaf_changes): Define new member
	function.
	(sort_artifacts_set, get_fn_decl_or_var_decl_diff_ancestor)
	(is_diff_of_global_decls): Declare new functions.
	(function_comp::operator()): Factorize this out into the new
	function abigail::ir::function_decl_is_less_than.
	* src/abg-ir.cc (get_var_size_in_bits)
	(function_decl_is_less_than): Define new functions.
	(get_name): Define new overload for type_or_decl_base*.
	* src/abg-comparison.cc (is_enum_diff, is_typedef_diff)
	(is_array_diff, is_function_type_diff, is_corpus_diff)
	(is_distinct_diff, sort_artifacts_set, is_diff_of_global_decls):
	Define new functions.
	(is_union_diff): Fix comment.
	(diff_context::forbid_visiting_a_node_twice_per_interface): Define
	new member functions.
	(diff_context::set_corpus_diff, get_corpus_diff)
	(diff_context::show_leaf_changes_only)
	(diff_context::visiting_a_node_twice_is_forbidden_per_interface)
	(diff_context::show_impacted_interfaces): Define new member
	functions.
	(diff_context::get_reporter): Create the reporter that matches
	what diff_context::show_leaf_changes_only says.
	(diff_node_visitor::priv): Define a new type.
	(diff_node_visitor::{diff_node_visitor, get_visiting_kind,
	set_visiting_kind, or_visiting_kind,
	set_current_topmost_iface_diff, get_current_topmost_iface_diff}):
	Define new out-of-line member functions.
	(struct diff_maps::priv): Define new type.
	(diff_maps::{diff_maps, get_type_decl_diff_map,
	get_type_decl_diff_map, get_enum_diff_map, get_class_diff_map,
	get_union_diff_map, get_typedef_diff_map, get_array_diff_map,
	get_function_type_diff_map, get_function_decl_diff_map,
	get_var_decl_diff_map, get_reference_diff_map,
	get_fn_parm_diff_map, get_distinct_diff_map, insert_diff_node,
	lookup_impacted_interfaces}): Define member functions.
	(corpus_diff::{mark_leaf_diff_nodes, get_leaf_diffs}): Define new
	member functions.
	(struct leaf_diff_node_marker_visitor): Define new type.
	(corpus_diff::apply_filters_and_suppressions_before_reporting):
	Mark diff nodes in here.
	(corpus_diff::traverse): Appropriately set the current topmost
	interface into the visitor before visiting a diff node.
	(compute_diff): In the overload for corpus_sptr, adjust to reflect
	that we are now storing the corpus_diff in the diff context.
	(is_diff_of_basic_type): Return a type_decl_diff*, not just a
	bool.
	(corpus_diff::priv::count_leaf_changes): Define a new member
	function.
	(corpus_diff::diff_stats::{num_leaf_changes,
	num_leaf_changes_filtered_out, net_num_leaf_changes}): Define new
	member functions.
	(corpus_diff::priv::apply_filters_and_compute_diff_stats): Use the
	new corpus_diff::priv::count_leaf_changes to compute the number of
	leaf changes.
	(corpus_diff::priv::emit_diff_stats): Emit the report about leaf
	type changes when necessary.
	* src/abg-reporter-priv.h (report_mem_header): Declare new
	overload.
	(maybe_show_relative_offset_change,): Pass the var_diff_sptr
	parameter by const reference.
	(represent): Pass the var_diff_sptr parameter by const reference
	and take a new "local-only" flag.
	(maybe_show_relative_size_change)
	(maybe_report_interfaces_impacted_by_diff): Declare new functions.
	* src/abg-default-reporter.cc: Adjust copyright year.
	(default_reporter::{report_local_typedef_changes,
	report_local_qualified_type_changes,
	report_local_reference_type_changes,
	report_local_function_type_changes}): Define new member functions.
	(default_reporter::report): Adjust.  Add an overload for
	function_type_diff&. In the overload for qualified_type_diff, if
	the name of the underlying type changed, do not detail the changes
	any further.  In the overload for function_decl_diff, Adjust to
	use the new diff_context::get_{first, second}_corpus member
	function.  In the overload for enum_diff, call the new
	maybe_report_interfaces_impacted_by_diff that is advertised below.
	* src/abg-reporter-priv.cc (represent): Adjust the overload for
	var_diff_sptr.
	(report_mem_header): Define new overload.
	(maybe_show_relative_size_change)
	(maybe_report_interfaces_impacted_by_diff): Define new functions.
	(reporter_base::diff_to_be_reported): Define new member function.
	(maybe_show_relative_offset_change): Pass the var_diff_sptr
	parameter by const reference.
	(represent): In the overload for var_diff_sptr, pass the
	var_diff_sptr parameter by reference.  Take a 'local_only' flag.
	Iisplay type changes only if we are not displaying "local changes
	only".  Display size changes of data members too, when in
	"local-only" mode.
	* src/abg-suppression.cc (sonames_of_binaries_match)
	(names_of_binaries_match): Adjust.
	* tools/abidiff.cc (options::{leaf_changes_only,
	show_impacted_interfaces}): Add new data members.
	(display_usage): Emit usage string for the new --leaf-changes-only
	and --impacted-interfaces options.
	(parse_command_line): Parse the new --leaf-changes-only and the
	--impacted-interfaces options.
	(set_diff_context_from_opts): Set the 'show-leaf-changes' and the
	'show-impacted-interfaces' flags.
	* tests/data/test-diff-filter/libtest42-leaf-report-v{0,1}.so: New
	test input.
	* tests/data/test-diff-filter/test42-leaf-report-output-0.txt: New
	test reference output.
	* tests/data/test-diff-filter/test42-leaf-report-v{0,1}.cc: Source
	code of the new test inputs.
	* tests/test-diff-filter.cc (in_out_specs): Use the new test
	inputs above in this harness.
	* tests/data/test-diff-suppr/libtest35-leaf-v0.so: New test input.
	* tests/data/test-diff-suppr/test35-leaf-report-0.txt: New test
	reference output.
	* tests/data/test-diff-suppr/test35-leaf-v{0,1}.cc: Source code of
	the new test inputs.
	* tests/data/test-diff-suppr/test35-leaf.suppr: Suppression
	specification to use for the test35 test.
	* tests/data/test-diff-suppr/libtest36-leaf-v0.so: New test input.
	* tests/data/test-diff-suppr/libtest36-leaf-v1.so: Likewise.
	* tests/data/test-diff-suppr/test36-leaf-report-0.txt: New
	reference test output.
	* tests/data/test-diff-suppr/test36-leaf-v0.cc: Source code of
	test input above.
	* tests/data/test-diff-suppr/test36-leaf-v1.cc: Likewise.
	* tests/test-diff-suppr.cc (in_out_specs): Use the new test inputs
	above in this harness.
	* tests/data/Makefile.am: Add the new test inputs above to source
	distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-10-08 18:51:35 +02:00
Dodji Seketeli
74105ff84b Bug 22122 - Fail to represent 'const array'
When computing canonical DIEs, the DWARF reader mistakenly represents
'array of const' and 'const array' the same.

This patch fixes that.

	* src/abg-dwarf-reader.cc (die_is_array_type): Define new static
	function.
	(die_is_pointer_or_reference_type): Also test that the DIE can be
	an array.
	* tests/data/test-read-dwarf/PR22122-libftdc.so: New binary test input.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: New reference output.
	* tests/data/Makefile.am: Add the two new test files above to
	source distribution.
	* tests/test-read-dwarf.cc (in_out_specs): Run this test harness
	over the new test input.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-09-11 18:07:02 +02:00
Dodji Seketeli
f42817a78a Bug 22015 - Failing to return global scope of a DIE in certain cases
During DWARF reading, it can happen that we want to get the global
scope of a DIE which translation unit hasn't yet been constructed.

In that case, use the global scope of the current translation unit.

	* src/abg-dwarf-reader.cc (get_scope_for_die): If the translation
	unit of the parent die hasn't yet been constructed, then return
	the global scope of the current translation unit.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so: New
	binary test input.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi:
	New reference test output.
	* tests/data/Makefile.am: Add the new test materials above to
	source distribution.
	* tests/test-read-dwarf.cc (in_out_specs): Add the new test input
	to the test suite.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-08-28 12:13:32 +02:00
Dodji Seketeli
bd863916ab Fix some make distcheck failures
Apparently we forgot to add some test input files to the source
distribution.

Fixed thus.

	* tests/data/Makefile.am: Add
	test-diff-dwarf/test42-PR21296-libgcc.so,
	test-diff-dwarf/test42-PR21296-libclang.so,
	test-diff-dwarf/test42-PR21296-clanggcc-report0.txt to the source
	distribution.  Also look for test-diff-filter/test39* tests inputs
	in the test-diff-filter/test39/ directory.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-17 17:12:53 +02:00
Dodji Seketeli
2e2c5ff1cb Bug 21153 - abipkgdiff reports undetermined interface subtype changes
When a type has a noop qualifier and that noop qualifier disapears in
a subsequent version of that type, the two versions of the type have
different internal pretty representations.  And that leads to the type
canonicalization code ending up with two different canonical types for
the two versions, even if they should be considered equivalent.

This patch makes a noop-qualified type have the same internal pretty
representation as its non-qualified variant.

	* src/abg-ir.cc (get_name_of_qualified_type): A noop-qualified
	type has an empty string as reprsentation for its qualifier.
	* src/abg-dwarf-reader.cc (die_qualified_type_name): Adjust to
	comply with what is done in get_name_of_qualified_type.  Adjust
	comment too.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Adjust.
	* tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt:
	New reference test output.
	* tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm: New
	test binary input.
	* tests/data/test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm: Likewise.
	* tests/data/test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm: Likewise.
	* tests/data/test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm Likewise.
	* tests/data/Makefile.am: Add the new test inputs to source distribution.
	* tests/test-diff-pkg.cc (in_out_specs): Make this test harness run on
	the new test inputs above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-05 18:04:28 +02:00
Dodji Seketeli
6f7d84e508 Better handle decl-only classes being different from their definition
Sincea little while, libabigail can now handle the presence of several
different class types definition that have the same name.

To handle that, we settled that for types originating from C, a
decl-only class would be considered different from a definition of
that class.  Especially during type canonicalization.

Now it seems that it's wrong to consider this only for C types.  That
is because the same class type foo, defined in a C header, can be
compile either into a C++ compilation unit, or a C one, in the same
binary.  That is, in the same binary, a struct type foo can be seen
defined in a C compilation unit *and* in a C++ compilation unit.

So rigth now, the C++ struct type foo would compare equal to a
decl-only struct foo, but the C struct type foo would compare
different to a decl-only struct foo.  This leads to spurious change
reports, especiall in the nmap and mariadb package from Fedora 25,
when we run selfcheck.py on fc25 critpath packages.

This patch makes libabigail always consider -- during type
canonicalization -- that a decl-only class is different from a
definition of that class.  Not only for C.

	* src/abg-comparison.cc (function_decl_diff::report): Don't report
	possible vtable changes between a decl-only class and its
	definition.
	* src/abg-ir.cc (type_base::get_canonical_type_for): Consider that
	a decl-only class is different from its definition when comparing
	types for the purpose of type canonicalization.
	(equals): In the class_or_union overload, only consider the global
	decl_only_class_equals_definition() property to know when to
	consider that a decl-only class is different from its definition
	when comparing two classes.
	* src/abg-reader.cc (build_class_decl): Read the size property of
	a class, even if it's a decl-only class.
	* src/abg-writer.cc (write_class_decl_opening_tag): Write size
	property of types even if the types are decl-only classes.
	* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi:
	Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
	Likewise.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-04 16:47:43 +02:00
Dodji Seketeli
90919fceeb Bug 21627 - Libabigail doesn't consider translation unit compile dir
The path of a translation unit is relative to the directory where that
translation unit was compiled.

So there can be several different translation units (in the same
binary) that have the same (relative) paths.  To tell them apart, one
needs to consider the compile directory of those translation units.

But then Libabigail ignores the compilation directory of translation
units.  It just considers their (relative) path.  That leads to
different translation units having the same path.

Furthermore, there can be a translation unit with full path (one that
takes into account the file name and its compile directory) named "P"
that contains function definitions f1 and f2, as described by the
debug info.  Further down the road, there can be *another* translation
unit which also has "P" as its full path, and that cotnains function
definitions f3 and f4.  A way to understand is to consider that the
translation unit of full path "P" contains f1, f2, f3 and f4.

This patch introduces the concept of the compile dir of a given
translation unit, and the concept of the absolute path of the
translation unit which would then be a concatenation of the compile
dir and relative paths of the translation unit.

The patch also tries to reuse a translation unit with a given path,
*if* that translation unit has already been seen in the current
binary, instead of creating a new one altogether.

This patch doesn't carry a regression test as the problem was found
while running the
https://pagure.io/libabigail-selfcheck/blob/master/f/selfcheck.py
script over the Fedora 25 critpath packages.

The patch does however update existing reference outputs of existings
tests where appropriate.

	* include/abg-ir.h (translation_unit::{get_compilation_dir_path,
	set_compilation_dir_path, get_absolute_path}):
	* src/abg-corpus.cc (corpus::add): Use the new
	translation_unit::get_absolute_path() as the key for the tu path
	-> tu map.
	* src/abg-dwarf-reader.cc
	(read_context::resolve_declaration_only_classes):  Use the new
	translation_unit::get_absolute_path().
	(build_translation_unit_and_add_to_ir): Set the compilation
	directory of the translation unit.
	* src/abg-ir-priv.h (translation_unit::priv::{comp_dir_path_,
	abs_path_}):
	* src/abg-ir.cc (translation_unit::set_path): Update comment.
	(translation_unit::{get_compilation_dir_path,
	set_compilation_dir_path, get_absolute_path}): Define new member
	functions.
	* src/abg-reader.cc (read_translation_unit): Take the new
	'comp-dir-path' attribute into account.
	* src/abg-writer.cc (write_translation_unit): Emit the new
	'comp-dir-path' attribute.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Adjust.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Adjust.
	* tests/data/test-annotate/test0.abi: Adjust.
	* tests/data/test-annotate/test1.abi: Adjust.
	* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-annotate/test17-pr19027.so.abi: Adjust.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust.
	* tests/data/test-annotate/test2.so.abi: Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust.
	* tests/data/test-annotate/test21-pr19092.so.abi: Adjust.
	* tests/data/test-annotate/test3.so.abi: Adjust.
	* tests/data/test-annotate/test4.so.abi: Adjust.
	* tests/data/test-annotate/test5.o.abi: Adjust.
	* tests/data/test-annotate/test6.so.abi: Adjust.
	* tests/data/test-annotate/test7.so.abi: Adjust.
	* tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Adjust.
	* tests/data/test-read-dwarf/libtest23.so.abi: Adjust.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust.
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust.
	* tests/data/test-read-dwarf/test0.abi: Adjust.
	* tests/data/test-read-dwarf/test1.abi: Adjust.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust.
	* tests/data/test-read-dwarf/test2.so.abi: Adjust.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust.
	* tests/data/test-read-dwarf/test3.so.abi: Adjust.
	* tests/data/test-read-dwarf/test4.so.abi: Adjust.
	* tests/data/test-read-dwarf/test5.o.abi: Adjust.
	* tests/data/test-read-dwarf/test6.so.abi: Adjust.
	* tests/data/test-read-dwarf/test7.so.abi: Adjust.
	* tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-04 16:35:35 +02:00
Dodji Seketeli
bb0c1c322d Symbols with the same zero value are not aliases
When looking at ELF file of the ET_REL kind (i.e, relocatable object
files), several kinds of symbols (for instance weak symbols) can have
the symbol value zero.  Although they have the same value, the fact
that that value is zero prevents us from considering those symbols as
being aliases.

Libabigail was wrongly considering those symbols with value zero as
being aliases.  So, in practice, it was considering all WEAK symbols
as being aliases, because the value of a weak symbols is zero.

When comparing two binaries originating from the same source code, one
compiled with g++ and the other one compiled with clang++, abidiff was
thus reporting spurious function aliases changes due to this issue.

Note that the two binaries in question come from the bug PR21486.
Comparing them using abidiff exhibits several other issues that were
fixed in previous commits, such as

 - Reporting changes about top cv qualifier changes on function
 parameter types.
 - Not supporting ELF symbol visibility

	* src/abg-dwarf-reader.cc (load_symbol_maps_from_symtab_section):
	Do not consider symbols with zero value as being aliases.
	* tests/data/test-diff-filter/test20-inline-report-0.txt: Adjust.
	* tests/data/test-diff-filter/test20-inline-report-1.txt:
	Likewise.
	* test-diff-filter/test41-PR21486-abg-writer.gcc.o: New test
	binary input.
	* tests/data/test-diff-filter/test41-PR21486-abg-writer.llvm.o:
	Likewise.
	* tests/data/Makefile.am: Add the new test material to source
	distribution.
	* tests/test-diff-filter.cc (in_out_specs): Run the test harness
	on the new test input above.
	* tests/data/test-diff-dwarf/test5-report.txt: Adjust.
	* tests/data/test-diff-filter/test9-report.txt: Adjust.
	* tests/data/test-diff-filter/test20-inline-report-0.txt: Adjust.
	* tests/data/test-diff-filter/test20-inline-report-1.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:49 +02:00
Dodji Seketeli
a7492fea56 Support ELF symbol visibility property
This patch models the ELF symbol visibility property and support
ignoring function and variable symbols that are HIDDEN and INTERNAL,
even if they have default binding.

	* include/abg-ir.h (enum elf_symbol::visibility): Define new enum.
	(elf_symbol::{elf_symbol, create}): Take a visibility parameter.
	(elf_symbol::{set, get}_visibility): Declare new accessors.
	(string_to_elf_symbol_binding): Declare new function.
	* src/abg-ir.cc (elf_symbol::priv::visibility_): New data member.
	(elf_symbol::priv::priv): Adjust.
	(elf_symbol::elf_symbol): Take a visibility parameter.
	(elf_symbol::create): Likewise
	(elf_symbol::{s,g}et_visibility): Define new accessors.
	(elf_symbol::is_public): Adjust.
	(operator<<(std::ostream&, elf_symbol::visibility)): Define new
	operator.
	(string_to_elf_symbol_visibility): Define new function.
	* src/abg-dwarf-reader.cc (stv_to_elf_symbol_visibility): Define
	new static function.
	(lookup_symbol_from_sysv_hash_tab)
	(lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_symtab)
	(create_default_var_sym, create_default_fn_sym): Adjust.
	* src/abg-reader.cc (read_elf_symbol_binding): Define new
	function.
	(build_elf_symbol): Adjust.
	* src/abg-writer.cc (write_elf_symbol_visibility): Define new
	function.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Adjust.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Adjust.
	* tests/data/test-annotate/test0.abi: Adjust.
	* tests/data/test-annotate/test1.abi: Adjust.
	* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-annotate/test17-pr19027.so.abi: Adjust.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.
	* tests/data/test-annotate/test2.so.abi: Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Adjust.
	* tests/data/test-annotate/test21-pr19092.so.abi: Adjust.
	* tests/data/test-annotate/test3.so.abi: Adjust.
	* tests/data/test-annotate/test4.so.abi: Adjust.
	* tests/data/test-annotate/test5.o.abi: Adjust.
	* tests/data/test-annotate/test6.so.abi: Adjust.
	* tests/data/test-annotate/test7.so.abi: Adjust.
	* tests/data/test-annotate/test8-qualified-this-pointer.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/libtest23.so.abi: Adjust.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust.
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust.
	* tests/data/test-read-dwarf/test0.abi: Adjust.
	* tests/data/test-read-dwarf/test1.abi: Adjust.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test2.so.abi: Adjust.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test3.so.abi: Adjust.
	* tests/data/test-read-dwarf/test4.so.abi: Adjust.
	* tests/data/test-read-dwarf/test5.o.abi: Adjust.
	* tests/data/test-read-dwarf/test6.so.abi: Adjust.
	* tests/data/test-read-dwarf/test7.so.abi: Adjust.
	* tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust.
	* tests/data/test-read-write/test26.xml: Adjust.
	* tests/data/test-read-write/test27.xml: Adjust.
	* tests/data/test-read-write/test28-without-std-fns-ref.xml:
	Adjust.
	* tests/data/test-read-write/test28-without-std-vars-ref.xml:
	Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:47 +02:00
Dodji Seketeli
c0bfc403dc Filter top cv qualifier changes on function parameter types
When the type of a function parameter sees its top CV qualifier
change, that should never negatively affect ABI compliance.

So this patch filters out top cv qualifier changes on function
parameter types, by default.

	* include/abg-comparison.h (enum diff_category): Add a new
	FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY enumerator.  "Or" the
	enumerator to the EVERYTHING_CATEGORY enumerator.
	* src/abg-comp-filter.cc (has_fn_parm_type_cv_qual_change): Define
	new static function.
	(categorize_harmless_diff_node): Categorize changes to top cv
	qualifiers on function parameter types into the new
	FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY.
	* src/abg-comparison.cc (get_default_harmless_categories_bitmap):
	Add the new FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY category to the
	set of harmless categories.
	(operator<<(ostream&, diff_category)): Adjust to serialize
	the new FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY.
	* tests/data/test-diff-filter/libtest40-v0.so: New test input binary.
	* tests/data/test-diff-filter/libtest40-v1.so: Likewise.
	* tests/data/test-diff-filter/test40-report-0.txt: New test
	reference output.
	* tests/data/test-diff-filter/test40-v0.cc: Source code of the
	test binary above.
	* tests/data/test-diff-filter/test40-v1.cc: Likewise.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-filter.cc (in_out_specs): Add new binaries to
	compare.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt:
	Adjust.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
	Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt:
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:47 +02:00
Dodji Seketeli
698f405740 Do not report about voffset when it's not set in debug info
Sometimes some virtual member functions don't have any virtual offset
set in the debug info.  This happens for virtual destructors
sometimes.  In that case, the ABI change report should not refer to
that unset virtual offset as being '0'.  Rather, it shouldn't refer to
it at all.

This is what this patch does.

	* include/abg-ir.h (mem_fn_context_rel::mem_fn_context_rel):
	Initialize the virtual offset to -1.
	* src/abg-comparison.cc (represent): In the overload to represent
	a method_decl, do not represent the vofffset if it's not set.
	* src/abg-writer.cc (write_voffset): The virtual offset is signed
	because if it's -1, it means no offset is set.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Adjust.
	* tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi:
	Adjust.
	* tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt: Adjust.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:47 +02:00
Dodji Seketeli
6eb2b268f8 Allow selective resolution of class declaration
When a class is forward-declared, resolving it to a definition that
appears later in the same translation unit or in another translation
is an interesting problem.

Until now, the declaration would be resolved to the definition of that
class found in the binary.  The problem is that there can be different
such definitions, especially in C where there is no "One Definition
Rule".  In that case, the definition chosen is random.

This patch resolves that randomness.

For a given class declaration, if there is just one possible
definition in the binary, then the declaration is resolved to that
definition.  If there is one definition for that declaration in the
same translation unit, then the declaration is resolved to that
definition.  If there are more than one definitions in translation
units that are not the one of the declaration, then the declaration is
left unresolved.  This is what I call "selective class declaration resolution".

Note that an unresolved class declaration now compares different to a
definition of a class of the same name.  This is so that we can have
an unresolved class be present in the resulting .abi file, alongside
an (incompatible) definition of the same class.  The change from a class
declaration to its definition is filtered out by default, though.

	* include/abg-fwd.h (type_base_wptrs_type)
	(istring_type_base_wptrs_map_type): Define new typedefs.
	(lookup_class_types): Declare new functions.
	* include/abg-ir.h
	(environment::decl_only_class_equals_definition): Declare new
	accessor.
	(type_maps::{*_types}): Make these accessors return
	istring_type_base_wptrs_map_type& instead of
	istring_type_base_wptr_map_type&.
	* src/abg-dwarf-reader.cc
	(read_context::resolve_declaration_only_classes): Implement the
	new selective declaration resolution scheme.
	* src/abg-ir.cc (type_maps::priv::{*_types_}): Change the type of
	these data members from istring_type_base_wptr_map_type to
	istring_type_base_wptrs_map_type.
	(type_maps::{*_types}): Make these accessors definitions return
	istring_type_base_wptrs_map_type& instead of
	istring_type_base_wptr_map_type&.
	(translation_unit::bind_function_type_life_time): Adjust.
	(environment::priv::decl_only_class_equals_definition_): New data
	member.
	(environment::priv::priv): Initialize it.  By default, a decl-only
	class is now considered different from its definition.
	(environment::decl_only_class_equals_definition): Define new
	accessor.
	(lookup_types_in_map, lookup_class_types): Define new functions.
	(lookup_type_in_map, lookup_union_type_per_location)
	(lookup_basic_type, lookup_basic_type_per_location)
	(lookup_class_type, lookup_class_type_per_location)
	(lookup_union_type, lookup_enum_type)
	(lookup_enum_type_per_location, lookup_typedef_type)
	(lookup_typedef_type_per_location, lookup_qualified_type)
	(lookup_pointer_type, lookup_reference_type, lookup_array_type)
	(lookup_function_type, maybe_update_types_lookup_map)
	(maybe_update_types_lookup_map<class_decl>)
	(maybe_update_types_lookup_map<function_type>): Adjust.
	(type_base::get_canonical_type_for): When doing type comparison
	here, we can now consider that an unresolved class declaration
	compares different to an incompatible class definition of the same
	name.  So no need to look through decl-only classes in that case.
	(equals): In the overload for class_or_union, if
	environment::decl_only_class_equals_definition() is false, then an
	unresolved class declaration of name "N" compares different to a
	class definition named "N".
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt:
	Adjust.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt:
	Adjust.
	* tests/data/test-diff-filter/test38/Makefile: New test material.
	* tests/data/test-diff-filter/test38/test38-a.c: Likewise.
	* tests/data/test-diff-filter/test38/test38-b.c: Likewise.
	* tests/data/test-diff-filter/test38/test38-c.c: Likewise.
	* tests/data/test-diff-filter/test38/test38-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test38/test38-v0: Likewise.
	* tests/data/test-diff-filter/test38/test38-v1: Likewise.
	* tests/data/test-diff-filter/test38/test38.h: Likewise.
	* tests/data/test-diff-filter/test39/Makefile: Likewise.
	* tests/data/test-diff-filter/test39/test39-a-v0.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-a-v1.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-b-v0.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-b-v1.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-c-v0.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-c-v1.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-main.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test39/test39-v0: Likewise.
	* tests/data/test-diff-filter/test39/test39-v1: Likewise.
	* tests/data/test-diff-filter/test39/test39.h: Likewise.
	* tests/data/Makefile.am: Add the new test material above to the
	source distribution.
	* tests/test-diff-filter.cc (in_out_specs): Add the new test
	inputs above to the test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:46 +02:00
Dodji Seketeli
5529a51a96 Do not report about voffset when it's not set in debug info
Sometimes some virtual member functions don't have any virtual offset
set in the debug info.  This happens for virtual destructors
sometimes.  In that case, the ABI change report should not refer to
that unset virtual offset as being '0'.  Rather, it shouldn't refer to
it at all.

This is what this patch does.

	* include/abg-ir.h (mem_fn_context_rel::mem_fn_context_rel):
	Initialize the virtual offset to -1.
	* src/abg-comparison.cc (represent): In the overload to represent
	a method_decl, do not represent the vofffset if it's not set.
	* src/abg-writer.cc (write_voffset): The virtual offset is signed
	because if it's -1, it means no offset is set.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Adjust.
	* tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi:
	Adjust.
	* tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt: Adjust.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:44 +02:00
Dodji Seketeli
4672ba4f4c Speedup DIE representation computing esp function signature in C
For DIE originating from C, we now compute canonical DIEs.  We then
use that to compare DIEs to see if they are equal or not.  So string
representation of DIEs are now used only to reduce the number of DIEs
comparisons that is performed during DIE canonicalization.

We can thus just use function names (rather than a full
die_function_signature) as a way to reduce the number of structural
comparisons of DIEs during canonicalization.

This patch does just that.

Note that in the future when we perform DIEs canonicalization and comparison for
C++, we can avoid computing full function DIE signatures for C++ too.

	* src/abg-dwarf-reader.cc (die_function_signature): For C DIEs,
	just return the (linkage) name of the function.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-annotate/test21-pr19092.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:43 +02:00
Dodji Seketeli
76d832115d Allow selective resolution of class declaration
When a class is forward-declared, resolving it to a definition that
appears later in the same translation unit or in another translation
is an interesting problem.

Until now, the declaration would be resolved to the definition of that
class found in the binary.  The problem is that there can be different
such definitions, especially in C where there is no "One Definition
Rule".  In that case, the definition chosen is random.

This patch resolves that randomness.

For a given class declaration, if there is just one possible
definition in the binary, then the declaration is resolved to that
definition.  If there is one definition for that declaration in the
same translation unit, then the declaration is resolved to that
definition.  If there are more than one definitions in translation
units that are not the one of the declaration, then the declaration is
left unresolved.  This is what I call "selective class declaration resolution".

Note that an unresolved class declaration now compares different to a
definition of a class of the same name.  This is so that we can have
an unresolved class be present in the resulting .abi file, alongside
an (incompatible) definition of the same class.  The change from a class
declaration to its definition is filtered out by default, though.

	* include/abg-fwd.h (type_base_wptrs_type)
	(istring_type_base_wptrs_map_type): Define new typedefs.
	(lookup_class_types): Declare new functions.
	* include/abg-ir.h
	(environment::decl_only_class_equals_definition): Declare new
	accessor.
	(type_maps::{*_types}): Make these accessors return
	istring_type_base_wptrs_map_type& instead of
	istring_type_base_wptr_map_type&.
	* src/abg-dwarf-reader.cc
	(read_context::resolve_declaration_only_classes): Implement the
	new selective declaration resolution scheme.
	* src/abg-ir.cc (type_maps::priv::{*_types_}): Change the type of
	these data members from istring_type_base_wptr_map_type to
	istring_type_base_wptrs_map_type.
	(type_maps::{*_types}): Make these accessors definitions return
	istring_type_base_wptrs_map_type& instead of
	istring_type_base_wptr_map_type&.
	(translation_unit::bind_function_type_life_time): Adjust.
	(environment::priv::decl_only_class_equals_definition_): New data
	member.
	(environment::priv::priv): Initialize it.  By default, a decl-only
	class is now considered different from its definition.
	(environment::decl_only_class_equals_definition): Define new
	accessor.
	(lookup_types_in_map, lookup_class_types): Define new functions.
	(lookup_type_in_map, lookup_union_type_per_location)
	(lookup_basic_type, lookup_basic_type_per_location)
	(lookup_class_type, lookup_class_type_per_location)
	(lookup_union_type, lookup_enum_type)
	(lookup_enum_type_per_location, lookup_typedef_type)
	(lookup_typedef_type_per_location, lookup_qualified_type)
	(lookup_pointer_type, lookup_reference_type, lookup_array_type)
	(lookup_function_type, maybe_update_types_lookup_map)
	(maybe_update_types_lookup_map<class_decl>)
	(maybe_update_types_lookup_map<function_type>): Adjust.
	(type_base::get_canonical_type_for): When doing type comparison
	here, we can now consider that an unresolved class declaration
	compares different to an incompatible class definition of the same
	name.  So no need to look through decl-only classes in that case.
	(equals): In the overload for class_or_union, if
	environment::decl_only_class_equals_definition() is false, then an
	unresolved class declaration of name "N" compares different to a
	class definition named "N".
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt:
	Adjust.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt:
	Adjust.
	* tests/data/test-diff-filter/test38/Makefile: New test material.
	* tests/data/test-diff-filter/test38/test38-a.c: Likewise.
	* tests/data/test-diff-filter/test38/test38-b.c: Likewise.
	* tests/data/test-diff-filter/test38/test38-c.c: Likewise.
	* tests/data/test-diff-filter/test38/test38-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test38/test38-v0: Likewise.
	* tests/data/test-diff-filter/test38/test38-v1: Likewise.
	* tests/data/test-diff-filter/test38/test38.h: Likewise.
	* tests/data/test-diff-filter/test39/Makefile: Likewise.
	* tests/data/test-diff-filter/test39/test39-a-v0.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-a-v1.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-b-v0.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-b-v1.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-c-v0.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-c-v1.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-main.c: Likewise.
	* tests/data/test-diff-filter/test39/test39-report-0.txt: Likewise.
	* tests/data/test-diff-filter/test39/test39-v0: Likewise.
	* tests/data/test-diff-filter/test39/test39-v1: Likewise.
	* tests/data/test-diff-filter/test39/test39.h: Likewise.
	* tests/data/Makefile.am: Add the new test material above to the
	source distribution.
	* tests/test-diff-filter.cc (in_out_specs): Add the new test
	inputs above to the test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:43 +02:00
Dodji Seketeli
b555713b47 Avoid de-duplicating different C types that have identical name
This patch introduces the concept of canonical DIEs.

To date, when two C types have the same string representation [1] and
are defined at the same location, they are considered to be the same,
just as in C++.

[1]: String representation of a type: For a type named
"Foo" that is a structure, the representation is "struct Foo"

This patch introduces more finesse in determining if two types are
different.

It implements comparing the DIEs of the types, directly from the DWARF
representation.  When comparing pointers, typedefs and qualified
types, the underlying type is compared recursively.

The type de-duplication scheme is now centered around two data
structures.

    1/ A map that associates the string representation of a type with
    a vector of the offsets of the type DIEs that have the same
    representation.  Members of this vector denotes DIEs of types that
    are *different* even if they all have the same representation.
    Each DIE in a given vector is the canonical DIE of its class of
    equivalence.  This map is the map of all canonical DIEs organized
    by the representation of those canonical DIEs.

    2/ A map that associates the offset of the canonical type DIE with
    the resulting internal representation of the type.  Here, the
    internal representation is an instance of the
    abigail::ir::type_base type.  This map is the map of the types
    associated to the canonical type DIEs.

There is also a vector that associates a DIE 'D' to its canonical DIE
'C'.  The index of the vector is the offset of 'D' and the value of
the element at that index is 'C'.

Thus, each time we are about to create (or get) an internal
representation for a type DIE denoted 'D', we first get the canonical
DIE of 'D', denoted C.  If C doesn't exist, we create it.  That is, we
add a new entry in the map 1/.  Then we look in map 2/ to see if the C
(and thus D) has a associated type.

If C has an associated type, we return it.

If C has no associated type, we create a type for it (and thus for D)
and we associate the new type to the offsets of both D and C.

The rest of the patch is mostly boiler plate and adjustment to
accomodate this new de-duplication scheme.

	* src/abg-dwarf-reader.cc (die_decl_map_type, die_type_map_type):
	Remove these typedefs.
	(die_artefact_map_type, istring_dwarf_offsets_map_type): New
	typedefs.
	(die_is_at_class_scope, die_qualified_type_name)
	(die_qualified_decl_name, die_qualified_type_name_empty)
	(die_return_and_parm_names_from_fn_type_die)
	(die_function_type_is_method_type):
	Const-ify the read_context& parameter.
	(read_context::die_source_dependant_container_set::get_container):
	Likewise.
	(read_context::{name_artefacts_map_, per_tu_name_artefacts_map_,
	die_decl_map_, alternate_die_decl_map_, type_unit_die_decl_map_,
	die_type_map_, alternate_die_type_map_, type_unit_die_type_map_}):
	Remove data members.
	(read_context::{die_decl_map, alternate_die_decl_map,
	associate_die_to_decl_primary, associate_die_to_decl_alternate,
	associate_die_to_decl_from_type_unit,
	lookup_decl_from_die_offset_primary,
	lookup_decl_from_die_offset_alternate,
	lookup_decl_from_type_unit_die_offset,
	lookup_type_artifact_from_die_per_tu,
	lookup_artifact_from_per_tu_die_representation,
	associate_die_to_artifact_by_repr,
	associate_die_to_artifact_by_repr_internal, clear_die_type_maps}):
	Remove member functions.
	(read_context::{decl_die_repr_die_offsets_maps_,
	type_die_repr_die_offsets_maps_, decl_die_artefact_maps_,
	type_die_artefact_maps_, dwarf_expr_eval_context_}): Add new data
	members.
	(read_context::clear_per_translation_unit_data): Don't clear
	read_context::per_tu_name_artefacts_map_ data member as it's
	removed.
	(read_context::clear_per_corpus_data): Don't clear
	read_context::name_artefacts_map_ and all the other relevant data
	members that got removed.
	(read_context::{dwarf_per_die_source,
	decl_die_repr_die_offsets_maps, type_die_repr_die_offsets_maps,
	get_canonical_die, get_die_from_offset, decl_die_artefact_maps,
	type_die_artefact_maps, dwarf_expr_eval_ctxt}): Add new member
	functions.
	(compare_dies, compare_as_decl_dies)
	(compare_as_type_dies, maybe_finish_function_decl_reading)
	(die_is_anonymous): Define new functions.
	(read_context::associate_die_to_decl): Remove the
	do_associate_by_repr_per_tu parameter.  Use the new
	read_context::{decl_die_artefact_maps_, get_canonical_die} member
	functions.
	(read_context::lookup_decl_from_die_offset): Use Dwarf_Off rather
	than size_t for the type of the die_offset parameter.  Use the
	lookup_artifact_from_die_offset member function.
	(read_context::lookup_type_artifact_from_die): Const-ify.  In one
	overload, take a new 'die_as_type' parameter.  Use the new
	get_canonical_die, type_die_artefact_maps and
	decl_die_artefact_maps member functions.  In the second overload,
	use the first overload.
	(read_context::odr_is_relevant): Add an overload that takes a DIE.
	(read_context::associate_die_to_type): Remove the
	do_associate_by_repr and do_associate_per_tu parameters.  Use the
	new get_canonical_die and type_die_artefact_maps member functions.
	(read_context::lookup_type_from_die): Use the new
	lookup_artifact_from_die member function.
	(read_context::lookup_type_from_die_offset): Use the new
	type_die_artefact_maps member function.  When the found artifact
	is a function_decl, return its type.
	(read_context::schedule_type_for_late_canonicalization):  Use the
	new get_canonical_die and type_die_artefact_maps member functions.
	(die_function_signature): Const-ify.  Get the scope name right
	even for scopes that are not types.
	(die_member_offset): Make eval_last_constant_dwarf_sub_expr use
	the new cached DWARF expression evalution context.
	(get_parent_die): Support where_offset equals to zero.  This means
	we are looking at a C binary, basically.
	(build_enum_type) : Use the new overload of
	read_context::odr_is_relevant that takes a DIE.  Adjust.
	(add_or_update_union_type, add_or_update_class_type): Don't lookup
	classes/unions per location anymore.  Now that we can compare DIEs
	in a fined grain manner, the approximation of the location is not
	useful anymore.
	(build_pointer_type)
	(build_function_type): Associate DIE to type if we reuse an
	existing type.
	(build_or_get_fn_decl_if_not_suppressed):  When re-using a
	function decl internal representation from an equivalent DIE that
	we've seen before, it can happen that we want to augment that
	function decl internal representation with new properties coming
	from the DIE we are currently looking at; do that here.
	(is_function_for_die_a_member_of_class): Remove the "where_offset"
	parameter.
	(add_or_update_member_function): Adjust.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-annotate/test17-pr19027.so.abi: Adjust.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust.
	* tests/data/test-annotate/test21-pr19092.so.abi: Adjust.
	* tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Adjust.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt: Adjust.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Adjust.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Adjust.
	* tests/data/test-read-dwarf/libtest23.so.abi: Adjust.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:42 +02:00
Dodji Seketeli
adb656cc76 Initial support of the serialization of the KMI of a Linux Kernel Tree
We have the kmidiff program that takes two Linux Kernel trees
containing the vmlinux binary and its modules and compare their Kernel
Module Interface, aka KMI.

We need to be able to serialize (save in a file) a representation of
that KMI.  We need to load that KMI back, and compare two serialized
KMIs.

This patch implements the serialization of the KMI of a Linux Kernel
tree.  It actually serializes an instance of abigail::ir::corpus_group
that is a collection of instances of abigail::ir::corpus.  The KMI of
each individual binary (vmlinux or kernel module) is represented by
one abigail::ir::corpus.  All the corpora share the same definitions
of types and decls, whenever that makes sense.

The patch thus factorizes the routines used to walk a Linux kernel out
of the kmidiff program.  These routines are then re-used in the abidw
program to make it walk a Linux kernel tree (when the --linux-tree
option is provided), load the vmlinux and module binaries as an
instance of abigail::corpus_group and serialize it out into an output
stream.

	* include/abg-tools-utils.h (check_dir)
	(get_binary_paths_from_kernel_dist)
	(build_corpus_group_from_kernel_dist_under): Declare new
	functions.  The last two functions are being moved from
	tools/kmidiff.cc so that they can be re-used.
	* include/abg-writer.h (write_corpus): Declare one overload that
	takes a write_context parameter.
	(write_corpus_group): Declare three overloads of this new function.
	* src/abg-tools-utils.cc (check_dir): Define new function.
	(load_generate_apply_suppressions, is_vmlinux, is_kernel_module)
	(find_vmlinux_and_module_paths)
	(get_binary_paths_from_kernel_dist)
	(build_corpus_group_from_kernel_dist_under): Define new functions.
	* src/abg-writer.cc (write_context::set_annotate): Define new
	member function.
	(write_corpus): Add an overload that takes a write_context.  Adapt
	the existing overload to make it use this new one.
	(write_corpus_group): Define this new function and two additional
	overloads for it.
	* tools/kmidiff.cc (set_suppressions, is_vmlinux)
	(is_kernel_module, find_vmlinux_and_module_paths)
	(get_binary_paths_from_kernel_dist)
	(build_corpus_group_from_kernel_dist_under): Remove.
	(main): Adjust the call to
	build_corpus_group_from_kernel_dist_under as its arguments are now
	adapted since it's been factorized out into abg-tools-utils.h.
	* tools/abidw.cc (options::corpus_group_for_linux): Define new
	data member.
	(options::options): Adjust.
	(display_usage): Add help strings for the new --linux-tree option.
	(load_corpus_and_write_abixml): Factorize this function out of the
	main function.
	(load_kernel_corpus_group_and_write_abixml): Define new function.
	(main): Use the factorized load_corpus_and_write_abixml and the
	new load_corpus_and_write_abixml functions.
	* tests/test-read-write.cc: Adjust.
	* doc/manuals/abidw.rst: Add documentation for the new
	--linux-tree option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:41 +02:00
Dodji Seketeli
1d6cb6fdbc Adjust test reference outputs after changes in abg-writer.cc
After the latest commits to avoid emitting empty translation units and
dupicated decls, and also to fix some indention issues in the abixml
output, this patch updates the reference outputs of the abixml
regression tests.

	* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-annotate/test17-pr19027.so.abi: Adjust.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:39 +02:00
Dodji Seketeli
56f36edcde Rename write_corpus_to_native_xml into write_corpus
Rename write_corpus_to_native_xml into write_corpus because it's a
better name.

	* include/abg-writer.h (write_corpus): Rename
	write_corpus_to_native_xml to this.
	* src/abg-writer.cc (write_corpus): Rename
	write_corpus_to_native_xml to this.
	* tests/test-read-dwarf.cc (test_task::perform): Adjust.
	* tests/test-read-write.cc: Remove a useless "using
	abigail::xml_writer::write_corpus_to_native_xml".
	* tools/abidw.cc (main): Adjust.
	* tools/abilint.cc (main): Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:39 +02:00
Dodji Seketeli
a2a6d7e56a Update the reference output of regression tests after kabidiff work
* tests/data/test-annotate/test0.abi: Adjust.
	* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-annotate/test17-pr19027.so.abi: Adjust.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust.
	* tests/data/test-annotate/test21-pr19092.so.abi: Adjust.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Adjust.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt: Adjust.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Adjust.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Adjust.
	* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Adjust.
	* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Adjust.
	* tests/data/test-read-dwarf/test0.abi: Adjust.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-07-03 17:45:37 +02:00