Commit Graph

96 Commits

Author SHA1 Message Date
Dodji Seketeli
a89b0d0569 Update manual for abipkgdiff
* doc/manuals/abipkgdiff.rst: Say we support tarballs and plain
	directories.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-09-08 10:11:34 +02:00
Dodji Seketeli
277e524392 Add a new --noout option to abidw
* tools/abidw.cc (options::noout): New data member.
	(options::options): Initialize it.
	(display_usage): Add a usage string for the new option.
	(parse_command_line): Parse the new option.
	(main): If --noout is provided, do not emit the XML form.
 	* doc/manuals/abidw.rst: Document the new option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-29 16:23:15 +02:00
Dodji Seketeli
e61afa7291 Add a --no-architecture option to abidiff
This new option omits architectures when comparing ABIs.

	* tools/abidiff.cc (options::no_arch): New data member.
	(options::options): Initialize it.
	(display_usage): Display a help string for the new options.
	(parse_command_line): Parse the new options.
	(main): If --no-architecture is provided, set the corpus
	architecture to "".
	* doc/manuals/abidiff.rst: Document the new options.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-29 16:23:15 +02:00
Dodji Seketeli
7bcaf67504 Add a --stats to abidiff and abidw
For now, this new --stats emits diagnostics about the number of types
canonicalized at the very end of building the ABI corpus as well as
the number of types that were scheduled for late canonicalizing and
that couldn't be canonicalized.

	* include/abg-dwarf-reader.h (get_show_stats)
	(set_show_stats): New accessors for a new "show_stats" property of
	the dwarf reader context.
	* src/abg-dwarf-reader.cc: Include iostream to use std::cerr.
	(dwarf_reader::show_stats_): New data member.
	(dwarf_reader::dwarf_reader): Initialize it.
	(dwarf_reader::show_stats)
	(get_show_stats)
	(set_show_stats): Define new accessors.
	(dwarf_reader::die_type_map): Add const overload to this accessor.
	(dwarf_reader::lookup_type_from_die_offset): Make this accessor
	const.
	(dwarf_reader::add_late_canonicalized_types_stats): New member
	function.
	(dwarf_reader::perform_late_type_canonicalizing): Emit the
	statistics about late-canonicalized types if the user asked for
	it.
	* tools/abidiff.cc (options::show_stats): New data member.
	(options::options): Initialize it.
	(display_usage): Document it.
	(parse_command_line): Parse the new --stats option.
	(main): Create a dwarf reader context, set the show_stats to it
	and then use that context to read the corpora before diffing them.
	* tools/abidw.cc (options::show_stats): New data member.
	(options::options): Initialize it.
	(display_usage): Document it.
	(parse_command_line): Parse the new --stats option.
	(main): Set the show_stats to the dwarf reader context before
	using it.
	* doc/manuals/abidiff.rst: Update the manual.
	* doc/manuals/abidw.rst: Update the manual.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-20 13:25:42 +02:00
Dodji Seketeli
f271e4c460 Install the manpage for abipkgdiff
* doc/manuals/Makefile.am (section1_manpages): Add abipkgdiff.1 to
	the set of manpages to be install into section 1.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 16:48:35 +02:00
Dodji Seketeli
4b680be2a8 Update the abipkgdiff manual to say that .deb files are now supported
* doc/manuals/abipkgdiff.rst: Say that .deb fiel are now supported
	by abipkgdiff.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 15:24:59 +02:00
Dodji Seketeli
8798649dbe Do not remove api and website source files by accident
When the root source dir is used as root build dir, make clean can
remove the content of ${abs_builddir}/api which is then equal to
${abs_srcdir}/api.  Oops.  This patch fixes this.

	* doc/Makefile.am: Do not remove the entirety of the build dir of
	doxygen for the apidoc and the website as these can be also the
	source dirs.  Rather, remove that is under the html/ sub-directory
	of the build dir, as this is always generated by doxygen.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-14 13:31:30 +02:00
Dodji Seketeli
56112bae3b Add an abipkgdiff --fail-no-dbg command line option
* tools/abipkgdiff.cc (options::fail_if_no_debug_info): New data
	member.
	(options::options): Initialize it.
	(display_usage): Document it.
	(compare): If the user asked for it, fail if the we couldn't file
	the debug info for the corpus files being compared.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-13 23:26:53 +02:00
Dodji Seketeli
c09bb53ab1 Add -h and -d option shortcuts to abidw
Added a -h option shortcut for the --help option and a -d option
shortcut for the --debug-info-dir option, to the abidw program.

	* tools/abidw.cc (display_usage): Added a documentation string.
	(parse_command_line): Parse the new -h and -d shortcuts.
	* doc/manuals/abidw.rst: Update the manual.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-13 23:26:53 +02:00
Dodji Seketeli
71acc72064 Add a -h option shortcut to abidiff
Added a -h shortcut for --help to the abidiff program.n

	* tools/abidiff.cc (display_usage): Add documentation for the new
	switch.
	(parse_command_line): Parse the -h option.
	* doc/manuals/abidiff.rst: Update the manual.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-13 23:26:53 +02:00
Dodji Seketeli
da870f3598 Add a -h shortcup to abipkgdiff --help
* tools/abipkgdiff.cc (display_usage): Document the -h shortcut.
	(parse_command_line): Parse the -h shortcut to --help.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-13 23:26:52 +02:00
Dodji Seketeli
9f7c07460d Add --no-added-syms to abipkgdiff
With this new option the tool ignores added functions, variables and
their symbols.

	* tools/abipkgdiff.cc (options::show_added_syms): New data member.
	(options::options): Initialize it.
	(parse_command_line): Parse the new --no-added-syms option and set
	the options::show_added_syms flag accordingly.
	(display_usage): Add a help string for the new option.
	(set_diff_context_from_opts): Set the diff context according to
	the state of the new options::show_added_syms flag.
	* doc/manuals/abipkgdiff.rst: Add manual entry for the new
	--no-added-syms options.
	* tests/data/test-diff-pkg/test-rpm-report-5.txt: New test
	reference input file.
	* tests/data/Makefile.am: Add the new file above to source
	distribution.
	* tests/test-diff-pkg.cc (InOutSpec::prog_options): New data
	member.
	(in_out_specs): Adjust.  Add a new input to run the test again
	with --no-added-syms.
	(main): Adjust to pass the program options contained in
	InOutSpec::prog_options to abipkgdiff.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>

fixup! Add --no-added-syms to abipkgdiff

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-06 15:22:38 +02:00
Dodji Seketeli
decf33e847 Add a --keep-tmp-files option to abipkgidff
Sometimes, for debugging purposes it can be very handy to inspect the
content of the packages as seen by the tool.  This patch thus adds a
new --keep-tmp-files options so that users can inspect the content of
packages that were extracted.

	* tools/abipkgdiff.cc (options::keep_tmp_files): New data member.
	(options::options): Initialize it.
	(display_usage): Display a usage string for the new
	--keep-tmp-files option.
	(parse_command_line): Parse the new --keep-tmp-files option.
	(compare): Do not erase temporary directories if the users asked so.
	* doc/manuals/abipkgdiff.rst: Document the new --keep-tmp-files
	options.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-22 15:36:16 +02:00
Dodji Seketeli
819f8941cf Show linkage names in abipkgdiff output
With this patch abipkgdiff now shows the linkage names of
added/removed functions and variables.  In addition, there now is a
--no-linkage-name option to avoid seeing linkage names.

	* doc/manuals/abipkgdiff.rst: Document the new --no-linkage-name
	options.
	* tools/abipkgdiff.cc (options::show_linkage_names): New data
	member.
	(options::options): Initialize it.
	(display_usage): Display a usage string for --no-linkage-name.
	(parse_command_line): Parse the --no-linkage-name option.
	(set_diff_context_from_opts): Set the diff context accordingly.
	* tests/data/test-diff-pkg/test-rpm-report-0.txt: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-21 16:09:53 +02:00
Dodji Seketeli
b638309e48 Add --no-added-binaries to abipkgdiff
* tools/abipkgdiff.cc (options::show_added_binaries): New data
	member.
	(options::options): Initialize it.
	(display_usage): Add a help string for --no-added-binaries.
	(parse_command_line): Parse the new --no-added-binaries option.
	(compare): Do not show added binaries if the user doesn't want to.
	* doc/manuals/abipkgdiff.rst: Document the new --no-added-binaries
	option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-21 14:15:33 +02:00
Dodji Seketeli
96af1baf13 make abipkgdiff return a proper exit code
With this patch, abipkgdiff returns the same exit code as abidiff.
It's zero if there is no ABI change, and non-zero if there are ABI
changes.  The exact value depends on the kind of changes that is
detected.

	* tools/abipkgdiff.cc (compare): Return an instance
	abigail::tools_utils::abidiff_status, just like what we do in
	abidiff.
	* doc/manuals/abipkgdiff.rst: Document the new exit code.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-21 14:11:53 +02:00
