* doc/manuals/abidw.rst: Update the manual for the new --verbose
option.
* tools/abidw.cc (options::do_log): New data member.
(options::options): Initialize it.
(display_usage): New string for --verbose.
(parse_command_line): Parse the --verbose option.
(main): Set the the logging option.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
There are holes in the list of dependencies mentioned in the
document. This patch plugs some of them.
Many thanks to Michi Henning for raising this.
* COMPILING: Mention elfutils, libtool, autoconf, automake and
libtool.
* doc/website/mainpage.txt: Mention automake and libtool. Fix a typo.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This is useful to see the progress of e.g type canonicalization and
visually spot where it takes times on some big binaries.
To do this, this patch enables logging in libabigail itself too.
* doc/manuals/abidiff.rst: Add documentation for new --verbose
option.
* include/abg-dwarf-reader.h (set_do_log): Declare new function.
* src/abg-dwarf-reader.cc (read_context::do_log_): New data
member.
(read_context::read_context): Initialize the new data member.
(read_context::do_log): Define accessors.
(set_do_log): Define new function;
(read_context::canonicalize_types_scheduled)
(read_debug_info_into_corpus): Add logs.
* tools/abidiff.cc (options::do_log): New data member.
(options::options): Initialize it.
(display_usage): Add an usage string for --verbose.
(parse_command_line): Parse the new --verbose option.
(main): Set the dwarf reader's context wrt presence of the
--verbose option.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
The documentation doesn't talk about the mandatory properties in the
suppress_type, suppress_function and suppress_variable sections.
Fixed thus.
* doc/manuals/libabigail-concepts.rst: Talk about the mandatory
properties for suppress_type, suppress_function and
suppress_variable directives.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Now that we release tarballs, this patch updates the website for
instructions about how to compile them.
* doc/website/mainpage.txt: Add instruction about how to build
tarballs.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
This patch changed the revision number of the libabigail library to
make it reflect the fact that we are not in "release candidate" mode,
before the first 1.0 release. So the revision number is now "rc0".
The configuration manager has been updated to support version numbers
that are strings, so that it can supports things like "rc0".
Then, several libabigail tools have been modified to support the
--version option to display their version number.
* configure.ac: Set the version revision to "rc0".
* doc/manuals/abicompat.rst: Adjust manual for new --version
option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abilint.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-config.h (config::{m_format_minor, m_format_major}):
Make these be strings.
(config::{get,set}_format_minor_version_number): Make these return
strings.
(config::{get,set}_format_major_version_number): Make these return
or take strings.
(abigail_get_library_version): Make this take strings.
* src/abg-config.cc (config::config): Adjust.
(config::{get,set}_format_major_version_number): Make these return
or take strings.
(config::{get,set}_format_minor_version_number): Make these return
strings.
(abigail_get_library_version): Make this take strings.
* include/abg-version.h.in: Make the version variables be strings.
* src/abg-writer.cc (write_translation_unit): The version numbers
are now strings so adjust.
* tools/{abicompat,abidiff,abidw,abilint,abipkgdiff,abisym}.cc
(options::display_version): New data member.
(options::options): Initialize it.
(display_usage): Add documentation for new --version option.
(parse_command_line): Parse new --version option.
(main): Support --version.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Abipkgdiff now attempts to extract packages and compare the resulting
ELF pairs in parallel. First off, a thread is spawned to extract each
package and each debuginfo package. After the ELF files are extracted,
mapped and the threads are successfully collected, the resulting
ELF vectors are traversed to identify existing pairs and a list of
arguments for future comparison is made. This list is then sorted
by size from largest to smallest. Unless --no-parallel is
specified on the command line, MIN(pairs,active_processors) threads
are spawned, sharing a single list of arguments. This list is
processed and a map of (ELF_PATH,DIFF_CORPUS) is created. Meanwhile,
the main thread checks this same map for results in the original order
of the ELF pairs, ensuring sequential output. After all the diffing
and reporting is done, the threads are collected again.
* doc/manuals/abipkgdiff.rst: Mention the new --no-parallel option.
* tools/Makefile.am: Add -pthread to abipkgdiffs link options.
* tools/abipkgdiff.cc (elf_file_paths_tls_key): New key for the
thread-local vector of ELF filepaths.
(reports_map): A map of the path of the first ELF of a compared pair
and a corpus representing the difference.
(env_map): A map of the corpus difference and a corresponding
environment needed to be kept alive until the diff is reported.
({arg,map}_lock): mutexes to control access to the comparison argument
list and the {reports,env}_map respectively.
(options): Add a new member "parallel" and set it to true in the ctor.
(elf_file): Add a new "size" member and set it in the ctor.
(package descriptor): Arguments passed to extract_package_set.
(compare_args): Arguments passed to the ELF comparison function.
(display_usage): Mention the new "--no-parallel" option.
(pthread_routine_extract_package): A wrapper function around
extract_package to be used in a multi-threaded environment.
({first_second}_package_tree_walker_callback_fn): Add the new ELF file
paths to a thread-specific vector.
(compare): In an overload of compare, verbose output is updated to
always mention the ELF files being compared for each reported stage.
Reporting is no longer done in this function, the resulting difference
is instead passed back to the calling function for reporting in the
main thread, along with a corresponding environment.
(pthread_routine_compare): Accept a pointer to a vector of comparison
arguments. This function is to be called NTHREAD times and share the
vector passed to it with its other invocations. Create the environment
for compare() and store its output in a map if there is a difference.
(create_maps_of_package_content): Allocate memory for a thread local
vector of ELF paths and dispose of it before returning.
(pthread_routine_extract_pkg_and_map_its_content): Renamed from
extract_package_and_map_its_content. Extract the debuginfo as well as
the regular package in this function. Spawn a separate thread for the
extraction of the debug package.
(pthread_join): A function handling thread joining throughout package
extractions.
(prepare_packages): Spawn a thread to extract each set of packages.
(elf_size_is_greater): New comparison function used to order ELF pairs
by size.
(compare): In the overload of compare, pass through the ELF path
vectors and identify pairs to be diffed. Put them in a vector and sort
it by the summed ELF pair size. Spawn comparison threads and safely
check for results in the proper order of the ELF pairs. Report any
differences ASAP and collect the threads after all the reporting is
done, checking their return status.
(parse_command_line): Check for the "--no-parallel" option.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* doc/Makefile.am: Prefix the path for DOXY_WEBSITE_SRC_CFG and
DOXY_WEBSITE_BLD_{CFG,DIR} with "/doc" to protect it against make
clean.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
This is a debugging and sanity check option. It saves the abi of the
ELF binary to a temporary file, reads it back and compares the abis of
the temporary file against the abi of the input ELF binary.
* tools/abidw.cc (options::abidiff): New data member.
(options::options): Initialize it.
(display_usage): Add a usage string for the new --abidiff option.
(parse_command): Parse the new --abidiff options.
(main): Save the abi of the input elf in a temporary abixml file;
read it back and compare both.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This patch adds support for properties source_location_not_in and
source_location_not_regexp in the [suppress_type] section of
suppression specifications. So the suppression specification:
[suppress_type]
source_location_not_in = foo1.h, foo2.h bar1.h bar2.h
suppresses ABI change reports about types that are *NOT* defined in
files foo{1,2}.h and bar{1,2}.h. The intended use of this construct is to
constrain abi change reports to types that are part of the API of a
given shared library. The API of the library is supposed to be
defined in foo.h and bar.h only.
Similarly, the suppression specification:
[suppress_type]
source_location_not_regexp = (foo|bar){1,2}\\.h
suppresses ABI change reports about types that are not defined in the
same set of files foo1.h, foo2.h, bar1.h and bar2.h.
* include/abg-ini.h (enum property_value::value_kind): Add a
LIST_PROPERTY_VALUE kind.
(class {list_property_value, list_property}): Declare new types.
(is_list_property, is_list_property_value): Declare new functions.
* src/abg-ini.cc (struct list_property_value::priv): Define new
type.
(list_property_value::{list_property_value, get_content,
set_content, as_string}): Define new member functions.
(is_list_property_value): Define new function.
(struct list_property::priv): Define new type.
(list_property::{list_property, get_value, set_value,
handle_escape}): Define new member functions.
(is_list_property): Define new function.
(read_context::buf_): New data member.
(read_context::{peek, get, put_back, good, eof, read_string,
read_list_property_value}): New member functions.
(read_context::read_next_char): Use the new read_context::{get,
good, eof} member function, rather than using the input stream
directly.
(read_context::{skip_white_spaces, skip_comments,
skip_white_spaces_or_comments, read_property_name,
read_function_name, read_function_argument,
read_function_call_expr, read_property_value,
read_tuple_property_value, read_section_name, read_section}):
Adjust to use the new member functions of read_context rather than
using the input stream directly.
(read_context::read_string_property_value): Likewise. Use the new
read_context::read_string() method.
(read_context::{read, write}_property): Support reading list_property.
* include/abg-comparison.h
(type_suppression::{get_source_locations_to_keep,
set_source_locations_to_keep,
set_source_location_to_keep_regex_str,
get_source_location_to_keep_regex_str}): Add new member functions.
* src/abg-comparison.cc
(type_suppression::priv::{source_location_to_keep_,
source_location_to_keep_regex_str_,
source_location_to_keep_regex_}): Add new data members.
(type_suppression::priv::{g,s}et_source_location_to_keep_regex):
Define new member functions.
(type_suppression::{g,s}et_source_locations_to_keep): Define new
member functions.
(type_suppression::{g,s}et_source_location_to_keep_regex_str):
Likewise.
(type_suppression::suppresses_type): Support
"source_location_not_regexp" and "source_location_not_in"
properties of suppression specifications.
(read_type_suppression): Likewise. Also adjust to the fact that
ta tuple property value that is a list of strings is not a list
property value.
* doc/manuals/libabigail-concepts.rst: Add documentation for
source_location_not_in and source_location_not_regexp.
* tests/data/test-diff-suppr/libtest26-loc-suppr-v{0,1}.so: New
binary test inputs.
* tests/data/test-diff-suppr/test26-loc-suppr-{0,1,2}.suppr: New
suppression specification test inputs.
* tests/data/test-diff-suppr/test26-loc-suppr-report-{0,1,2,3}.txt:
New test reference reports.
* tests/data/test-diff-suppr/test26-loc-suppr-v{0,1}.cc: Source
code of the test binary input above.
* tests/data/test-diff-suppr/test26-loc-suppr.h: Likewise.
* tests/data/Makefile.am: Add the new test material to source
distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the new test inputs above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* doc/manuals/Makefile.am (install-man-and-info-doc): Don't check
for abidiff.info, that thing doesn't exist. Rather, check for
abigail.info. Use gzip -f in case the zipped file exists already.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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>
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>
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>
* 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>
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>
* 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>
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>
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>
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>
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>
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>
* 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>
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>
* 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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>