Dodji Seketeli
78293108f2 Fix the --suppressions manual doc for abidiff
* doc/manuals/abidiff.rst: Talk about the --suppr shortcut of the
	--suppressions option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-19 19:54:57 +02:00
Dodji Seketeli
80dc31f540 Add --suppressions to abipkgdiff
* tools/abipkgdiff.cc (options::suppressions): New data member.
	(set_diff_context_from_opts): Set the suppression specifications
	provided by the user to the diff context.
	(parse_command_line): Parse the --suppressions and --suppr command
	line options.
	* doc/manuals/abipkgdiff.rst: Document the --suppressions and
	--suppr options.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-19 19:52:01 +02:00
Dodji Seketeli
f3ed9dfa92 Support file_name_regexp and soname_regexp in supp-specs
With this patch it's now possible to express the soname or name of the binary
file that contains the ABI artifacts the suppression specifications
should apply to.

	* include/abg-comparison.h (suppression_base::priv_): Make this
	pimpl member protected.
	(suppression_base::set_file_name_regex_str)
	(get_file_name_regex_str, get_soname_regex_str)
	(set_soname_regex_str): Declare new accessors.
	(function_suppression::{suppresses_function,
	suppresses_function_symbol}): Take a diff_context_sptr.
	(variable_suppression::{suppresses_variable,
	suppresses_variable_symbol}): Take a diff_context_sptr.
	* src/abg-comparison.cc
	(suppression_base::priv::{file_name_regex_str_, file_name_regex_,
	soname_regex_str_, soname_regex_}): Define new data members.
	(suppression_base::priv::get_file_name_regex_str)
	(get_soname_regex_str): Define new member functions.
	(suppression_base::set_file_name_regex_str)
	(get_file_name_regex_str, get_soname_regex_str)
	(set_soname_regex_str): Define new accessors.
	(type_suppression::suppresses_diff): Evaluate file_name_regexp and
	soname_regexp.
	(read_type_suppression): Fix the reading of the "label" property.
	Read the file_name_regexp and soname_regexp properties.
	(function_suppression::{suppresses_function,
	suppresses_function_symbol): Take a diff_context_sptr parameter.
	Evaluate file_name_regexp and soname_regexp properties.
	(function_suppression::suppresses_diff): Adjust for the api change
	of function_suppression::suppresses_function().
	(read_function_suppression): Read the file_name_regexp and
	soname_regexp properties.
	(variable_suppression::suppresses_variable): Take a
	diff_context_sptr parameter and evaluate file_name_regexp and
	soname_regexp properties.
	(variable_suppression::suppresses_variable_symbol): Likewise.
	(variable_suppression::suppresses_diff): Adjust for the api change
	of variable_suppression::suppresses_variable().
	(read_variable_suppression): Read the file_name_regexp and
	soname_regexp properties.
	(function_is_suppressed, variable_is_suppressed): Take a
	diff_context_sptr parameter.
	(corpus_diff::priv::apply_suppressions_to_added_removed_fns_vars):
	Adjust.
	* doc/manuals/libabigail-concepts.rst: Document file_name_regexp
	and soname_regexp in the manual.
	* tests/data/test-diff-suppr/libtest24-soname-v{0,1}.so: New test
	binary input files.
	* tests/data/test-diff-suppr/test24-soname-report-{0,4}.txt: New
	test input files.
	* tests/data/test-diff-suppr/test24-soname-suppr-{0,4}.txt:
	Likewise.
	* tests/data/test-diff-suppr/test24-soname-v{0,1}.cc: Source code
	of the binary test input files above.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-suppr.cc (in_out_spec): Add the new test inputs
	to the set of tests this harness has to run over.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-19 19:48:51 +02:00
Dodji Seketeli
018a9345d6 Fix '--' being rendered as '-' in html manuals
* doc/manuals/abicompat.rst: Quote options as verbatim.
	* doc/manuals/abidiff.rst: Likewise.
	* doc/manuals/abidw.rst: Likewise.
	* doc/manuals/abilint.rst: Likewise.
	* doc/manuals/abipkgdiff.rst: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-17 11:14:46 +02:00
Dodji Seketeli
3b85f2864d Avoid redundant diff report messages by default.
Just like what abidiff does, this patch avoids emitting redundant diff
report messages unless the user provides the --redundant switch.

	* tools/abipkgdiff.cc (options::show_redundant_changes): New data
	member.
	(options::options): Initialize it.
	(display_usage): Add a help string for the --redundant command
	Line option.
	(set_diff_context_from_opts): New static function.
	(compare): Take the options variable.  Set the diff context from
	the options, especially if we should show redundant changes or
	not.  Use that diff context when comparing ABIs.
	(parse_command_line): Parse the new --redundant command line
	switch.
	* doc/manuals/abipkgdiff.rst: Document the new --redundant option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-17 10:11:20 +02:00
Dodji Seketeli
71a5e0762e Support comparing only shared libraries
It turned out on some packages we are interested on comparing shared
libraries only.  This patch adds that functionality by adding a new
--dso-only command line option to abipkgdiff.

	* tools/abipkgdiff.cc (options::compare_dso_only): New data
	member.
	(options::options): Initialize it.
	(display_usage): Display a little help string for it.
	(create_maps_of_package_content): Take the option variable.  Do
	not compare non-dso files if the --dso-only option was provided.
	(extract_package_and_map_its_content, prepare_packages, compare):
	Take the option variable.
	(parse_command_line): Parse the new --dso-only option.
	* doc/manuals/abipkgdiff.rst: Add documentation for the new
	--dso-only option.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-17 10:11:15 +02:00
Dodji Seketeli
dea76e9f5f Add a manual for abipkgidiff
* doc/manuals/abipkgdiff.rst: New manual file.
	* doc/manuals/libabigail-tools.rst: Refer to the manual for
	abipkgdiff.
	* doc/manuals/Makefile.am: Add the new manual file to source
	distribution.
	* doc/manuals/conf.py: Add the manual for abipkgdiff to section 1.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-17 10:10:17 +02:00
Dodji Seketeli
f87d179a01 Add --d{1,2} shortcut options for --debug-info-dir{1,2} in abidiff
It turned out typing --debug-info-dir{1,2} is a tad cumbersome.  So this
patch adds --d1 and --d2 shortcut for these options.

	* tools/abidiff.cc (display_usage): Add the --d{1,2} to the help
	strings.
	(parse_command_line): Parse the new --d1 and --d2 options.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-09 11:11:16 +02:00
Dodji Seketeli
fe9fa7a05f Support filtering out just one alias of a function
Suppose a function private_foo() has a symbol private_foo and also a
another one (an alias) named public_foo.  Then suppose we want to
filter out sub-type changes to private_foo().  But then we still want
to see changes to public_foo.

This patch does add this feature.  The [suppress_function] directive
now has a new (hidden) boolean 'allow_other_aliases' property.  When
set to 'yes' or 'true', if the function being looked at has an alias
symbol that does *NOT* match the other properties of the directive,
then the directive doesn't suppress reports for the function.  This
new  property is set to yes by default.

This means that when a function has got multiple aliases, to suppress
the function, one needs to write a regular expression that matches the
names of aliases.  Otherwise the function will not be suppressed.

	* include/abg-comparison.h (function_suppression::{get,
	set}_allow_other_aliases): Declare new member functions.
	* src/abg-comparison.cc
	(function_suppression::priv::allow_other_aliases_): New data
	member.
	(function_suppression::priv::priv): Initialize it to 'true'.
	(function_suppression::{get, set}_allow_other_aliases): Define new
	member functions.
	(read_function_suppression): Parse the new "allow_other_aliases"
	property.
	(function_suppression::suppresses_function): Update to evaluate
	the new 'allow_other_aliases' property when there is a property to
	match against some a symbol name of the function.
	(corpus_diff::report): Fix the printing of function aliases when
	printing sub-type changes to properly emit the plural of the word
	'symbol' when the function has several aliases.
	* include/abg-ir.h (elf_symbol::get_number_of_aliases): Declare
	new member function.
	* src/abg-ir.cc (elf_symbol::get_number_of_aliases): Define new
	member function.
	* doc/manuals/libabigail-concepts.rst: Update manual.
	* tests/data/test-diff-dwarf/test5-report.txt: Adjust.
	* tests/data/test-diff-suppr/libtest23-alias-filter-v0.so: New
	test input.
	* tests/data/test-diff-suppr/libtest23-alias-filter-v1.so: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-0.suppr: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-1.suppr: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-2.suppr: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-3.suppr: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-4.suppr: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-report-2.txt: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-v0.c: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-v1.c: Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-version-script: Likewise.
	* tests/data/Makefile.am: Add the new test stuff to source
	distribution.
	* tests/test-diff-suppr.cc (in_out_spec): Add the tests inputs
	above to the list of input to run over.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-07-02 17:15:35 +02:00
Dodji Seketeli
79383f937c Apply suppression specifications to added and removed functions and variables
Until now, specifications for suppressing change reports were applied
only to functions and variables that have sub-type changes.  Change
reports about function and variables that were added or removed could
not be suppressed.

This patch makes suppression specifications to apply to added and
removed functions and variables too.  They can also apply to function
and variable symbols that are not referenced by any debug info.

The patch also fixes some typo and formatting glitches and updates
some existing tests accordingly.

	* include/abg-comparison.h (is_type_suppression)
	(is_function_suppression): Declare new functions.
	({function, variable}_suppression::change_kind): Declare new enum.
	(function_suppression::{parse_change_kind, get_change_kind,
	set_change_kind, suppresses_function,
	suppresses_function_symbol}): Declare new member functions.
	(variable_suppression::{parse_change_kind, get_change_kind,
	set_change_kind, suppresses_variable, suppresses_variable,
	suppresses_variable_symbol}): Declare new member functions.
	(operator{&,|}): Declare new operators for
	function_suppression::change_kind and
	variable_suppression::change_kind enums.
	(corpus_diff::diff_stats::{num_removed_func_filtered_out,
	net_num_func_removed, num_added_func_filtered_out,
	net_num_func_added, num_removed_vars_filtered_out,
	net_num_vars_removed, num_added_vars_filtered_out,
	net_num_vars_added, num_removed_func_syms_filtered_out,
	num_added_func_syms_filtered_out, net_num_removed_func_syms,
	net_num_added_func_syms, num_added_var_syms_filtered_out,
	num_removed_vars_filtered_out, net_num_removed_var_syms,
	net_num_added_var_syms}): Declare new member functions.
	(corpus_diff::diff_stats::num_changed_vars_filtered_out): Renamed
	corpus_diff::diff_stats::num_vars_filtered_out into this.
	(corpus_diff::diff_stats::num_changed_func_filtered_out): Renamed
	corpus_diff::diff_stats::num_func_filtered_out into this.
	* src/abg-comparison.cc (is_type_suppression)
	(is_function_suppression): Define new
	function.
	(function_suppression::priv::change_kind): New data member.
	(function_suppression::priv): Initialize it.
	(function_suppression::{parse_change_kind, get_change_kind,
	set_change_kind, suppresses_function,
	suppresses_function_symbol}): Define new member functions.
	(operator{&,|}): Define new operators for the new
	function_suppression::change_kind enum.
	(function_suppression::suppresses_diff): Re-write this in terms of
	the new function_suppression::suppresses_function() function.
	(read_function_suppression): Support reading the new "change_kind"
	property.
	(variable_suppression::priv::change_kind_): New data member.
	(variable_suppression::priv::priv): Initialize it.
	(variable_suppression::{parse_change_kind, get_change_kind,
	set_change_kind, suppresses_variable,
	suppresses_variable_symbol}): Define new member functions.
	(is_variable_suppression): Define new function.
	(operator{&,|}): Define new operators for
	variable_suppression::change_kind enum.
	(variable_suppression::suppresses_diff): Re-write in terms of the
	new variable_suppression::suppresses_variable function.
	(read_variable_suppression): Support reading the new "change_kind"
	property.
	(corpus_diff::diff_stats::priv::{num_removed_func_filtered_out,
	num_added_func_filtered_out, num_removed_vars_filtered_out,
	num_added_vars_filtered_out, num_removed_func_syms_filtered_out,
	num_added_func_syms_filtered_out,
	num_removed_var_syms_filtered_out,
	num_added_var_syms_filtered_out}): New data members.
	(corpus_diff::diff_stats::priv::num_changed_func_filtered_out):
	Renamed the data member num_func_filtered_out into this.
	(corpus_diff::diff_stats::priv::num_changed_vars_filtered_out):
	Renamed data member num_vars_filtered_out into this.
	(corpus_diff::diff_stats::priv::priv): Initialize the new data
	members.
	(corpus_diff::diff_stats::{num_removed_func_filtered_out,
	num_removed_func_filtered_out, net_num_func_removed,
	net_num_func_added, num_added_func_filtered_out,
	net_num_func_added, num_removed_vars_filtered_out,
	num_removed_vars_filtered_out, net_num_vars_removed,
	num_added_vars_filtered_out, net_num_vars_added,
	num_removed_func_syms_filtered_out,
	num_added_func_syms_filtered_out, net_num_removed_func_syms,
	net_num_added_func_syms, num_added_var_syms_filtered_out,
	num_removed_vars_filtered_out, net_num_removed_var_syms,
	net_num_added_var_syms}): Define new member functions.
	(corpus_diff::diff_stats::num_changed_func_filtered_out): Renamed
	corpus_diff::diff_stats::num_func_filtered_out into this.
	(corpus_diff::diff_stats::num_changed_vars_filtered_out): Renamed
	corpus_diff::diff_stats::num_vars_filtered_out into this.
	(corpus_diff::diff_stats::{net_num_func_changed,
	net_num_vars_changed}): Adjust.
	(corpus_diff::priv::{suppressed_deleted_fns_,
	suppressed_added_fns_, suppressed_deleted_vars_,
	suppressed_added_vars_, suppressed_added_unrefed_fn_syms_,
	suppressed_deleted_unrefed_fn_syms_,
	suppressed_added_unrefed_var_syms_,
	suppressed_deleted_unrefed_fn_syms_}): New data members.
	(corpus_diff::priv::{apply_suppressions_to_added_removed_fns_vars,
	deleted_function_is_suppressed, added_function_is_suppressed,
	deleted_variable_is_suppressed, added_variable_is_suppressed,
	added_unrefed_fn_sym_is_suppressed,
	deleted_unrefed_fn_sym_is_suppressed,
	added_unrefed_var_sym_is_suppressed,
	deleted_unrefed_var_sym_is_suppressed}): Define member functions.
	(function_is_suppressed, variable_is_suppressed): Define new
	functions.
	(corpus_diff::priv::apply_filters_and_compute_diff_stats): Compute
	stats for filtered added or removed functions, variables and their
	symbols.
	(corpus_diff::priv::emit_diff_stats): Emit diff stats for filtered
	added or removed functions, variables and symbols.
	(corpus_diff::report): Support suppressed reports about added or
	removed functions, variables and symbols.  Fixed a typo that was
	in there for a while.  Note that that fix requires updating some
	regression tests, and the part of this patch that touches
	regression tests does that.
	(apply_suppressions):  In the overload for corpus_diff, apply the
	suppression to added or removed functions and variables.
	* doc/manuals/libabigail-concepts.rst: Update this manual to
	reflect the changes above.  Also, perform an extensive cleanup of
	the manual to introduce more section titles to make it easier to
	navigate the document using the table of content.
	* tests/data/test-abicompat/test2-var-removed-report-0.txt:
	Adjust.
	* tests/data/test-diff-dwarf/test0-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test12-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test18-alias-sym-report-0.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test19-soname-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test7-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test8-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test9-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test16-syms-only-report.txt: Likewise.
	* tests/data/test-diff-dwarf/test17-non-refed-syms-report-0.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test28-vtable-changes-report-0.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/test13-report.txt: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-v0.o: Add new test
	material.
	* tests/data/test-diff-filter/test15-0-report.txt: Likewise.
	* tests/data/test-diff-filter/test2-report.txt: Likewise.
	* tests/data/test-diff-filter/test21-compatible-vars-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test24-compatible-vars-report-1.txt:
	Likewise.
	* test-diff-suppr/test15-suppr-added-fn-v1.o: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-0.suppr: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-1.suppr: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-2.suppr: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-3.suppr: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-4.suppr: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-report-0.txt: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-report-1.txt: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-report-2.txt: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-report-3.txt: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-report-4.txt: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-report-5.txt: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-v0.cc: Likewise.
	* test-diff-suppr/test15-suppr-added-fn-v1.cc: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-v0.o: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-v1.o: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-0.suppr: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-1.suppr: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-2.suppr: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-3.suppr: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-4.suppr: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-report-0.txt: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-report-1.txt: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-report-2.txt: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-report-3.txt: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-report-4.txt: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-report-5.txt: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-v0.cc: Likewise.
	* test-diff-suppr/test16-suppr-removed-fn-v1.cc: Likewise.
	* test-diff-suppr/test17-suppr-added-var-v0.o: Likewise.
	* test-diff-suppr/test17-suppr-added-var-v1.o: Likewise.
	* test-diff-suppr/test17-suppr-added-var-0.suppr: Likewise.
	* test-diff-suppr/test17-suppr-added-var-1.suppr: Likewise.
	* test-diff-suppr/test17-suppr-added-var-2.suppr: Likewise.
	* test-diff-suppr/test17-suppr-added-var-3.suppr: Likewise.
	* test-diff-suppr/test17-suppr-added-var-4.suppr: Likewise.
	* test-diff-suppr/test17-suppr-added-var-report-0.txt: Likewise.
	* test-diff-suppr/test17-suppr-added-var-report-1.txt: Likewise.
	* test-diff-suppr/test17-suppr-added-var-report-2.txt: Likewise.
	* test-diff-suppr/test17-suppr-added-var-report-3.txt: Likewise.
	* test-diff-suppr/test17-suppr-added-var-report-4.txt: Likewise.
	* test-diff-suppr/test17-suppr-added-var-report-5.txt: Likewise.
	* test-diff-suppr/test17-suppr-added-var-v0.cc: Likewise.
	* test-diff-suppr/test17-suppr-added-var-v1.cc: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-v0.o: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-v1.o: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-0.suppr: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-1.suppr: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-2.suppr: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-3.suppr: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-4.suppr: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-report-0.txt: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-report-1.txt: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-report-2.txt: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-report-3.txt: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-report-4.txt: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-report-5.txt: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-v0.cc: Likewise.
	* test-diff-suppr/test18-suppr-removed-var-v1.cc: Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-v0.o: New
	test input.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-v1.o:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-0.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-1.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-2.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-3.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-4.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-report-1.txt:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-report-2.txt:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-report-3.txt:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-report-4.txt:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-v0.cc:
	Likewise.
	* tests/data/test-diff-suppr/test19-suppr-added-fn-sym-v1.cc:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-v0.o:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-v1.o:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-0.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-1.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-2.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-3.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-4.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-report-1.txt:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-report-2.txt:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-report-3.txt:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-report-4.txt:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-v0.cc:
	Likewise.
	* tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-v1.cc:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-v0.o:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-v1.o:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-0.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-1.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-2.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-3.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-4.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-report-1.txt:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-report-2.txt:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-report-3.txt:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-report-4.txt:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-v0.cc:
	Likewise.
	* tests/data/test-diff-suppr/test21-suppr-added-var-sym-v1.cc:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-v0.o:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-v1.o:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-0.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-1.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-2.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-3.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-4.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-report-1.txt:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-report-2.txt:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-report-3.txt:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-report-4.txt:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-v0.cc:
	Likewise.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-v1.cc:
	Likewise.
	* tests/data/Makefile.am: Add the new test materials above to source
	distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Add the new tests
	material above to the list of test inputs this harness has to run
	over.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-06-24 12:09:53 +02:00
Dodji Seketeli
63c5916269 Put the man pages of the binaries in section 1
I was clueless about the right sections for the man pages of the parts
of the libabigail.  But then Matthias Klose of Debian and Ubuntu fame
rightfully suggested that the man pages of the binaries should be in
section 1 (user commands) and the man page of the library should be in
section 7 (Miscellaneous).

This patch does that.

	* doc/manuals/Makefile.am(section1_manpages, section7_manpages):
	Two new variables to contain the man page names per section.
	(manpages): Set this variable to $section1_manpages and $section7_manpages.
	(install-man-and-info-doc): In this rule, create the destination
	directories for section 1 and 7 and copy the right man pages in
	their right directory.
	* doc/manuals/conf.py (man_pages): Generate the binary man pages
	into section 1 and the libabigail man page into section 7.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-06-23 12:06:54 +02:00
Dodji Seketeli
0cd814766b Support new 'accessed_through' suppression property
It turned out it's important to be able to suppress changes about
types that are reachable from a function parameter only through e.g, a
pointer or a reference, so that only changes types that are reachable
directly from a function parameter are emitted.

This patch adds that feature.

While doing this, I noticed this: Suppose a diff node D2 is marked as
being redundant with a diff node D1 seen previously.  So only D1 is
reported; D2 is not, because it's been filtered out, because it's
redundant with D1.  But then suppose D1 is filtered out, due to a
suppression specification.  At that point, D2 should not be marked
redundant anymore, and should be reported.

Of course, the code before this patch was wrongly filtering D2 *and*
D1 out.  So this patch fixes that.

	* include/abg-comparison.h (enum type_suppression::reach_kind):
	Define new enum.
	(type_suppression::{get_consider_reach_kind,
	set_consider_reach_kind, get_reach_kind,
	mark_last_diff_visited_per_class_of_equivalence,
	clear_last_diffs_visited_per_class_of_equivalence,
	get_last_visited_diff_of_class_of_equivalence}): Declare new
	member functions.
	* src/abg-comparison.cc (diff_has_ancestor_filtered_out)
	(read_suppression_reach_kind): Define static function.
	(type_suppression::priv::{consider_reach_kind_, reach_kind_}):
	Define new data members.
	(type_suppression::priv::priv): Take a new reach_kind parameter.
	(type_suppression::type_suppression): Adjust to new prototype of
	priv constructor.
	(type_suppression::{get_consider_reach_kind,
	set_consider_reach_kind, get_reach_kind, set_reach_kind}): Define
	new member functions.
	(type_suppression::suppresses_diff): Interpret the result of
	type_suppression::get_reach_kind() to determine if the suppression
	specification suppresses a given diff node.
	(read_type_suppression): Support reading the content of the
	"accessed_through" property.
	(diff_context::priv::last_visited_diff_node_): New data member.
	(diff_context::{mark_last_diff_visited_per_class_of_equivalence,
	clear_last_diffs_visited_per_class_of_equivalence,
	get_last_visited_diff_of_class_of_equivalence}): Define new data
	members.
	(redundancy_marking_visitor::visit_begin): So if the current diff
	node has already been visited, but if the previously visited node
	has been filtered out, then do not mark this node as being
	redundant.  And mark the current diff node as being the last
	visited one in its class of equivalence.
	(categorize_redundancy): Clear the map of diff nodes visited per
	class of equivalence.
	* doc/manuals/libabigail-concepts.rst: Document the new
	'accessed_through' property.
	* tests/data/test-diff-suppr/test13-suppr-through-pointer-0.suppr:
	New test input data.
	* tests/data/test-diff-suppr/test13-suppr-through-pointer-report-{0,1}.txt:
	Likewise.
	* tests/data/test-diff-suppr/libtest13-suppr-through-pointer-v{0,1}.so:
	New test input binaries.
	* tests/data/test-diff-suppr/test13-suppr-through-pointer-v{0,1}.cc:
	Source code of the test input binaries above.
	* tests/data/test-diff-suppr/test14-suppr-non-redundant-0.suppr:
	New test input data.
	* tests/data/test-diff-suppr/test14-suppr-non-redundant-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test14-suppr-non-redundant-v{0,1}.o:
	New test input binaries.
	* tests/data/test-diff-suppr/test14-suppr-non-redundant-v{0,1}.cc:
	Source code of the binaries above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-06-04 13:29:32 +02:00
Dodji Seketeli
d0bd599b4b Support specifying data member insertion in suppressions
This patch is for supporting this kind of things:

    [suppress_type]
      name = S
      has_data_member_inserted_between = {8, end}

or:

    [suppress_type]
      name = S
      has_data_members_inserted_between = {{8, 31}, {64, end}}

or:

    [suppress_type]
      name = S
      has_data_members_inserted_at = offset_after(member0)

How cool is that, heh?

Anyway, to do this, the patch adds support for tuple values (i.e,
lists of values) in INI files.

Then on top of that the patch adds support for the specific
has_data_member_inserted_between, has_data_members_inserted_between
and has_data_members_inserted_at properties.

	* include/abg-comparison.h (type_suppression::insertion_range):
	Declare new type.
	(type_suppression::insertion_ranges): Declare new typedef.
	(type_suppression::{s,g}et_data_member_insertion_ranges): Declare
	new member functions.
	(is_integer_boundary, is_fn_call_expr_boundary): Declare new
	functions.
	(type_suppression::insertion_range::{boundary, integer_boundary,
	fn_call_expr_boundary}): Define new types.
	* src/abg-comparison.cc:
	(struct type_suppression::insertion_range::priv): New type.
	(type_suppression::insertion_range::{insertion_range, begin,
	end}): Define new member functions.
	(type_suppression::priv::insertion_ranges_): Add data member.
	(type_suppression::{s,g}et_data_member_insertion_ranges): Define
	new member functions.
	(type_suppression::insertion_range::boundary::priv): Define new
	type.
	(type_suppression::insertion_range::boundary::{boundary,
	~boundary}): Define new member functions.
	(type_suppression::insertion_range::integer_boundary::priv):
	Define new type.
	(type_suppression::insertion_range::integer_boundary::{integer_boundary,
	as_integer, operator int, ~integer_boundary}): Define member
	functions.
	(type_suppression::insertion_range::fn_call_expr_boundary::priv):
	Define new type.
	(type_suppression::insertion_range::fn_call_expr_boundary::{fn_call_expr_boundary,
	as_function_call_expr, operator ini::function_call_expr_sptr}):
	Define new member functions.
	(type_suppression::insertion_range::{create_integer_boundary,
	type_suppression::insertion_range::create_fn_call_expr_boundary,
	type_suppression::insertion_range::eval_boundary}): Define new
	member functions.
	(is_integer_boundary, is_fn_call_expr_boundary): Define new
	functions.
	(read_type_suppression, read_function_suppression)
	(read_variable_suppression): Support the new kinds of
	property-related types. Aslo, in read_type_suppression, support
	the new properties has_data_member_inserted_at,
	has_data_member_inserted_between and
	has_data_members_inserted_between.
	(type_suppression::suppresses_diff): If we are looking at a type
	diff node that has inserted data members, evaluate the insertion
	ranges of the current type_suppression and see if they match the
	inserted data members.
	* include/abg-ini.h (property, simple_property, property_value)
	(string_property_value, tuple_property_value, function_call_expr):
	Declare new types.
	(property_sptr, property_value_sptr, string_property_value_sptr)
	(tuple_property_value_sptr): Declare new typedefs.
	(is_string_property_value, is_tuple_property_value)
	(is_simple_property, is_tuple_property, read_function_call_expr):
	Declare new functions.
	* src/abg-ini.cc (char_is_white_space, char_is_comment_start)
	(char_is_delimiter, char_is_property_value_char)
	(char_is_section_name_char, char_is_property_name_char)
	(char_is_comment_start, char_is_white_space)
	(remove_trailing_white_spaces, is_string_property_value)
	(is_tuple_property_value, is_simple_property, is_tuple_property)
	(write_property_value, char_is_function_name_char)
	(char_is_function_argument_char): Define new functions.
	(property::priv, tuple_property_value::priv)
	(simple_property::priv, tuple_property::priv): Define new types.
	(property::{property, get_name, set_name, ~property}): Define new
	member functions.
	(struct property_value::priv): Define new type.
	(property_value::{property_value, get_kind, operator const
	string&(), ~property_value}): Define new member functions.
	(struct string_property_value::priv): Define new type.
	(string_property_value::{string_property_value, set_content,
	as_string, operator string()}, ~string_property_value): Define new
	member functions.
	(tuple_property_value::{tuple_property_value, get_value_items,
	~tuple_property_value, as_string}): Likewise.
	(simple_property::{simple_property, get_value, set_value,
	~simple_property}): Likewise.
	(tuple_property::{tuple_property, set_value, get_value}):
	Likewise.
	(config::section::find_property): Adjust return type.
	(read_context::{char_is_delimiter, char_is_property_value_char,
	char_is_section_name_char, char_is_property_name_char,
	char_is_comment_start, char_is_white_space}): Remove these from
	here as they got moved them to be non-member functions above.
	(read_context::read_property_value): Return a property_value_sptr
	and do not take any parameter anymore.
	(read_context::{read_string_property_value,
	read_tuple_property_value, read_function_name,
	read_function_argument, read_function_call_expr}): Define new
	member functions.
	(read_context::read_property): Adjust return type.  Also, change to read
	the different new kinds of properties values.
	(function_call_expr::priv): Define new type.
	(function_call_expr::{function_call_expr, get_name,
	get_arguments}): New member functions.
	(read_context::read_section): Adjust.
	(write_property, write_section): Adjust.
	* tests/data/test-diff-suppr/libtest{11,12}-add-data-member-v{0,1}.so:
	New test input binaries.
	* tests/data/test-diff-suppr/test{11,12}-add-data-member-{0,1}.suppr:
	New input suppression files.
	* tests/data/test-diff-suppr/test11-add-data-member-{2,3,4}.suppr:
	Add new test input files.
	* tests/data/test-diff-suppr/test{11,12}-add-data-member-report-{0,1}.txt:
	New reference output files.
	* tests/data/test-diff-suppr/test12-add-data-member-report-2.txt:
	Likewise.
	* tests/data/test-diff-suppr/test{11,12}-add-data-member-v{0,1}.cc:
	Source code for the new binaries above.
	* tests/test-diff-suppr.cc (in_out_specs): Add new test inputs.
	* tests/data/Makefile.am: Add the new test related files above to
	source distribution.
	* doc/manuals/libabigail-concepts.rst: Document the new properties
	has_data_member_inserted_at, has_data_member_inserted_between and
	has_data_members_inserted_between.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-05-24 23:43:02 +02:00
Dodji Seketeli
a32b5a3891 Some wording fixes to doc/manuals/libabigail-concepts.rst
* doc/manuals/libabigail-concepts.rst: Some light wording fixes.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-05-24 17:37:33 +02:00
Dodji Seketeli
fc55e7f343 Make abidiff and abicompat return meaningful exit codes
As per https://sourceware.org/bugzilla/show_bug.cgi?id=18146, abidiff
the exit code of abidiff and abicompat is now a bit field that can be
inspected to know if the ABI change reported is incompatible for sure,
or if it needs user review of the output to decide.

This patch also updates the documentation.

	* doc/manuals/abicompat.rst: Update documentation for abicompat
	exit codes.
	* doc/manuals/abidiff.rst: Likewise for abidiff exit codes.
	* include/abg-tools-utils.h (enum abidiff_status): Declare new
	enum.
	(operator{|,&,|=}): Declare new operators for the new enum
	abidiff_status.
	(abidiff_status_has_error, abidiff_status_has_abi_change)
	(abidiff_status_has_incompatible_abi_change): Declare new
	functions.
	* src/abg-tools-utils.cc (operator{|,&,|=}): Define these new
	operators.
	(abidiff_status_has_error, abidiff_status_has_abi_change)
	(abidiff_status_has_incompatible_abi_change): Define new
	functions.
	* tests/test-diff-filter.cc (main): Adjust for the new exit code
	of abidiff.
	* tests/test-diff-suppr.cc (main): Likewise.
	* tests/test-abicompat.cc (main): Likewise.
	* tools/abicompat.cc (enum abicompat_status): Remove.
	(operator{|,&,|=}): Remove these operators for enum
	abicompat_status.
	(perform_compat_check_in_normal_mode)
	(perform_compat_check_in_weak_mode): Return abidiff_status instead
	of abicompat_status.  Adjust therefore.
	(main): Adjust to return abidiff_status now, instead of a just
	zero for all non-error cases.
	* tools/abidiff.cc (main): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-04-10 16:26:36 +02:00
Dodji Seketeli
a102a2f032 Add support for abicompat weak mode
This patch implements the weak mode of abicompat.  In this mode, just
the application and the new version of the library are provided.  The
types of functions and variables of the library that are consumed by
the application are compared to the types of the functions and
variables expected by the application.  The goal is to check if the
types of the declarations consumed by the application and provided by
the library are compatible with what the application expects.

The abicompat first gets the set of symbols undefined in the
application and exported by the library.  It then builds the set of
declarations exported by the library that have those symbols.  We call
these the set of declarations of the library that are consumed by the
application.

Note that the debug information for the application does not contain
the declarations of the functions/variables whose symbols are
undefined.  So we can not just read them to compare them to
declarations exported by the library.

But the *types* of the variables and the *sub-types* of the functions
whose symbols are undefined in the application are present in the
debug information of the application.

So in the weak mode, abicompat compare the *types* of the declarations
consumed by the application as expected by the application (described
by the debug information of the application) with the types of the
declarations exported by the library.

To do this a number of changes were necessary.

The patch builds a representation of all the types found in the
application's debug info.  Before that, only the types that are
reachable from exported declarations were represented.

The abidw tool got a new --load-all-types to test this new ability of
loading all types.

The patch also adds support for looking a type, not by name, but by
its internal representation.

In the comparison engine, function_type_diff is introduced to
represent changes between two function types.  For this, a new class
type_or_decl_base has been introduced in the IR.  It's now the base
class for both decl_base and type_base.  And abigail::comparison::diff
now takes two pointers of type_or_decl, not decl_base anymore.  So
function_type_diff can take two function_type now; not that a
function_type has no declaration so it doesn't inherit decl_base.  A
bunch of changes got made just to adjust to this modification.

A number of fixes were made too, to make this work, like adding
missing comparison operators, removing asserts that too strong, etc..

The patch also adjust the test suite as well as the documentation.

	* include/abg-fwd.h (class type_or_decl_base): Forward declare
	this.
	(is_decl, is_type, is_function_type, get_name, get_type_name)
	(get_function_type_name, get_pretty_representation)
	(lookup_function_type_in_corpus, lookup_type_in_translation_unit)
	(lookup_function_type_in_translation_unit)
	(synthesize_function_type_from_translation_unit)
	(hash_type_or_decl): New function declarations.
	* src/abg-corpus.cc (lookup_type_in_corpus)
	(lookup_function_type_in_corpus): Define new functions.
	* include/abg-ir.h
	(translation_unit::lookup_function_type_in_translation_unit):
	Declare new friend function.
	(class type_or_decl_base): Declare this.
	(operator==(const type_or_decl_base&, const type_or_decl_base&)):
	Declare new operator.
	(operator==(const type_or_decl_base_sptr&, const
	type_or_decl_base_sptr&)): Likewise.
	(class {decl_base, type_base}): Make these class inherit
	type_or_decl_base.
	(decl_base::get_member_scopes): New const overload.
	(bool operator==(const function_decl::parameter_sptr&,
	                 const function_decl::parameter_sptr&)): New operator.
	(function_type::get_parameters): Remove the non-const overload.
	(function_type::get_pretty_representation): Declare new member
	function.
	(method_type::get_pretty_representation): Likewise.
	* src/abg-ir.cc (bool operator==(const type_or_decl_base&, const
	type_or_decl_base&)): Define new equality operator.
	(bool operator==(const type_or_decl_base_sptr&, const
	type_or_decl_base_sptr&)): Likewise.
	(strip_typedef): Do not expect canonicalized types anymore.  Now
	the system accepts (and expects) canonicalized types in certain
	cases.  For instance, non-complete types and aggregated types that
	contain non-complete sub-types.
	(get_name, get_function_type_name, get_type_name)
	(get_pretty_representation, is_decl, is_type, is_function_type)
	(lookup_function_type_in_translation_unit)
	(synthesize_function_type_from_translation_unit)
	(lookup_type_in_scope, lookup_type_in_translation_unit): Define
	new functions or new overloads.
	(bool operator==(const function_decl::parameter_sptr&,
	                 const function_decl::parameter_sptr& r)): Define
	new operator.
	(function_type::get_parameters): Remove non-const overload.
	(function_type::get_pretty_representation): Define new function.
	(function_type::traverse): Adjust.
	(method_type::get_pretty_representation): Likewise.
	(function_decl::get_pretty_representation): Avoid emitting the
	type of cdtors.
	(hash_type_or_decl): Define new function.
	* include/abg-dwarf-reader.h (create_read_context)
	(read_corpus_from_elf): Take a new 'read_all_types' flag.
	* src/abg-dwarf-reader.cc (read_context::load_all_types_): New
	flag.
	(read_context::read_context): Initialize it.
	(read_context::canonical_types_scheduled): If some types still
	have non-canonicalized sub-types, then do not canonicalize them.
	(read_context::load_all_types): New member functions.
	(build_function_decl): Do not represent void return type like
	empty type anymore, rather, represent it like a void type node.
	(build_ir_node_from_die): When asked, load all types
	including those that are not reachable from an exported
	declaration.
	(create_read_context, read_corpus_from_elf): Take a new
	'load_all_types' flag and honour it.
	* src/abg-reader.cc (read_context::type_is_from_translation_unit):
	Support looking up function types in the current translation unit,
	now that we now how to lookup function types.
	* include/abg-comparison.h (diff_context::{has_diff_for, add_diff,
	set_canonical_diff_for, set_or_get_canonical_diff_for,
	get_canonical_diff_for}): Make these take instances of
	type_or_decl_base_sptr, instead of decl_base_sptr.
	(diff::diff): Likewise.
	(diff::{first_subject, second_subject}): Make these return
	type_or_decl_base_sptr instead of decl_base_sptr.
	(type_diff_base::type_diff_base): Make these take instances of
	type_or_decl_base_sptr instead of decl_base_sptr.
	(distinct_diff::distinct_diff): Likewise.
	(distinct_diff::{first, second}): Make these return
	type_or_decl_base_sptr instead of decl_base_sptr.
	(distinct_diff::entities_are_of_distinct_kinds): Make these take
	instances of type_or_decl_base_sptr instead of decl_base_sptr.
	(class function_type_diff): Create this new type.  It's a
	factorization of the function_decl_diff type.
	* src/abg-comparison.cc ():
	* src/abg-comp-filter.cc ({harmless, harmful}_filter::visit):
	Adjust as diff::{first,second}_subject() now returns a
	type_or_decl_base_sptr, no more a decl_base_sptr.
	(decls_type, decls_diff_map_type): Remove these typedefs and replace it with ...
	(types_or_decls_type, types_or_decls_diff_map_type): ... these.
	(struct {decls_hash, decls_equals): Remove these type sand replace them with ...
	(struct {types_or_decls_hash, types_or_decls_equals}): ... these.
	({type_suppression, variable_suppression}::suppresses_diff):
	Adjust.
	(diff_context::priv::decls_diff_map): Replace this with ...
	(diff_context::priv::types_or_decls_diff_map): ... this.
	(diff_context::{has_diff_for, add_diff, get_canonical_diff_for,
	set_canonical_diff_for, set_or_get_canonical_diff_for}): Take
	type_or_decl_base_sptr instead of decl_base_sptr.
	(diff::priv::{first, second}_subject): Make the type of these be
	type_or_decl_base_sptr, no more decl_base_sptr.
	(diff::priv::priv): Adjust for the subjects of the diff being of
	type type_or_decl_sptr now, no more decl_base_sptr.
	(diff_less_than_functor::operator()(const diff_sptr, const
	diff_sptr) const): Adjust.
	(diff::diff): djust for the subjects of the diff being of type
	type_or_decl_sptr now, no more decl_base_sptr.
	(diff::{first,second}_subject): Make the type of these be
	type_or_decl_base_sptr, no more decl_base_sptr.
	(report_size_and_alignment_changes): Likewise.
	(type_diff_base::type_diff_base): Make the type of this be
	type_or_decl_base_sptr instead of type_base_sptr.
	(distinct_diff::distinct_diff): Make this take instances of
	type_or_decl_base_sptr instead of decl_base_sptr.
	(distinct_diff::{first, second, entities_are_of_distinct_kinds}):
	Likewise.
	(distinct_diff::has_changes): Simplify logic.
	(distinct_diff::report): Adjust.
	(compute_diff_for_types): Add an additional case to support the
	new function_type.
	(report_size_and_alignment_changes): Make this take instances of
	type_or_decl_base_sptr instead of decl_base_sptr.
	(class_diff::priv::member_type_has_changed): Return an instance of
	type_or_decl_base_sptr rather than a decl_base_sptr.
	(class_diff::report): Adjust.
	(diff_comp::operator()(const diff&, diff&) const): Adjust.
	(enum function_decl_diff::priv::Flags): Remove.
	(function_decl_diff::priv::{first_fn_flags_, second_fn_flags_,
	fn_flags_changes_}): Remove.
	(function_decl_diff::priv::{fn_is_declared_inline_to_flag,
	fn_binding_to_flag}): Remove.
	(function_decl_diff::{deleted_parameter_at,
	inserted_parameter_at}): Remove.
	(function_decl_diff::ensure_lookup_tables_populated): Empty this.
	(function_decl_diff::chain_into_hierarchy): Adjust.
	(function_decl_diff::function_decl_diff): This now only takes the
	subjects.  It's body is now empty.
	(function_decl_diff::{return_type_diff, subtype_changed_parms,
	removed_parms, added_parms, type_diff}): Remove these member
	functions.
	(function_decl_diff::type_diff): Define new member function.
	(function_decl_diff::report): Simplify logic by using the
	reporting of the child type diff node.
	(compute_diff): Likewise, in the overload for function_decl_sptr
	simplify logic by using the child type diff object.
	(function_type_diff::priv): Define new type.
	(function_type_diff::{function_type_diff,
	ensure_lookup_tables_populated, deleted_parameter_at,
	inserted_parameter_at, finish_diff_type, first_function_type,
	second_function_type, return_type_diff, subtype_changed_parms,
	removed_parms, added_parms, get_pretty_representation,
	has_changes, has_local_changes, report, chain_into_hierarchy}):
	Define new functions.
	(compute_diff): Define new overload for function_type_sptr.
	* tools/abicompat.cc (options::weak_mode): New data member.
	(options::options): Initialize it.
	(enum abicompat_status): New enum
	(abicompat_status operator|(abicompat_status, abicompat_status))
	(abicompat_status& operator|=(abicompat_status &, abicompat_status))
	(abicompat_status operator&(abicompat_status, abicompat_status)):
	New operators to manipulate the abicompat_status enum.
	(display_usage): Add help string for the new --weak-mode option.
	(parse_command_line): Add the new --weak-mode command line
	argument.  If the tool is called with just the application and one
	library then assume that we are in the weak mode.
	(perform_compat_check_in_normal_mode): Define new function, factorized
	from what was in the main function.
	(perform_compat_check_in_weak_mode): Define new function.
	(struct {fn,var}_change): Define new types.
	(main): Use perform_compat_check_in_weak_mode() and
	perform_compat_check_in_normal_mode().
	* tools/abidiff.cc (main): Adjust.
	* tools/abidw.cc: (options::load_all_types): Add new data member.
	(options::options): Initialize it.
	(display_usage): New help string for --load-all-types.
	(parse_command_line): Support the new --load-all-types option.
	(main): Adjust and honour the --load-all-types option.
	* tools/abilint.cc (main): Adjust.
	* doc/manuals/abicompat.rst: Update documentation for the new weak
	mode.  Also provide stuff that was missing from the examples
	provided.
	* doc/manuals/abidw.rst: Update documentation for the new
	--load-all-types option.
	* tests/print-diff-tree.cc (main): Adjust.
	* tests/test-diff-dwarf.cc (main): Likewise.
	* tests/test-read-dwarf.cc (main): Likewise.
	* tests/data/test-abicompat/test0-fn-changed-app: Recompile this.
	* tests/data/test-abicompat/libtest5-fn-changed-libapp-v{0,1}.so:
	New new test input binaries
	* tests/data/test-abicompat/test5-fn-changed-app: Likewise.
	* tests/data/test-abicompat/test6-var-changed-app: Likewise.
	* tests/data/test-abicompat/libtest6-var-changed-libapp-v{0,1}.so:
	Likewise.
	* tests/data/test-abicompat/test5-fn-changed-report-0.txt:
	Reference output for one test above.
	* tests/data/test-abicompat/test6-var-changed-report-0.txt:
	Likewise.
	* tests/data/test-abicompat/test5-fn-changed-app.cc: Source file
	for a binary above.
	* tests/data/test-abicompat/test5-fn-changed-libapp-v{0,1}.{h,cc}:
	Likewise.
	* tests/data/test-abicompat/test6-var-changed-libapp-v{0,1}.{cc,h}:
	Likewise.
	* tests/data/test-abicompat/test6-var-changed-app.cc: Likewise.
	* tests/data/Makefile.am: Add the test related files above to the
	source distribution.
	* tests/test-abicompat.cc (in_out_spec): Add the new test input
	above to the list of inputs to feed to this test harness.
	(main): Support taking just the app and one library.
	* tests/data/test-read-dwarf/test{0, 1, 2.so, 3.so, 5.o,
	8-qualified-this-pointer.so,}.abi: Adjust for void type being
	really emitted now, as opposed to just being an empty type.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-04-03 22:45:41 +02:00
Dodji Seketeli
5892c45e0e Update website documentation
Update the website to include a link to the mailing list archive.
Also cleanup up the markup a little bit.

	* doc/website/mainpage.txt: Update the web page.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-03-19 12:19:33 +01:00
Dodji Seketeli
63c81f028d Do not install the generated documentation by default
* doc/manuals/Makefile.am: Do not install the generated
	documentation by default

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-14 18:46:06 +01:00
Dodji Seketeli
3ea7c4682e Make sure to install html docs & gziped info on make install
* doc/manuals/Makefile.am: Make sure Make sure to install html
	docs & gziped info on make install

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-14 14:36:20 +01:00
Dodji Seketeli
3d969dbe05 Small grammar fix in a manpage title
* doc/manuals/conf.py: Fix the grammar of the title of the abidiff
	man page.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-13 18:33:38 +01:00
Dodji Seketeli
5059907727 Generate texinfo documentation properly
There was a texinfo documentation that was being generated up to now,
but I haven't really looked at it.  Now that I have handled man pages
generation, I thought I'd give the texinfo generation a closer look
and ensure it's in a correct shape.  This patch cleans the generation
process up, changes the documentation markup so that it looks OK in
the generated texinfo file and handles the install of the generated
texinfo.

	* doc/manuals/Makefile.am: Generate texinfo doc, install it and
	uninstall it.
	* doc/manuals/libabigail-tools.rst: Do not use the :doc: syntax to
	refer to documents because it doesn't seem to work with sphinx
	right now.  Rather, use a table of content.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-13 18:33:23 +01:00
Dodji Seketeli
69c9f1fbcd Fix man pages installation
The man pages are created only if the user ran 'make man' in
doc/manuals.  So installing the man pages should be conditional on the
presence of the man pages.

	* doc/manuals/Makefile.am: Install the man pages only if they are
	generated.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-13 12:13:22 +01:00
Dodji Seketeli
b951add9f5 Do not forget to install the Manpages
* doc/manuals/Makefile.am: Add the man pages to the man7_MANS
	automake primary.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-13 11:29:11 +01:00
Dodji Seketeli
e7e2d24c5c Generate Manpages for abidiff, abidw, abilint
* doc/manuals/conf.py: Define man pages for abidiff, abidw,
	abilint and an introductory one for libabigail.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-13 10:34:57 +01:00
Sinny Kumari
20df3be7eb Include libabigail-website.doxy file in EXTRA_DIST
Without having doc/website/libabigail-website.doxy file
included in source distribution, make html-doc was giving error.

	* doc/Makefile.am: Include website/libabigail-website.doxy
	file in EXTRA_DIST

Signed-off-by: Sinny Kumari <skumari@redhat.com>
2015-01-06 15:40:18 +01:00
Dodji Seketeli
0e1d9f9892 Add a --dump-diff-tree to abidiff for debugging purposes
I have felt the need to emit a textual representation of the diff
nodes tree maintained by the comparison engine for changed functions
and variables.  This patch adds that functionality.

	* include/abg-comparison.h (enum visiting_kind): Add new
	DO_NOT_MARK_VISITED_NODES_AS_TRAVERSED enumerator.
	(diff_context::{default_output_stream, error_output_stream,
	dump_diff_tree}): Declare new accessors.
	(diff::end_traversing): Take a new boolean flag.
	(print_diff_tree): Add new overload for diff_sptr.
	* src/abg-comparison.cc
	(diff_context::priv::{default_output_stream_,
	error_output_stream_, dump_diff_tree_}): New data members.
	(priv::priv): Initialize them.
	(diff_context::{default_output_stream_, error_output_stream_,
	dump_diff_tree, dump_diff_tree}): Define new accessors.
	(diff::end_traversing): Take a new flag that control whether or
	not to mark the current diff node as having been traversed.
	(diff::traverse): Take in account the visiting kind carried by the
	visitor to determine if the visited node should be marked as being
	traversed.
	(corpus_diff::priv::maybe_dump_diff_tree): Define new member
	function.
	(corpus_diff::report): Call it.
	(diff_node_printer::visit): Pretty print the diff node just once.
	(print_diff_tree): Define a new overload for diff_sptr.
	* tools/abidiff.cc (options::dump_diff_tree): New data member.
	(options::options): Initialize it.
	(display_usage): Add a help string for the new --dump-diff-tree
	command line switch.
	(parse_command_line): Parse the new --dump-diff-tree command line
	switch.
	(set_diff_context_from_opts): Set the diff context according to
	the --dump-diff-tree presence.
	* doc/manuals/abidiff.rst: Add a bullet point for the new
	--dump-diff-tree command line switch.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-28 11:36:52 +01:00
Dodji Seketeli
5895bcf031 Fix typos in the abicompat manual
* doc/manuals/abicompat.rst: Fix typos.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-27 10:23:58 +01:00
Dodji Seketeli
f8213ce3d5 Fix a typo in the abidiff manual
* doc/manuals/abidiff.rst: Fix a typo.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-27 10:20:56 +01:00
Dodji Seketeli
2afa86fec1 Fix redundancy in abidiff manual
* doc/manuals/abidiff.rst: Remove the redundant bullet point about
	the --drop-fn command line switch.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-27 10:18:42 +01:00
Dodji Seketeli
9418ad46de Update doc string for new --no-redundant option of abidiff
* doc/manuals/abidiff.rst: Update the documentation string for the
	--no-redundant option of abidiff.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-26 19:03:16 +01:00
Dodji Seketeli
8e9dbc9cf1 Avoid showing ugly version info in the libabigail online manual
* doc/manuals/conf.py: Update copyright mention.  Do not show ugly
	version information.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-05 15:43:31 +01:00
Dodji Seketeli
ef7e71febf Initial implementation of the abicompat tool
Given an application A that links to a shared library L of version V
denoted L(V) and a subsequent version of that library denoted L(V+P),
the 'abicompat' tool tells the user if L(V+P) is still ABI compatible
with L(V+P).  And if it is not, abicompat gives a reports that shows
the differences between L(V) and L(V+P) that makes L(V+P)
ABI-incompatible with A.

The source code of this tool is in the tools/abicompat.cc source
file.  To support this new tool, this commit changes the comparison
engine to optionally avoid showing added symbols that were not
referenced by any debug info.  It changes the ABI corpus type to allow
the specification of a list of variables and functions symbols to keep
(and drop all other functions and variables which have other symbols
on the floor even before starting to compare the two libraries).

This is how the abicompat tool itself works.  It basically compares
L(V) and L(V+P) but it only looks at their exported functions and
variables which symbols are undefined in application A.  If the list
of exported and defined variables and functions of L(V) whose symbols
are undefined in A equals that of L(V+P) (including the sub-types of
these variables and functions) A is still compatible with L(V+P).
Otherwise, they might not be compatible depending on the kind of
differences that are found.

	* include/abg-comparison.h
	(diff_context::show_added_symbols_unreferenced_by_debug_info):
	Declare new accessors.
	(corpus_diff::{deleted_variables,
	deleted_unrefed_function_symbols,
	deleted_unrefed_variable_symbols,
	apply_filters_and_suppressions_before_reporting}): Declare new
	methods.
	(corpus_diff::diff_stats): Declare this new type.  Actually this
	was previously corpus_diff::priv::diff_stats, which was a hidden
	internal type..  We are moving it here, in the external API so
	that client code can have more information about changes
	statistics.  Change all the previously publicly accessible data
	members into accessor functions.
	* src/abg-comparison.cc (class corpus_diff::diff_stats::priv): New
	type.
	(diff_context::priv::show_added_syms_unreferenced_by_di_): New
	data member.
	(diff_context::priv::priv): Adjust.
	(diff_context::show_added_symbols_unreferenced_by_debug_info):
	Define this new method.
	(corpus_diff::priv::emit_diff_stats):  Do not show the diff stat
	if the only changes is added function or variables symbols and if
	we were instructed to not show added symbols.
	(corpus_diff::priv::{diff_stats_, filters_and_suppr_applied_}):
	New data members.
	(corpus_diff::priv::priv): Initialize the
	filters_and_suppr_applied_ data member.
	(corpus_diff::priv::diff_stats): Move this type to
	corpus_diff::diff_stats.
	(corpus_diff::priv::{apply_filters_and_compute_diff_stats,
	emit_diff_stats}): Adjust.
	(corpus_diff::apply_filters_and_suppressions_before_reporting):
	Define new member function.
	(corpus_diff::report): Use the new
	apply_filters_and_suppressions_before_reporting() function, rather
	than applying the filters and suppressions by ourselves.  Also
	adjust to the use the accessors of the new corpus_diff::diff_stats
	type.
	(corpus_diff::{deleted_variables,
	deleted_unrefed_function_symbols,
	deleted_unrefed_variable_symbols}): Define new accessors.
	(corpus_diff::diff_stats::{diff_stats, num_func_removed,
	num_func_added, num_func_changed, num_func_filtered_out,
	net_num_func_changed, num_vars_removed, num_vars_added,
	num_vars_changed, num_vars_filtered_out, net_num_vars_changed,
	num_func_sym_removed, num_func_syms_added, num_var_syms_removed,
	num_var_syms_added}): Define new member functions.
	* include/abg-corpus.h (corpus::{get_sym_ids_of_fns_to_keep,
	get_sym_ids_of_vars_to_keep}): Declare new methods.
	* src/abg-corpus.cc (corpus::priv::{sym_id_fns_to_keep,
	sym_id_vars_to_keep}): Added data members.
	(symtab_build_visitor_type::{unrefed_fun_symbols,
	unrefed_var_symbols, sym_id_fns_to_keep, sym_id_vars_to_keep}):
	Added new data members.
	(symtab_build_visitor_type::symtab_build_visitor_type): Take two
	additional parameters for the function and variable symbol ids to
	keep.
	(symtab_build_visitor_type::add_fn_to_wip_fns): Take the function
	symbols to keep in account when building the exported symbol
	table.
	(symtab_build_visitor_type::add_var_to_wip_vars): Likewise, take
	the variable symbols to keep in account when building the exported
	symbol table.
	(corpus::priv::build_public_decl_table): Adjust the initialization
	of the visitor that walks the ABI artifacts to build the exported
	symbol table to know take a list of function/variable symbols to
	keep.
	(corpus::priv::build_unreferenced_symbols_tables): Ensure that the
	public table of functions/variables is built before doing the work
	of this function.  Also, if a list of variable/function symbols to
	keep is given, drop all symbols that are not in that list on the
	floor.
	(corpus::{get_sym_ids_of_fns_to_keep,
	get_sym_ids_of_vars_to_keep}): Define new accessors.
	* tools/abicompat.cc: New abicompat tool.
	* doc/manuals/abicompat.rst: New documentation source for
	abicompat.
	* doc/manuals/libabigail-tools.rst: Add an entry for the abicompat
	doc.
	* tests/test-abicompat.cc: New test harness for the 'abicompat'
	tool.
	* tests/Makefile.am: Build the runtestabicompat test harness and
	add it to the list of tests harnesses that are run by make check.
	* tests/data/test-abicompat/libtest0-fn-changed-libapp-v0.so: New
	test input.
	* tests/data/test-abicompat/libtest0-fn-changed-libapp-v1.so: Likewise.
	* tests/data/test-abicompat/test0-fn-changed-app: Likewise.
	* tests/data/test-abicompat/test0-fn-changed-0.suppr: Likewise
	* tests/data/test-abicompat/test0-fn-changed-report-0.txt: Likewise.
	* tests/data/test-abicompat/test0-fn-changed-report-1.txt: Likewise.
	* tests/data/test-abicompat/test0-fn-changed-app.cc: Likewise.
	* tests/data/test-abicompat/test0-fn-changed-libapp.h: Likewise.
	* tests/data/test-abicompat/test0-fn-changed-libapp-v0.cc: Likewise.
	* tests/data/test-abicompat/test0-fn-changed-libapp-v1.cc: Likewise.
	* tests/data/test-abicompat/libtest1-fn-removed-v0.so: Likewise.
	* tests/data/test-abicompat/libtest1-fn-removed-v1.so: Likewise.
	* tests/data/test-abicompat/test1-fn-removed-app: Likewise.
	* tests/data/test-abicompat/test1-fn-removed-app.cc: Likewise.
	* tests/data/test-abicompat/test1-fn-removed-report-0.txt: Likewise.
	* tests/data/test-abicompat/test1-fn-removed-v0.cc: Likewise.
	* tests/data/test-abicompat/test1-fn-removed-v1.cc: Likewise.
	* tests/data/test-abicompat/libtest2-var-removed-v0.so: Likewise.
	* tests/data/test-abicompat/libtest2-var-removed-v1.so: Likewise.
	* tests/data/test-abicompat/test2-var-removed-app: Likewise.
	* tests/data/test-abicompat/test2-var-removed-app.cc: Likewise.
	* tests/data/test-abicompat/test2-var-removed-report-0.txt: Likewise.
	* tests/data/test-abicompat/test2-var-removed-v0.cc: Likewise.
	* tests/data/test-abicompat/test2-var-removed-v1.cc: Likewise.
	* tests/data/test-abicompat/libtest3-fn-removed-v0.so: Likewise.
	* tests/data/test-abicompat/libtest3-fn-removed-v1.so: Likewise.
	* tests/data/test-abicompat/test3-fn-removed-app: Likewise.
	* tests/data/test-abicompat/test3-fn-removed-app.cc: Likewise.
	* tests/data/test-abicompat/test3-fn-removed-report-0.txt: Likewise.
	* tests/data/test-abicompat/test3-fn-removed-v0.cc: Likewise.
	* tests/data/test-abicompat/test3-fn-removed-v1.cc: Likewise.
	* tests/data/test-abicompat/test3-fn-removed-version-script-0 Likewise.:
	* tests/data/test-abicompat/test3-fn-removed-version-script-1: Likewise.
	* tests/data/Makefile.am: Add the new test inputs above to the
	source distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-05 15:43:31 +01:00
Dodji Seketeli
27e958dbba Fix manual documentation generation
The manual building was failing in make distcheck because it was being
built using the standard 'html' target.  That target needs the output
to not be rebuilt each time make install-html is called.  Which is not
easily possible for us.  So for now, the apidoc is being generated
using the html-doc target.  Also fix some other issues in the Makefile.

	* doc/manuals/Makefile.am: Trigger the manual generation from the
	html-doc target.  Add the source files to the distribution.  Fix
	the clean target.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-19 21:00:50 +01:00
Dodji Seketeli
42474ecf70 Fix apidoc building
The apidoc building was failing in make distcheck because it was being
built using the standard 'html' target.  That target needs the output
to not be rebuilt each time make install-html is called.  Which is not
easily possible for us.  So for now, the apidoc is being generated
using the html-doc target.

	* doc/Makefile.am: Trigger the building frm the html-doc target.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-19 21:00:16 +01:00