2019-03-27 Dodji Seketeli Update NEWS file for 1.6 * NEWS: Update for 1.6 2019-03-27 Dodji Seketeli Add missing assignment operators * include/abg-interned-str.h (interned_string::operator=): Define assignment operator. * include/abg-ir.h ({location, enum_type_decl::enumerator}::operator=): Declare assignment operator. * src/abg-ir.cc (enum_type_decl::enumerator::operator=): Define assignment operator. 2019-03-25 Dodji Seketeli Bug 24378 - DW_TAG_subroutine_type as a DIE scope causes infinite loop * src/abg-dwarf-reader.cc (get_scope_die): Look through DW_TAG_subroutine_type to get the scope of a given DIE. * tests/data/Makefile.am: Add the two new files below to source distribution. * tests/data/test-read-dwarf/PR24378-fn-is-not-scope.abi: New reference test output. * tests/data/test-read-dwarf/PR24378-fn-is-not-scope.o: New binary test input. * tests/test-read-dwarf.cc (in_out_specs): Add the new test input to the test harness. 2019-03-22 Dodji Seketeli Misc cleanups * src/abg-dwarf-reader.cc (build_function_type): Cleanup indentation and comments. 2019-03-21 Dodji Seketeli Better pointer name equality optimization in DIE de-duplication code * src/abg-dwarf-reader.cc (die_is_pointer_reference_or_typedef_type) (die_peel_pointer_and_typedef): Define new static functions. (compare_dies_string_attribute_value): Turn this function into a static one. (compare_dies_cu_decl_file): Make this function compare the cu decl file name of the leaf type of the pointer, not just the one of the pointer itself. (compare_as_decl_dies): Compare the DWARF tags too. (compare_dies): Simplify logic. 2019-03-21 Dodji Seketeli Add ir::{lookup_data_member, get_function_parameter} * include/abg-ir.h (lookup_data_member, get_function_parameter): Declare new functions. * src/abg-ir.cc (lookup_data_member, get_function_parameter): Define them. 2019-03-21 Dodji Seketeli Better detection of void* to something* change * include/abg-ir.h (is_void_type): Add a new overload that takes type_base*. * src/abg-ir.cc (is_void_type): Define the new overload that takes type_base*. (is_void_pointer_type): Look through typedefs in the pointed-to type. 2019-03-21 Dodji Seketeli PR24257 - Handle DW_TAG_typedef with no underlying type * src/abg-dwarf-reader.cc (build_typedef_type): DW_TAG_typedef with no underlying type means typedef void foo. * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Likewise. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2019-02-20 Dodji Seketeli Do not build DIE -> parent map just because we see an asm TU * src/abg-dwarf-reader.cc: 2019-02-19 Dodji Seketeli Avoid over-suppressing fns & vars when analysing the Kernel * include/abg-dwarf-reader.h (get_ignore_symbol_table): Take a const read_context&. * src/abg-dwarf-reader.cc (get_ignore_symbol_table): Likewise. (function_is_suppressed): When the symbol table optimization is in flight -- that is, when no symbol table has been loaded -- do not try to see if a given function symbol was exported at the ELF level or not. Just look at if the function was suppressed or not. (variable_is_suppressed): Likewise for variables. 2019-02-08 Dodji Seketeli Bug 24188 - Assertion failed while analysing a Fortran binary * src/abg-dwarf-reader.cc (compare_as_type_dies): Handle DW_TAG_string_type DIEs here. (compare_dies): Handle DW_TAG_string_type DIEs by using compare_as_type_dies. * tests/data/test-diff-pkg/netcdf-fortran-debuginfo-4.4.4-10.fc29.x86_64.rpm: New test RPM. * tests/data/test-diff-pkg/netcdf-fortran-debuginfo-4.4.4-11.fc30.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/netcdf-fortran-mpich-4.4.4-10.fc29.x86_64-4.4.4-11.fc30.x86_64-report-0.txt: New expected test reference output. * tests/data/test-diff-pkg/netcdf-fortran-mpich-4.4.4-10.fc29.x86_64.rpm: New test RPM. * tests/data/test-diff-pkg/netcdf-fortran-mpich-4.4.4-11.fc30.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/netcdf-fortran-mpich-debuginfo-4.4.4-10.fc29.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/netcdf-fortran-mpich-debuginfo-4.4.4-11.fc30.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/netcdf-fortran-mpich-devel-4.4.4-10.fc29.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/netcdf-fortran-mpich-devel-4.4.4-11.fc30.x86_64.rpm: Likewise. * tests/data/Makefile.am: Add the new test input material above to source distribution. * tests/test-diff-pkg.cc (in_out_spec): Add the new test RPMs above to the set of RPMs to use as test input. 2019-02-06 Dodji Seketeli Bug 24157 - Wrong support of Ada ranges * include/abg-ir.h (array_type_def::subrange_type::bound_value): Define new class. (array_type_def::subrange_type::subrange_type): Adjust to use the new bound_value type for bound values. (array_type_def::subrange_type::{get_upper_bound, get_lower_bound, set_upper_bound, set_lower_bound}): Return or take int64_t rather than size_t. (array_type_def::subrange_type::get_length): Return uint64_t rather than size_t. * src/abg-dwarf-reader.cc (die_signed_constant_attribute) (die_constant_attribute, die_attribute_has_form) (die_attribute_is_signed, die_attribute_is_unsigned) (die_attribute_has_no_signedness): Define new static functions. (get_default_array_lower_bound): Return uint64_t rather than int. (build_subrange_type): Use the new array_type_def::subrange_type::bound_value type for bound values. Use the new die_constant_attribute function, rather than die_unsigned_constant_attribute to fecth the bound values. * src/abg-ir.cc (array_type_def::subrange_type::bound_value::{bound_value, get_signedness, set_signedness, get_signed_value, get_unsigned_value, set_unsigned, set_signed}): Define new member functions. (array_type_def::subrange_type::priv::{lower_bound_, upper_bound}): Use the new class bound_value. (array_type_def::subrange_type::priv::priv): Adjust to use the new bound_value class to hold bound values. (array_type_def::subrange_type::subrange_type): Likewise. (array_type_def::subrange_type::{get_upper_bound, get_lower_bound, set_upper_bound, set_lower_bound}): Return or take int64_t rather than size_t. (array_type_def::subrange_type::get_length): Return uint64_t rather than size_t. (types_have_similar_structure): Handle array_type_def::subrange_type * src/abg-reader.cc (build_subrange_type): Use the new array_type_def::subrange_type::bound_value to hold bound values. * tests/data/test-diff-pkg/GtkAda-debuginfo-2.24.2-29.fc29.x86_64.rpm: New binary RPM as test input. * tests/data/test-diff-pkg/GtkAda-debuginfo-2.24.2-30.fc30.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/GtkAda-devel-2.24.2-29.fc29.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/GtkAda-devel-2.24.2-30.fc30.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/GtkAda-gl-2.24.2-29.fc29.x86_64--2.24.2-30.fc30.x86_64-report-0.txt: New expected test output. * tests/data/test-diff-pkg/GtkAda-gl-2.24.2-29.fc29.x86_64.rpm: New binary RPM as test input. * tests/data/test-diff-pkg/GtkAda-gl-2.24.2-30.fc30.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/GtkAda-gl-debuginfo-2.24.2-29.fc29.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/GtkAda-gl-debuginfo-2.24.2-30.fc30.x86_64.rpm: Likewise. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the new input testing RPMs in here. 2019-01-30 Dodji Seketeli Small apidoc fix * src/abg-comparison.cc (enum_diff::changed_enumerators): Fix apidoc. 2019-01-30 Dodji Seketeli Bug 24139 - Support suppressing some enumerator changes * doc/manuals/libabigail-concepts.rst: Document the new 'changed_enumerators' property. * include/abg-suppression.h (type_suppression::{g, s}et_changed_enumerator_names): Declare two new member functions. * src/abg-suppression-priv.h (type_suppression::priv::changed_enumerator_names_): Add a new data member. * src/abg-suppression.cc (type_suppression::{g,s}et_changed_enumerator_names): Define two new member functions. (type_suppression::suppresses_diff): Support evaluating the new 'changed_enumerators = '. (read_type_suppression): Read the new list property'changed_enumerators" and store it into the type_suppression using the new type_suppression::set_changed_enumerator_names (). * tests/data/test-diff-suppr/libtest4{0,1}-enumerator-changes-v{0,1}.so: Add new test inpujts. * tests/data/test-diff-suppr/test4{0,1}-enumerator-changes-0.suppr: Add a new suppr spec for this new test. * tests/data/test-diff-suppr/test4{0,1}-enumerator-changes-report-0.txt: The default report. * tests/data/test-diff-suppr/test4{0,1}-enumerator-changes-v{0,1}.cc: Add Source code of libtest4{0,1}-enumerator-changes-v{0,1}.so. * tests/data/Makefile.am: Add the test files above to source distribution. * tests/test-diff-suppr.cc: Add the test input files above to the harness. 2019-01-25 Dodji Seketeli Better comments in the comparison engine * include/abg-comparison.h (enum diff_category): Add comments to describe what to update when a new enumerator is added to this enum. * src/abg-comp-filter.cc (has_fn_return_type_cv_qual_change): Fix comment thinko here. 2019-01-25 Dodji Seketeli Bug 20175 - Classify CV qual changes in variable type as harmless * include/abg-comparison.h (VAR_TYPE_CV_CHANGE_CATEGORY): Add new enumerator to diff_category enum. (EVERYTHING_CATEGORY): Update this enumerator. * src/abg-comp-filter.cc (type_diff_has_cv_qual_change_only): Support array diff nodes carrying a cv qual change on the element type. (has_var_type_cv_qual_change): Define new static function. (categorize_harmless_diff_node): Use the new has_var_type_cv_qual_change to categorize variable diff node with cv qual change on its type as harmless. * src/abg-comparison.cc (get_default_harmless_categories_bitmap): Update this. (operator<<(ostream& o, diff_category c)): Likewise. * include/abg-ir.h (equals_modulo_cv_qualifier): Declare new ... * src/abg-ir.cc (equals_modulo_cv_qualifier): ... function. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Update expected test output. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise. * tests/data/Makefile.am: Add the new test material below to source distribution. * tests/data/test-diff-pkg/nss-3.23.0-1.0.fc23.x86_64-report-0.txt: New expecte test output. * tests/data/test-diff-pkg/nss-3.23.0-1.0.fc23.x86_64.rpm: New test input. * tests/data/test-diff-pkg/nss-3.24.0-1.0.fc23.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/nss-debuginfo-3.23.0-1.0.fc23.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/nss-debuginfo-3.24.0-1.0.fc23.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/nss-devel-3.23.0-1.0.fc23.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/nss-devel-3.24.0-1.0.fc23.x86_64.rpm: Likewise. * tests/test-diff-pkg.cc (in_out_specs): Add the test input above to the test harness. 2019-01-24 Dodji Seketeli Properly add the new rust tests to EXTRA_DIST * tests/data/Makefile.am: Add the new rust tests to EXTRA_DIST. 2019-01-24 Dodji Seketeli Conditionalize the Rust support regression test * tests/test-diff-dwarf.cc: Run the rust support regression test only if we support Rust on the platform. * tests/test-utils.h: Include config.h. 2019-01-24 Dodji Seketeli Fix a typo in the recent Rust support and update regression tests * configure.ac: Fix the typo HAS_LANG_Rust into HAS_DW_LANG_Rust. * tests/data/test-diff-dwarf/test46-readme.txt: Add new file to the test suite. * tests/data/test-diff-dwarf/test46-rust-libone.so: Likewise. * tests/data/test-diff-dwarf/test46-rust-libtwo.so: Likewise. * tests/data/test-diff-dwarf/test46-rust-report-0.txt: Likewise. * tests/test-diff-dwarf.cc (in_out_specs): Update the tests array to compare the two new binaries included above. 2019-01-18 Dodji Seketeli Overhaul detection the DW_LANG_* enumerators from dwarf.h * configure.ac: Detect the presence of DW_LANG_{UPC, D, Python, Go, C11, C_plus_plus_03, C_plus_plus_11, C_plus_plus_14, Mips_Assembler, Rust} and define the corresponding HAVE_DW_LANG_*_enumerator macro accordingly. * include/abg-ir.h (LANG_C_plus_plus_03): Define this new enumerator in the translation_unit::language enum. * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Use the new HAVE_DW_LANG_*_enumerator macros. (get_default_array_lower_bound): Support the translation_unit::LANG_C_plus_plus_03 enumerator. * src/abg-ir.cc (is_cplus_plus_language): Support the translation_unit::LANG_C_plus_plus_03 enumerator. 2019-01-18 Dodji Seketeli Fix a thinko * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Fix a thinko in the detection of the support of the DW_LANG_Rust enumerator. 2019-01-17 Mark Wielaard Conditionalize the use of DW_LANG_C_plus_plus_03 and DW_LANG_Rust * include/abg-ir.h (LANG_C_plus_plus_03): Add this new language enum to "enum translation_unit::language". * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Do not use DW_LANG_Rust or DW_LANG_C_plus_plus_03 if these are not defined. (get_default_array_lower_bound): Handle the new translation_unit::LANG_C_plus_plus_03 enumerator. 2019-01-17 Dodji Seketeli Support some new DWARF language encoding for C and C++ * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Support new DW_LANG_{C11, C_plus_plus_03, C_plus_plus_11, C_plus_plus_14} enumerators. 2019-01-17 Dodji Seketeli Add (very) basic support for Rust * include/abg-ir.h (LANG_Rust): Add this new enumerator to the "enum language" enum. * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Handle the Rust language. (get_default_array_lower_bound): Likewise. 2019-01-15 Dodji Seketeli Separate public types of first binary from those of the second * include/abg-dwarf-reader.h (read_context_get_path): Declare new function. * include/abg-reader.h (read_context_get_path): Likewise. * src/abg-dwarf-reader.cc (read_context_get_path): Define new function. * src/abg-reader.cc (read_context_get_path): Likewise. * tools/abidiff.cc (set_suppressions): Set the suppression specification derived from the --headers-dir1 option only for the first binary, and similarly, from the --headers-dir2 option only for the second binary. 2019-01-09 Dodji Seketeli Bug 23044 - Assertions with side effects * configure.ac: * include/abg-diff-utils.h: * include/abg-fwd.h: * src/abg-comp-filter.cc: * src/abg-comparison-priv.h: * src/abg-comparison.cc: * src/abg-corpus-priv.h: * src/abg-corpus.cc: * src/abg-default-reporter.cc: * src/abg-diff-utils.cc: * src/abg-dwarf-reader.cc: * src/abg-hash.cc: * src/abg-ini.cc: * src/abg-ir.cc: * src/abg-leaf-reporter.cc: * src/abg-reader.cc: * src/abg-reporter-priv.cc: * src/abg-suppression.cc: * src/abg-tools-utils.cc: * src/abg-workers.cc: * src/abg-writer.cc: * tests/test-diff-filter.cc: * tests/test-diff-pkg.cc: * tests/test-read-dwarf.cc: * tests/test-read-write.cc: * tests/test-types-stability.cc: * tools/abicompat.cc: * tools/abidw.cc: * tools/abipkgdiff.cc: 2019-01-07 Dodji Seketeli Update copyright for 2019 * include/abg-comp-filter.h: Update copyright for 2019 * include/abg-comparison.h: Update copyright for 2019 * include/abg-config.h: Update copyright for 2019 * include/abg-corpus.h: Update copyright for 2019 * include/abg-diff-utils.h: Update copyright for 2019 * include/abg-dwarf-reader.h: Update copyright for 2019 * include/abg-fwd.h: Update copyright for 2019 * include/abg-hash.h: Update copyright for 2019 * include/abg-ini.h: Update copyright for 2019 * include/abg-interned-str.h: Update copyright for 2019 * include/abg-ir.h: Update copyright for 2019 * include/abg-libxml-utils.h: Update copyright for 2019 * include/abg-libzip-utils.h: Update copyright for 2019 * include/abg-reader.h: Update copyright for 2019 * include/abg-reporter.h: Update copyright for 2019 * include/abg-sptr-utils.h: Update copyright for 2019 * include/abg-suppression.h: Update copyright for 2019 * include/abg-tools-utils.h: Update copyright for 2019 * include/abg-traverse.h: Update copyright for 2019 * include/abg-viz-common.h: Update copyright for 2019 * include/abg-viz-dot.h: Update copyright for 2019 * include/abg-viz-svg.h: Update copyright for 2019 * include/abg-workers.h: Update copyright for 2019 * include/abg-writer.h: Update copyright for 2019 * src/abg-comp-filter.cc: Update copyright for 2019 * src/abg-comparison-priv.h: Update copyright for 2019 * src/abg-comparison.cc: Update copyright for 2019 * src/abg-config.cc: Update copyright for 2019 * src/abg-corpus-priv.h: Update copyright for 2019 * src/abg-corpus.cc: Update copyright for 2019 * src/abg-default-reporter.cc: Update copyright for 2019 * src/abg-diff-utils.cc: Update copyright for 2019 * src/abg-dwarf-reader.cc: Update copyright for 2019 * src/abg-hash.cc: Update copyright for 2019 * src/abg-ini.cc: Update copyright for 2019 * src/abg-internal.h: Update copyright for 2019 * src/abg-ir-priv.h: Update copyright for 2019 * src/abg-ir.cc: Update copyright for 2019 * src/abg-leaf-reporter.cc: Update copyright for 2019 * src/abg-libxml-utils.cc: Update copyright for 2019 * src/abg-libzip-utils.cc: Update copyright for 2019 * src/abg-reader.cc: Update copyright for 2019 * src/abg-reporter-priv.cc: Update copyright for 2019 * src/abg-reporter-priv.h: Update copyright for 2019 * src/abg-sptr-utils.cc: Update copyright for 2019 * src/abg-suppression-priv.h: Update copyright for 2019 * src/abg-suppression.cc: Update copyright for 2019 * src/abg-tools-utils.cc: Update copyright for 2019 * src/abg-traverse.cc: Update copyright for 2019 * src/abg-viz-common.cc: Update copyright for 2019 * src/abg-viz-dot.cc: Update copyright for 2019 * src/abg-viz-svg.cc: Update copyright for 2019 * src/abg-workers.cc: Update copyright for 2019 * src/abg-writer.cc: Update copyright for 2019 * tests/print-diff-tree.cc: Update copyright for 2019 * tests/test-abicompat.cc: Update copyright for 2019 * tests/test-abidiff-exit.cc: Update copyright for 2019 * tests/test-abidiff.cc: Update copyright for 2019 * tests/test-alt-dwarf-file.cc: Update copyright for 2019 * tests/test-core-diff.cc: Update copyright for 2019 * tests/test-diff-dwarf-abixml.cc: Update copyright for 2019 * tests/test-diff-dwarf.cc: Update copyright for 2019 * tests/test-diff-filter.cc: Update copyright for 2019 * tests/test-diff-pkg.cc: Update copyright for 2019 * tests/test-diff-suppr.cc: Update copyright for 2019 * tests/test-diff2.cc: Update copyright for 2019 * tests/test-ini.cc: Update copyright for 2019 * tests/test-ir-walker.cc: Update copyright for 2019 * tests/test-lookup-syms.cc: Update copyright for 2019 * tests/test-read-dwarf.cc: Update copyright for 2019 * tests/test-read-write.cc: Update copyright for 2019 * tests/test-types-stability.cc: Update copyright for 2019 * tests/test-utils.cc: Update copyright for 2019 * tests/test-utils.h: Update copyright for 2019 * tests/test-write-read-archive.cc: Update copyright for 2019 * tools/abiar.cc: Update copyright for 2019 * tools/abicompat.cc: Update copyright for 2019 * tools/abidiff.cc: Update copyright for 2019 * tools/abidw.cc: Update copyright for 2019 * tools/abilint.cc: Update copyright for 2019 * tools/abipkgdiff.cc: Update copyright for 2019 * tools/abisym.cc: Update copyright for 2019 * tools/binilint.cc: Update copyright for 2019 * tools/kmidiff.cc: Update copyright for 2019 * update-copyright.sh: Update new year to 2019 2018-12-06 Xiao Jia via libabigail Some documentation fixes * COMPILING: Add the pkg-config dependency. * doc/manuals/kmidiff.rst: Replace the redundant --full-impact documentation with the proper --impacted-interfaces one. 2018-11-29 Dodji Seketeli Add basic support for Fortran binaries * src/abg-dwarf-reader.cc (die_pretty_print_type): Support DW_TAG_string_type DIEs. They all have the same representation for now. 2018-11-08 Dodji Seketeli Some light style change in abidiff.cc * tools/abidiff.cc (adjust_diff_context_for_kmidiff): Take a reference to diff_context rather than a pointer. (main): Adjust. 2018-11-08 Dodji Seketeli Add a --fail-no-debug-info to abidiff * doc/manuals/abidiff.rst: Document the new --fail-no-debug-info option. * tools/abidiff.cc (options::fail_no_debug_info): Define new data member. (display_usage): Provide a help string for the new --fail-no-debug-info option. (parse_command_line): Parse the new option. (main): If --fail-no-debug-info and no debug info was found, or not alternate debuginfo file was found, bail out. 2018-11-08 Dodji Seketeli Support having several debuginfo search dirs for a binary * doc/manuals/abidiff.rst: Adjust doc for the --debug-info-dir{1,2} that can now be provided several times. * include/abg-dwarf-reader.h ({create, reset}_read_context) (read_corpus_from_elf): Take a vector of debug info root dirs. * include/abg-tools-utils.h (trim_leading_string) (find_file_under_dir, make_path_absolute_to_be_freed) (convert_char_stars_to_char_star_stars): Declare new functions. * src/abg-dwarf-reader.cc (find_alt_debug_info_link): Renamed find_alt_debug_info_location into this. (find_alt_debug_info_path): Define new static function. (find_alt_debug_info): Take a vector of debug info root dirs. Use the new find_alt_debug_info_path to look into the debug info root dirs for the alt debug info. (read_context::debug_info_root_paths_): Define new data member. (read_context::read_context): Take a vector of debug info root dirs and initialize the new read_context::debug_info_root_paths_. (read_context::{initialize, create_default_dwfl}): Take a vector of debug info root dirs and adjust. (read_context::{add_debug_info_root_paths, add_debug_info_root_path, find_alt_debug_info}): Define new member functions. (read_context::load_debug_info): Look into the debug info roots for split debug info files. (create_read_context, read_corpus_from_elf): Take a vector of debug info root dirs and adjust. (has_alt_debug_info): Adjust. * src/abg-tools-utils.cc (trim_leading_string) (make_path_absolute_to_be_freed, find_file_under_dir) (convert_char_stars_to_char_star_stars): Define new functions. (entry_of_file_with_name): Define new static function. (build_corpus_group_from_kernel_dist_under): Adjust. * tests/print-diff-tree.cc (main): Adjust. * tests/test-diff-dwarf.cc (main): Adjust. * tests/test-ir-walker.cc (main): Adjust. * tests/test-read-dwarf.cc (main): Adjust. * tools/abicompat.cc (main): Adjust. * tools/abidiff.cc (options::di_root_paths{1,2}): Changed di_root_path{1,2} into this, change their types into vectors of allocated char*. (options::prepared_di_root_paths{1,2}): Define new data members. (options::~options): Define new destructor. (parse_command_line): Adjust. (prepare_di_root_paths): Define new static function. (handle_error): Remove arguments input_file_name, debug_info_dir{1,2}. Now just take an instance of options instead. Adjust. (main): Adjust. * tools/abidw.cc (options::dir_root_paths): Renamed dir_root_path into this and make it be a vector of allocated char*. (options::prepared_di_root_paths): Define new data member. (options::~options): Free the allocated char* in options::dir_root_paths. (parse_command_line): Support several --debug-info-dir. (load_corpus_and_write_abixml): Adjust. (prepare_di_root_paths): Define static function. (main): Adjust. * tools/abilint.cc (main): Adjust. * tools/abipkgdiff.cc (compare): Adjust. 2018-10-26 Dodji Seketeli Update website for 1.5 * doc/website/mainpage.txt: Update website for 1.5 2018-10-26 Dodji Seketeli Bump version number to 1.6 * configure.ac: Bump version number to 1.6 2018-10-25 Dodji Seketeli Update ChangeLog for 1.5 * ChangeLog: Update automatically by calling make update-changelog. 2018-10-25 Dodji Seketeli Update NEWS file for 1.5 * NEWS: Update for 1.5 2018-10-18 Dodji Seketeli Bug rhbz1638554 - assertion failed in is_mostly_distinct_diff * src/abg-comp-filter.cc (is_mostly_distinct_diff): Handle the case of the type diff of the function parameter diff being a distinct diff. 2018-10-17 Dodji Seketeli Define UINT64_MAX when it's not defined * src/abg-dwarf-reader.cc: Define UINT64_MAX when it's not defined. 2018-10-16 Dodji Seketeli Better support array with unknown upper bound * include/abg-comparison.h (BENIGN_INFINITE_ARRAY_CHANGE_CATEGORY): A new enumerator in the diff_category enum. (EVERYTHING_CATEGORY): Adjust. * src/abg-comparison.cc (get_default_harmless_categories_bitmap): Adjust. (operator<<(ostream& o, diff_category)): Likewise. * include/abg-ir.h (array_type_def::subrange_type::is_infinite): Declare new member function. * src/abg-ir.cc (array_type_def::subrange_type::priv::infinite_): New data member. (array_type_def::subrange_type::priv::priv): Initialize it. (array_type_def::subrange_type::get_length): Better support unknown sized subrange. (array_type_def::subrange_type::is_infinite): Define new member function. * src/abg-comp-filter.cc (has_benign_infinite_array_change): Define new static function. (categorize_harmless_diff_node): Use the new has_benign_infinite_array_change above. * src/abg-dwarf-reader.cc (build_subrange_type): Better recognize a subrange type with unknown upper bound. Represent that with the new array_type_def::subrange_type::is_infinite member property. * src/abg-reader.cc (build_subrange_type): Likewise. * tests/data/test-abidiff/test-PR18166-libtirpc.so.abi: Adjust. * tests/data/test-annotate/libtest23.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test7.so.abi: Likewise. * tests/data/test-read-dwarf/libtest23.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2018-10-11 Dodji Seketeli Add default suppression specification for the libvirt project * default.abignore: Suppress changes on functions with symbol version LIBVIRT_PRIVATE in libvirt.so.* shared objects. 2018-10-11 Dodji Seketeli Add default suppression specification for the krb5 project * default.abignore: Ignore changes about functions starting with krb5int_.*. 2018-10-03 Dodji Seketeli Misc comment fix * src/abg-suppression.cc (type_suppression::suppresses_diff): Fix comment. 2018-10-03 Dodji Seketeli Bug 23708 - categorize void* to pointer change as harmless * include/abg-comparison.h (VOID_PTR_TO_PTR_CHANGE_CATEGORY): New enumerator in the diff_category enum. Also, adjust the EVERYTHING_CATEGORY enumerator. * include/abg-fwd.h (is_void_pointer_type): Declare new function. * src/abg-comp-filter.cc (has_void_ptr_to_ptr_change): Define new static function and ... (categorize_harmless_diff_node): ... use it here. * src/abg-comparison.cc (get_default_harmless_categories_bitmap): Add the new abigail::comparison::VOID_PTR_TO_PTR_CHANGE_CATEGORY category in here. (operator<<(ostream& o, diff_category c)): Add support for the new VOID_PTR_TO_PTR_CHANGE_CATEGORY. * src/abg-ir.cc (is_void_pointer_type): Define new function. * tests/data/Makefile.am: Add the new test material below to source distribution. * tests/data/test-diff-filter/test47-filter-void-ptr-change-report-0.txt: New test reference output. * tests/data/test-diff-filter/test47-filter-void-ptr-change-v{0,1}.c: Source code of the new binary test input below. * tests/data/test-diff-filter/test47-filter-void-ptr-change-v{0,1}.o: New binary test input. * tests/test-diff-filter.cc: Add the test input/output above to test harness. 2018-10-02 Dodji Seketeli Categorize CV qualifier changes on fn return types as harmless * include/abg-comparison.h (FN_RETURN_TYPE_CV_CHANGE_CATEGORY): New enumerator for diff_category. (EVERYTHING_CATEGORY): Update. * src/abg-comp-filter.cc (type_diff_has_cv_qual_change_only): Factorize this function out of ... (has_fn_parm_type_cv_qual_change): ... this one. (has_fn_return_type_cv_qual_change): Define new static function. (categorize_harmless_diff_node): Use the new has_fn_return_type_cv_qual_change. * src/abg-comparison.cc (get_default_harmless_categories_bitmap): Adjust to add the new FN_RETURN_TYPE_CV_CHANGE_CATEGORY category. (operator<<(ostream& o, diff_category c)): Support the new FN_RETURN_TYPE_CV_CHANGE_CATEGORY. * tests/data/Makefile.am: Add the new test material below to source distribution. * tests/data/test-diff-filter/test46-fn-return-qual-change-report-0.txt: New reference output for the new input test. * tests/data/test-diff-filter/test46-fn-return-qual-change-v{0,1}.c: New source code for the new binary test input. * tests/data/test-diff-filter/test46-fn-return-qual-change-v{0,1}.o: New binary test input files. * tests/test-diff-filter.cc: Add the new test input above to test harness. 2018-10-01 Dodji Seketeli Fix propagation of private type suppression category * include/abg-comp-filter.h (has_harmful_name_change): Declare new function overloads. * include/abg-comparison.h (PRIVATE_TYPE_CATEGORY): New enumerator for diff_category; (EVERYTHING_CATEGORY): Adjust this enumerator in diff_category; (is_suppressed): Take an output parameter to say if the suppression is a private type suppression. * include/abg-suppression.h (is_private_type_suppr_spec): Take a const reference parameter and add an overload for a shared pointer. * src/abg-comp-filter.cc (has_harmful_name_change): Define new function. * src/abg-comparison-priv.h (diff::priv::is_filtered_out): Diffs of category PRIVATE_TYPE_CATEGORY are also considered filtered out. * src/abg-comparison.cc (diff::is_filtered_out): Adjust to account for canonical diffs of category PRIVATE_TYPE_CATEGORY. (diff::is_suppressed): Add an overload that takes a is_private_type output parameter. Re-write the old overload in terms of the new one. (operator<<(ostream& o, diff_category c)): Handle PRIVATE_TYPE_CATEGORY. (category_propagation_visitor::visit_end): Do not propagate PRIVATE_TYPE_CATEGORY here. Do not propagate HARMLESS_DECL_NAME_CHANGE_CATEGORY either, when the class does have a harmful decl name change. (suppression_categorization_visitor::visit_begin): Set the new PRIVATE_TYPE_CATEGORY category but do not propagate it. (suppression_categorization_visitor::visit_end): Add some comments. * src/abg-default-reporter.cc (default_reporter::report): Avoid reporting typedef underlying types that are in the PRIVATE_TYPE_CATEGORY category. * src/abg-suppression.cc (type_suppression::suppresses_diff): Do not peel typedefs if we are a private type suppression. (is_private_type_suppr_spec): Take a const reference. * tests/data/Makefile.am: Add the new test material below to source distribution. * tests/test-diff-suppr.cc: Use new test binary input. * tests/data/test-diff-filter/test7-report.txt: Adjust. * tests/data/test-diff-suppr/test39-opaque-type-report-0.txt: New test reference output. * tests/data/test-diff-suppr/test39-opaque-type-v{0,1}.c: Source code of new test binary input. * tests/data/test-diff-suppr/test39-opaque-type-v{0,1}.o: New test binary input. * tests/data/test-diff-suppr/test39-public-headers-dir/test39-header-v{0,1}.h: Source code of new test binary input. 2018-09-25 Dodji Seketeli PR23641 - confusion when a type definition DIE is matched by a supprspec and its decl DIEs aren't * src/abg-dwarf-reader.cc (get_opaque_version_of_type): If no pre-existing opaque version was found, a new one is created and returned. Take a needed "where_offset" parameter. (build_ir_node_from_die): Adjust the call to get_opaque_version_of_type. 2018-09-21 Dodji Seketeli PR23641 - Type definition DIE matched by a supprspec but not its decl *definition* of T, they will be dropped too. We'll end up with those two libraries that are identical (modulo the order in which libabigail sees type declarations and their definitions) and are considered different when a suppression specification makes us drop T: the second library appears to libabigail as if T was removed from it. This is the problem addressed by this patch. When the definition of a type T is suppressed because it's considered private then we look if there was a forward declaration for it elsewhere, that is not matched by the private type suppression specification. If we encountered such a type declaration then it means that declaration is in effect an "opaque" version of T. So rather than just dropping T altogether, we keep (and build an IR) for its opaque version only. And we drop the definition of T. This seems to fix the issue. I can't seem to reproduce the slight re-ordering of DIEs descriptions that uncover the issue so I'll rely on integration tests to catch future regressions on this issue, rather than on unit tests. Sigh. * include/abg-tools-utils.h (PRIVATE_TYPES_SUPPR_SPEC_NAME): Remove this extern constant definition. * src/abg-dwarf-reader.cc (type_is_suppressed): Add an overload that takes an additional type_is_private output parameter. (get_opaque_version_of_type): New static function. (build_ir_node_from_die): For class types, get the opaque version for suppressed private types rather than dropping them altogether. * src/abg-reader.cc (type_is_suppressed): Adjust. * src/abg-suppression-priv.h (type_is_suppressed): Add an overload that takes a type_is_private output parameter. * include/abg-suppression.h (get_private_types_suppr_spec_label) (is_private_type_suppr_spec): Declare new functions. * src/abg-suppression.cc (get_private_types_suppr_spec_label, is_private_type_suppr_spec): Define new functions. (suppression_matches_type_name_or_location): Use the new get_private_types_suppr_spec_label rather than a global extern variable. * src/abg-tools-utils.cc (handle_fts_entry): Adjust to use the new get_private_types_suppr_spec_label. (gen_suppr_spec_from_headers): Handle the case or an empty headers root dir. 2018-09-03 Dodji Seketeli Add option to avoid walking abigail::ir nodes twice * include/abg-ir.h (struct ir_node_visitor): Make this be a class. Add a private data member to it, following the 'pimpl' idiom. (ir_node_visitor::{allow_visiting_already_visited_type_node, mark_type_node_as_visited, forget_visited_type_nodes, type_node_has_been_visited}): Declare new member functions. * src/abg-ir.cc ({type_base, type_decl, scope_type_decl, qualified_type_decl, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, class_or_union, class_decl, union_decl}::traverse): Avoid re-visiting the type node if the visitor was configured as such. (struct ir_node_visitor::priv): Define new struct. (ir_node_visitor::{allow_visiting_already_visited_type_node, mark_type_node_as_visited, forget_visited_type_nodes, type_node_has_been_visited}): Define new member functions. * tests/test-ir-walker.cc (name_printing_visitor::name_printing_visitor): Avoid visiting a type node twice. 2018-08-31 Dodji Seketeli Fix apidoc of dwarf_reader::get_soname_of_elf_file * src/abg-dwarf-reader.cc (get_soname_of_elf_file): Document the first parameter. Remove bogus documentation of the previous 'elf' parameter. 2018-08-30 Dodji Seketeli Bug 23533 - Accept '=' in ini property values * src/abg-ini.cc (char_is_delimiter): Take a new include_equal flag to control is the equal character should be considered as a delimiter or not. (char_is_property_value_char): Accept the equal character as a valid property value character. * tests/Makefile.am: Build a new runtestini test from the new tests/test-ini.cc source file. * tests/data/Makefile.am: Add the two new test inputs below to source distribution. * tests/data/test-ini/test01-equal-in-property-string.{abignore, abignore.expected}: New test inputs. * tests/test-ini.cc: New test harness. 2018-08-06 Dodji Seketeli Make test-ir-walker work on ELF binaries directly * test-ir-walker.cc (main): Load an ABI corpus from an elf file and walk its translation units. 2018-07-17 Dodji Seketeli Allow use of python even when fedabipkgdiff is disabled * configure.ac: Detect the presence and version of python even when fedabipkgdiff is disabled. 2018-07-16 Dodji Seketeli Bump version number to 1.5 * configure.ac: Bump version number to 1.5 2018-07-13 Dodji Seketeli Update ChangeLog for 1.4 release * ChangeLog: Update this using make update-changelog 2018-07-13 Dodji Seketeli Update NEWS file for 1.4 release * NEWS: Added 1.4 entries 2018-07-13 Dodji Seketeli Properly add test materials for test-diff-suppr/test38-char-class-in-ini* * tests/data/Makefile.am: Add proper path for test-diff-suppr/test38-char-class-in-ini*. 2018-07-12 Dodji Seketeli Allow square brackets in ini property values * src/abg-ini.cc (char_is_delimiter): Possibly disallow square bracket characters into the set of delimiters. * tests/data/test-diff-suppr/test38-char-class-in-ini-report-0.txt: New reference output. * tests/data/test-diff-suppr/test38-char-class-in-ini-v{0,1}.c: Source code new test binaries. * tests/data/test-diff-suppr/test38-char-class-in-ini-v{0,1}.o: New test binaries. * tests/data/test-diff-suppr/test38-char-class-in-ini.abignore: New test abi suppression file. * tests/data/Makefile.am: Add the new test materials above to source distribution. * tests/test-diff-suppr.cc: Add the test materials above to the set of tests to run. 2018-07-10 Dodji Seketeli Fix race between runtestdefaultsupprs{py3.sh,.py} * tests/Makefile.am: Run runtestdefaultsupprspy3.sh if we are in python3 mode otherwise run runtestdefaultsupprs.py. 2018-06-29 Dodji Seketeli Ensure die_function_type_is_method_type returns a class type die * src/abg-dwarf-reader.cc (die_peel_typedef): Define new static function. (die_function_type_is_method_type): Use the function above to peel the class die from potential typedefs wrapping it. 2018-06-28 Dodji Seketeli Misc style adjustements * include/abg-suppression.h (function_suppression::ADDED_FUNCTION_CHANGE_KIND): Fix the comment of this enumerator. (suppresses_variable): Cleanup parameter name. * src/abg-comparison.cc: Remove useless horizontal space. * src/abg-suppression.cc (variable_suppression::suppresses_variable): Fix typo. 2018-06-28 Dodji Seketeli Initial basic support of union type in suppression specifications * src/abg-suppression.cc (suppression_matches_type_no_name): Support union types. 2018-06-28 Dodji Seketeli Filter out changes like type to const type * include/abg-comparison.h (FN_PARM_TYPE_CV_CHANGE_CATEGORY): Add this new enumerator to the diff_category enum. Also, OR this to the value of the EVERYTHING_CATEGORY enumerator. * src/abg-comp-filter.cc (has_fn_parm_type_top_cv_qual_change): Rename has_fn_parm_type_cv_qual_change into this. (has_fn_parm_type_cv_qual_change): New function. (categorize_harmless_diff_node): Categorize cv qual changes as being of category FN_PARM_TYPE_CV_CHANGE_CATEGORY. * src/abg-comparison.cc (get_default_harmless_categories_bitmap): Add FN_PARM_TYPE_CV_CHANGE_CATEGORY to the default harmless categories. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Adjust. 2018-06-28 Dodji Seketeli Fix redundancy detection through fn ptr and typedef paths * include/abg-comparison.h (is_function_type_diff_with_local_changes) (is_reference_or_pointer_diff_to_non_basic_distinct_types) (peel_typedef_diff): Declare new functions. * src/abg-comparison.cc (is_function_type_diff_with_local_changes) (is_reference_or_ptr_diff_to_non_basic_nor_distinct_types) (peel_typedef_diff): Define new functions. (is_reference_or_pointer_diff): Peel typedefs before operating. (redundancy_marking_visitor::visit_begin): Only sibbling parameter diff node that carry basic type changes (or distinct type changes) are *not* marked as redundant. All other kinds of sibbling parameter diff nodes are markes redundant. Also, rather than never marking function type diffs as redundant by fear of missing local changes on these, just avoid marking function type diff nodes with local changes. It's possible to be that precise now that we can detect that a diff node carries local changes. * tests/data/test-diff-suppr/test37-opaque-type-v{0,1}.o: New binary tests input. * tests/data/test-diff-suppr/test37-opaque-type-v{0,1}.c: Source code of the binary tests input above. * tests/data/test-diff-suppr/test37-opaque-type-header-dir/test37-opaque-type-header-v{0,1}.h: Headers of the binary tests input above. * tests/data/test-diff-suppr/test37-opaque-type-report-0.txt: Reference output for this new test. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-suppr.cc (in_out_specs): Add the new test input above to the test harness. 2018-06-08 Dodji Seketeli Fix indentation of help string in abipkgdiff * tools/abipkgdiff.cc (display_usage): Fix indentation of help string. 2018-06-08 Dodji Seketeli Identify a function using its symbol name and version * src/abg-default-reporter.cc (default_reporter::report): In C, tell the user about the underlying function symbol name only if said symbol name is different from the name of the function. * src/abg-ir.cc (function_decl::get_id): If the function has an underlying symbol, use the symbol name and version as the function ID. But if the function symbol has an alias then use the linkage name as the ID. * tests/data/test-diff-pkg/elfutils-debuginfo-0.170-4.el7.x86_64.rpm: New binary test input. * tests/data/test-diff-pkg/elfutils-debuginfo-0.171-1.el7.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/elfutils-devel-0.170-4.el7.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/elfutils-devel-0.171-1.el7.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/elfutils-libs-0.171-1.el7.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64-multiple-sym-vers-report-0.txt: New reference test output. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Integrate the new test inputs above into the harness. 2018-06-06 Dodji Seketeli Bump version to 1.4 * configure.ac: Bump version to 1.4 2018-06-06 Dodji Seketeli Explicitely detect anonymous data member changes * include/abg-comp-filter.h (has_anonymous_data_member_change): Add new function declaration. * include/abg-fwd.h (is_data_member, is_anonymous_data_member): declare new overloads. * src/abg-comp-filter.cc (has_anonymous_data_member_change): Define new overloads. * src/abg-ir.cc (is_data_member, is_anonymous_data_member): Define new overloads. * src/abg-reporter-priv.cc (represent): In the var_diff overload, detect when we have anonymous data member changes and emit explicit error messages then. * tests/data/test-diff-dwarf/test45-anon-dm-change-report-0.txt: New test material. * tests/data/test-diff-dwarf/test45-anon-dm-change-v0.cc: Likewise. * tests/data/test-diff-dwarf/test45-anon-dm-change-v0.o: Likewise. * tests/data/test-diff-dwarf/test45-anon-dm-change-v1.cc: Likewise. * tests/data/test-diff-dwarf/test45-anon-dm-change-v1.o: Likewise. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test material above to the test harness. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise. 2018-06-05 Dodji Seketeli Add test44-anon-struct-union-v{0,1}.o to source distribution * tests/data/Makefile.am: Add test-diff-dwarf/test44-anon-struct-union-v{0,1}.o files to source distribution. 2018-06-04 Dodji Seketeli Use the flat representation for anonymous struct/unions * src/abg-ir.cc (get_class_or_union_flat_representation): Take a const class_or_union* (like what the declaration in the header file says), rather than just a class_or_union*. ({class,union}_decl::get_pretty_representation): For anonymous classes and unions, use the flat representation. * tests/data/test-annotate/libtest23.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test44-anon-struct-union-report-0.txt: New test reference output. * tests/data/test-diff-dwarf/test44-anon-struct-union-v{0,1}.cc: Source code of new test binary outputs. * tests/data/test-diff-dwarf/test44-anon-struct-union-v{0,1}.o: New test binary outputs. * tests/data/Makefile.am: Add the new test materials above to source districution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test material above to the test harness here. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Likewise. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. 2018-06-01 Dodji Seketeli Better detect when pointer and qualified types carry local changes * src/abg-comparison.cc (leaf_diff_node_marker_visitor::visit_begin): Do not mark qualified types as leaf diff nodes. (redundancy_marking_visitor::visit_end): Changes to qualified type are never considered local. This is just as for pointer and reference types. * src/abg-default-reporter.cc (default_reporter::report_local_reference_type_changes): Display structural changes of the pointed-to type. (default_reporter::report): In the overload for reference_diff, better detect and handle when we have local changes, or not. * src/abg-ir.cc (equals): In the overload for qualified_type_def and reference_type_de, report local type changes of the underlying type as local changes. Add comments in the overload for pointer type, and make it look like the the overload for reference_type. * src/abg-leaf-reporter.cc (leaf_reporter::report): In the overload for pointer_diff, remove end of line. * tests/data/test-diff-filter/libtest45-basic-type-change-report-1.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise. 2018-05-23 Dodji Seketeli Better detect when diff nodes only carry local type changes * include/abg-comparison.h ({diff, type_diff_base, decl_diff_base, distinct_diff, var_diff, pointer_diff, reference_diff, array_diff, qualified_type, enum_diff, class_or_union_diff, class_diff, base_diff, scope_diff, fn_parm_diff, function_type_diff, function_decl_diff, typedef_diff, translation_unit_diff}::has_local_changes): Return an enum change_kind, rather than just a bool. (is_diff_of_basic_type): Declare an overload that takes a boolean flag. (is_qualified_type_diff, peel_pointer_diff, peel_reference_diff) (peel_qualified_type, peel_pointer_or_qualified_type): Declare new functions * include/abg-fwd.h (peel_qualified_type): * include/abg-ir.h (enum change_kind::{LOCAL_TYPE_CHANGE_KIND, LOCAL_NON_TYPE_CHANGE_KIND, ALL_LOCAL_CHANGES_MASK}): Add these three new enumerators. * src/abg-comparison.cc ({distinct_diff, var_diff, pointer_diff, array_diff, reference_diff, qualified_type_diff, enum_diff, class_or_union_diff, class_diff, base_diff, scope_diff, fn_parm_diff, function_type_diff, function_decl_diff, type_decl_diff, typedef_diff, translation_unit_diff}::has_local_changes): Adjust to return an enum change_kind, rather than just a bool. (has_local_type_change_only): Define new functions. (has_basic_type_change_only): Use the new has_local_type_change_only function and the new overload for is_diff_of_basic_type. (is_diff_of_basic_type): Define an overload that takes a boolean flag. (is_qualified_type_diff, peel_pointer_diff, peel_reference_diff) (peel_qualified_type, peel_pointer_or_qualified_type): Define new functions. * src/abg-ir.cc (equals): In the overloads for decl_base, scope_decl, type_base, qualified_type_diff, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_type, function_decl, function_decl::parameter, class_or_union, class_decl::base_spec and class_decl, properly set the new abigail::ir::{LOCAL_CHANGE_KIND, LOCAL_NON_TYPE_CHANGE_KIND, LOCAL_TYPE_CHANGE_KIND} bits. (types_have_similar_structure): Peel qualified types and typedefs off, first thing. (peel_qualified_or_typedef_type): Define new function. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt: Adjust. * tests/data/test-diff-filter/libtest45-basic-type-change-report-{0,1}.txt: New reference test reports. * tests/data/test-diff-filter/libtest45-basic-type-change-v{0,1}.so: New input test binaries. * tests/data/test-diff-filter/test45-basic-type-change-v{0,1}.cc: Source code of the input test binaries above. * tests/data/Makefile.am: Add the new test file above to source distribution. * tests/test-diff-filter.cc: Add the test input above to the test harness. 2018-05-18 Dodji Seketeli Improve detection of local *type* changes * include/abg-fwd.h (is_type_decl): Declare new overload for type_base*. (types_have_similar_structure): Declare new function. * src/abg-comparison.cc (class_or_union_diff::priv::count_filtered_changed_dm): Even when looking at local changes only, do not forget to count nodes that were filtered out. * src/abg-ir.cc (types_have_similar_structure): Define new function. (is_type_decl): Define new overload for type_base*. (is_enum_type): (equals): In the overload for var_decl, use the new types_have_similar_structure function to detect local (type) changes. * src/abg-reporter-priv.cc (represent): In the overload for var_decl, use the diff::has_local_changes function to detect local changes, now that we can better detect local changes. * tests/data/test-diff-filter/test44-anonymous-data-member-report-1.txt: Adjust. * tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise. 2018-05-16 Dodji Seketeli Remove references, arrays and fn parms from leaf diff nodes * src/abg-comparison.cc (leaf_diff_node_marker_visitor::visit_begin): Do not mark references, array and fn parms diff nodes as leaf nodes. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt: Adjust. 2018-05-23 Dodji Seketeli Fix typo in tests/runtestdefaultsupprs.py * tests/runtestdefaultsupprs.py.in: Fix typo. 2018-05-17 Dodji Seketeli Update ChangeLog * ChangeLog: Update this file automatically by running the "make update-changelog" command. 2018-05-17 Dodji Seketeli Update NEWS file for 1.3 release * NEWS: Update for 1.3. 2018-05-16 Dodji Seketeli Don't bail because "rpm" issued an error * src/abg-tools-utils.cc (get_dsos_provided_by_rpm): Do not fail when the rpm command issues an error. Rather rely on the presence of a valid output or not. Also, make sure to filter out error outputs so that they don't appear in the general output of tools using this function. 2018-05-16 Dodji Seketeli Handle cases where no python2 interpreter is found * configure.ac: When no python2 is found and only python3 is found, then use python3. 2018-05-16 Dodji Seketeli Use the correct python interpreter in runtestdefaultsupprs.py * configure.ac: Make the PYTHON environemnt variable usable in auto-generated files. * tests/runtestdefaultsupprs.py.in: Use the python interpreter detected by configure. 2018-05-16 Dodji Seketeli Use the dynamically selected python for Koji configure tests * configure.ac: Use the python interpreter that was selected by the configure script for the Koji version test. 2018-05-14 Dodji Seketeli Sort the output of the leaf reporter * include/abg-comparison.h (diff_ptrs_type): Define new typedef. * src/abg-comparison-priv.h (sort_string_diff_ptr_map): Declare new function. * src/abg-comparison.cc (sort_string_diff_sptr_map): Update comment. (sort_string_diff_ptr_map): Define new function. * src/abg-leaf-reporter.cc (report_diffs): Sort the diff nodes before reporting about them. * tests/data/test-diff-suppr/test36-leaf-report-0.txt: Adjust. 2018-05-14 Dodji Seketeli Show data member offsets in bytes too * src/abg-reporter-priv.cc (represent): In the overload for var_diff_sptr, use the function show_offset_or_size, rather than emit_num_value. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Adjust. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Adjust. * tests/data/test-diff-filter/test44-anonymous-data-member-report-0.txt: Adjust. * tests/data/test-diff-filter/test44-anonymous-data-member-report-1.txt: Adjust. 2018-05-09 Dodji Seketeli Initial support of anonymous data members * include/abg-comparison.h (is_class_or_union_diff) (is_anonymous_class_or_union_diff): Declare new functions. * include/abg-fwd.h (is_class_type): Declare new overload for type_or_decl_base&. (is_data_member): Declare new overload for decl_base*. (is_anonymous_data_member) (anonymous_data_member_to_class_or_union) (get_class_or_union_flat_representation) (data_member_has_anonymous_type): Declare new functions. (is_at_class_scope): Return the class or union scope. * include/abg-ir.h (var_decl::get_qualified_name): New virtual data member which overloads decl_base::get_qualified_name. * src/abg-comparison.cc (is_class_or_union_diff) (is_anonymous_class_or_union_diff): Define new functions (leaf_diff_node_marker_visitor::visit_begin): Don't mark anonymous class or union diff nodes as diff nodes. * src/abg-ir.cc (is_data_member): Define new overload for decl_base*. (is_class_type, is_union_type): Define new overload for type_or_decl_base&. (is_anonymous_data_member) (anonymous_data_member_to_class_or_union) (get_class_or_union_flat_representation) (data_member_has_anonymous_type): Define new function overloads. (var_decl::get_qualified_name): Define new virtual member function. (is_at_class_scope): Return the class or union scope. (var_decl::get_pretty_representation): Support anonymous data members. (equals): In the overload for class_or_union_diff, mark data member textual representation changes as local changes. * src/abg-reporter-priv.cc (represent): In the overload for var_diff, support changes to anonymous data members. * src/abg-leaf-reporter.cc (leaf_reporter::report): Report sorted -- by offset -- data member changes before the ones that are sorted by other things. * tests/data/test-diff-filter/libtest44-anonymous-data-member-v{0,1}.so: New binary test input * tests/data/test-diff-filter/test44-anonymous-data-member-report-{0,1}.txt: New reference test outputs. * tests/data/test-diff-filter/test44-anonymous-data-member-v{0,1}.c: Source code of the new binary test output above. * tests/data/Makefile.am: Add the new test files above to the source distribution. * tests/data/test-annotate/libtest23.so.abi: Adjust test reference output. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Likewise. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise. 2018-04-20 Dodji Seketeli Represent sizes and offsets in bytes and hexadecimal values * doc/manuals/abidiff.rst: Add documentation for the new --show-bits, --show-bytes, --show-hex and --show-dec options. * doc/manuals/abipkgdiff.rst: Likewise. * doc/manuals/kmidiff.rst: Likewise. * include/abg-comparison.h (diff_context::{show_hex_values, show_offsets_sizes_in_bits}): Declare new member functions. * src/abg-comparison-priv.h (diff_context::priv::{hex_values_, show_offsets_sizes_in_bits_}): Declare new data members. (diff_context::priv::priv): Initialize them. * src/abg-comparison.cc (diff_context::{show_hex_values, show_offsets_sizes_in_bits}): Define new member functions. * src/abg-default-reporter.cc (default_reporter::report): Adjust the call to maybe_report_diff_for_symbol. * src/abg-leaf-reporter.cc (leaf_reporter::report): Likewise. * src/abg-reporter-priv.h (convert_bits_to_bytes) (maybe_convert_bits_to_bytes, emit_num_value, show_offset_or_size) (show_numerical_change): Declare new functions. (maybe_report_diff_for_symbol): Take a diff_context in parameter. * src/abg-reporter-priv.cc (convert_bits_to_bytes, emit_num_value) (maybe_convert_bits_to_bytes, show_numerical_change) (show_offset_or_size): Define new functions. (represent): In the overload for method_decl, var_decl, use the new emit_num_value function. (represent_data_member): Use the new show_offset_or_size function. (maybe_show_relative_offset_change): Use the new convert_bits_to_bytes, diff_context::show_offsets_sizes_in_bits, emit_num_value functions. (maybe_show_relative_offset_change): Likewise. (report_size_and_alignment_changes): Use the new emit_num_value and show_numerical_change functions. (maybe_report_diff_for_symbol): Tak a diff_context in argument. Use the new show_numerical_change function. * tests/test-diff-filter.cc (in_out_spec): Add a new entry to test hexa and bytes output. * tools/abidiff.cc (options::{show_hexadecimal_values, show_offsets_sizes_in_bits}): New data members. (options::options): Initialize them. (display_usage): New help strings for the new --show{bytes,bits,hex,dec} options. (parse_command_line): Parse the new --show{bytes,bits,hex,dec} options. (set_diff_context_from_opts) Set the diff context wrt hex and bytes values. * tools/abipkgdiff.cc (options::{show_hexadecimal_values, show_offsets_sizes_in_bits}): New data members. (options::options): Initialize them. (display_usage): New help strings for the new --show{bytes,bits,hex,dec} options. (set_diff_context_from_opts): Set the diff context wrt hex and bytes values. (parse_command_line): Parse the new --show{bytes,bits,hex,dec} options. * tools/kmidiff.cc (options::{show_hexadecimal_values, show_offsets_sizes_in_bits}): New data members. (options::options): Initialize them. (display_usage):New help strings for the new --show{bytes,bits,hex,dec} options. (parse_command_line): Parse the new --show{bytes,bits,hex,dec} options. (set_diff_context): Set the diff context wrt hex and bytes values. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: New reference test output. * tests/data/Makefile.am: Add the new reference test output above to source distribution. * tests/data/test-abicompat/test0-fn-changed-report-0.txt: Adjust. * tests/data/test-abicompat/test0-fn-changed-report-2.txt: Likewise. * tests/data/test-abicompat/test5-fn-changed-report-0.txt: Likewise. * tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise. * tests/data/test-abicompat/test6-var-changed-report-0.txt: Likewise. * tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise. * tests/data/test-abicompat/test7-fn-changed-report-0.txt: Likewise. * tests/data/test-abicompat/test7-fn-changed-report-1.txt: Likewise. * tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise. * tests/data/test-abicompat/test8-fn-changed-report-0.txt: Likewise. * tests/data/test-abicompat/test9-fn-changed-report-0.txt: Likewise. * tests/data/test-abidiff/test-PR18791-report0.txt: Likewise. * tests/data/test-abidiff/test-qual-type0-report.txt: Likewise. * tests/data/test-abidiff/test-struct0-report.txt: Likewise. * tests/data/test-abidiff/test-struct1-report.txt: Likewise. * tests/data/test-abidiff/test-var0-report.txt: Likewise. * tests/data/test-diff-dwarf/test0-report.txt: Likewise. * tests/data/test-diff-dwarf/test1-report.txt: Likewise. * tests/data/test-diff-dwarf/test10-report.txt: Likewise. * tests/data/test-diff-dwarf/test11-report.txt: Likewise. * tests/data/test-diff-dwarf/test13-report.txt: Likewise. * tests/data/test-diff-dwarf/test21-redundant-fn-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test22-changed-parm-c-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test26-added-parms-before-variadic-report.txt: Likewise. * tests/data/test-diff-dwarf/test27-local-base-diff-report.txt: Likewise. * tests/data/test-diff-dwarf/test3-report.txt: Likewise. * tests/data/test-diff-dwarf/test32-fnptr-changes-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test33-fnref-changes-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test34-pr19173-libfoo-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test36-ppc64-aliases-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test37-union-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test39-union-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test40-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test8-report.txt: Likewise. * tests/data/test-diff-dwarf/test9-report.txt: Likewise. * tests/data/test-diff-filter/test0-report.txt: Likewise. * tests/data/test-diff-filter/test01-report.txt: Likewise. * tests/data/test-diff-filter/test1-report.txt: Likewise. * tests/data/test-diff-filter/test10-report.txt: Likewise. * tests/data/test-diff-filter/test11-report.txt: Likewise. * tests/data/test-diff-filter/test13-report.txt: Likewise. * tests/data/test-diff-filter/test14-0-report.txt: Likewise. * tests/data/test-diff-filter/test14-1-report.txt: Likewise. * tests/data/test-diff-filter/test15-0-report.txt: Likewise. * tests/data/test-diff-filter/test15-1-report.txt: Likewise. * tests/data/test-diff-filter/test16-report-2.txt: Likewise. * tests/data/test-diff-filter/test16-report.txt: Likewise. * tests/data/test-diff-filter/test17-0-report.txt: Likewise. * tests/data/test-diff-filter/test17-1-report.txt: Likewise. * tests/data/test-diff-filter/test2-report.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-0.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt: Likewise. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt: Likewise. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-1.txt: Likewise. * tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt: Likewise. * tests/data/test-diff-filter/test3-report.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise. * tests/data/test-diff-filter/test32-ppc64le-struct-change-report0.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt: Likewise. * tests/data/test-diff-filter/test37-report-0.txt: Likewise. * tests/data/test-diff-filter/test39/test39-report-0.txt: Likewise. * tests/data/test-diff-filter/test42-leaf-report-output-0.txt: Likewise. * tests/data/test-diff-filter/test6-report.txt: Likewise. * tests/data/test-diff-filter/test9-report.txt: Likewise. * tests/data/test-diff-pkg/dirpkg-1-report-1.txt: Likewise. * tests/data/test-diff-pkg/dirpkg-3-report-1.txt: Likewise. * tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Likewise. * tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt: Likewise. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise. * tests/data/test-diff-pkg/symlink-dir-test1-report0.txt: Likewise. * tests/data/test-diff-pkg/tarpkg-0-report-0.txt: Likewise. * tests/data/test-diff-pkg/tarpkg-1-report-0.txt: Likewise. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Likewise. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-7.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test11-add-data-member-report-0.txt: Likewise. * tests/data/test-diff-suppr/test12-add-data-member-report-0.txt: Likewise. * tests/data/test-diff-suppr/test12-add-data-member-report-2.txt: Likewise. * tests/data/test-diff-suppr/test13-suppr-through-pointer-report-0.txt: Likewise. * tests/data/test-diff-suppr/test13-suppr-through-pointer-report-1.txt: Likewise. * tests/data/test-diff-suppr/test14-suppr-non-redundant-report-0.txt: Likewise. * tests/data/test-diff-suppr/test14-suppr-non-redundant-report-1.txt: Likewise. * tests/data/test-diff-suppr/test15-suppr-added-fn-report-0.txt: Likewise. * tests/data/test-diff-suppr/test15-suppr-added-fn-report-1.txt: Likewise. * tests/data/test-diff-suppr/test15-suppr-added-fn-report-5.txt: Likewise. * tests/data/test-diff-suppr/test16-suppr-removed-fn-report-0.txt: Likewise. * tests/data/test-diff-suppr/test16-suppr-removed-fn-report-2.txt: Likewise. * tests/data/test-diff-suppr/test17-suppr-added-var-report-0.txt: Likewise. * tests/data/test-diff-suppr/test17-suppr-added-var-report-2.txt: Likewise. * tests/data/test-diff-suppr/test17-suppr-added-var-report-5.txt: Likewise. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-0.txt: Likewise. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-2.txt: Likewise. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-5.txt: Likewise. * tests/data/test-diff-suppr/test2-struct-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test23-alias-filter-report-0.txt: Likewise. * tests/data/test-diff-suppr/test23-alias-filter-report-2.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-1.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-10.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-12.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-14.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-16.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-4.txt: Likewise. * tests/data/test-diff-suppr/test25-typedef-report-0.txt: Likewise. * tests/data/test-diff-suppr/test26-loc-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test26-loc-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-3.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-6.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-8.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test30-report-0.txt: Likewise. * tests/data/test-diff-suppr/test31-report-1.txt: Likewise. * tests/data/test-diff-suppr/test32-report-0.txt: Likewise. * tests/data/test-diff-suppr/test32-report-1.txt: Likewise. * tests/data/test-diff-suppr/test33-report-0.txt: Likewise. * tests/data/test-diff-suppr/test35-leaf-report-0.txt: Likewise. * tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise. * tests/data/test-diff-suppr/test4-local-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test4-local-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-8.txt: Likewise. * tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: Likewise. * tests/data/test-diff-suppr/test8-redundant-fn-report-1.txt: Likewise. * tests/data/test-diff-suppr/test9-changed-parm-c-report-0.txt: Likewise. * tests/data/test-diff-suppr/test9-changed-parm-c-report-1.txt: Likewise. 2018-04-18 Dodji Seketeli Use absolute builddir paths in automake test files * tests/runtestdefaultsupprs.py.in: Use abs_top_builddir rather than top_builddir. 2018-04-10 Jonathan Wakely Use std::string::substr instead of appending single chars * src/abg-ini.cc (trim_white_space): Use std::string::substr instead of appending single chars. 2018-04-10 Jonathan Wakely Rename misleading remove_trailing_white_spaces functions * include/abg-tools-utils.h (trim_white_space): Renamed remove_trailing_white_spaces into this. * src/abg-ini.cc (trim_white_space): Likewise. * src/abg-tools-utils.cc (get_dsos_provided_by_rpm): Adjust. 2018-04-10 Jonathan Wakely Remove unused local set variables * src/abg-tools-utils.cc (get_dsos_provided_by_rpm): Remove unsed set variable. * tools/abipkgdiff.cc (maybe_create_public_dso_sonames_set): Likewise. 2018-04-10 Jonathan Wakely Remove assertion with side-effects * src/abg-tools-utils.cc (get_dsos_provided_by_rpm): Fix std::string::sbustr and remove assert with side effect. 2018-04-13 Dodji Seketeli Misc style changes * src/abg-comparison.cc (category_propagation_visitor): Adjust comment. * src/abg-default-reporter.cc (default_reporter::report_local_function_type_changes): Remove useless new line. 2018-04-13 Dodji Seketeli Update tests for the "better leaf mode redundancy management" patchset * tests/data/test-abidiff-exit/test1-voffset-change-report1.txt: Adjust. * tests/data/test-abidiff/test-PR18791-report0.txt: Likewise. * tests/data/test-abidiff/test-enum0-report.txt: Likewise. * tests/data/test-abidiff/test-enum1-report.txt: Likewise. * tests/data/test-diff-filter/test1-report.txt: Likewise. * tests/data/test-diff-filter/test14-0-report.txt: Likewise. * tests/data/test-diff-filter/test15-0-report.txt: Likewise. * tests/data/test-diff-filter/test17-0-report.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-0.txt: Likewise. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt: Likewise. * tests/data/test-diff-filter/test3-report.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test32-ppc64le-struct-change-report0.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt: Likewise. * tests/data/test-diff-filter/test4-report.txt: Likewise. * tests/data/test-diff-filter/test41-report-0.txt: Likewise. * tests/data/test-diff-filter/test42-leaf-report-output-0.txt: Likewise. * tests/data/test-diff-pkg/dirpkg-3-report-1.txt: Likewise. * tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Likewise. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: Likewise. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt: Likewise. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Likewise. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt: Likewise. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test13-suppr-through-pointer-report-1.txt: Likewise. * tests/data/test-diff-suppr/test14-suppr-non-redundant-report-0.txt: Likewise. * tests/data/test-diff-suppr/test14-suppr-non-redundant-report-1.txt: Likewise. * tests/data/test-diff-suppr/test15-suppr-added-fn-report-1.txt: Likewise. * tests/data/test-diff-suppr/test15-suppr-added-fn-report-2.txt: Likewise. * tests/data/test-diff-suppr/test15-suppr-added-fn-report-3.txt: Likewise. * tests/data/test-diff-suppr/test15-suppr-added-fn-report-4.txt: Likewise. * tests/data/test-diff-suppr/test16-suppr-removed-fn-report-1.txt: Likewise. * tests/data/test-diff-suppr/test16-suppr-removed-fn-report-2.txt: Likewise. * tests/data/test-diff-suppr/test16-suppr-removed-fn-report-3.txt: Likewise. * tests/data/test-diff-suppr/test16-suppr-removed-fn-report-4.txt: Likewise. * tests/data/test-diff-suppr/test17-suppr-added-var-report-1.txt: Likewise. * tests/data/test-diff-suppr/test17-suppr-added-var-report-2.txt: Likewise. * tests/data/test-diff-suppr/test17-suppr-added-var-report-3.txt: Likewise. * tests/data/test-diff-suppr/test17-suppr-added-var-report-4.txt: Likewise. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-1.txt: Likewise. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-3.txt: Likewise. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-4.txt: Likewise. * tests/data/test-diff-suppr/test2-struct-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test2-struct-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test25-typedef-report-1.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-1.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-2.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-5.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-3.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-6.txt: Likewise. * tests/data/test-diff-suppr/test30-report-1.txt: Likewise. * tests/data/test-diff-suppr/test34-report-0.txt: Likewise. * tests/data/test-diff-suppr/test35-leaf-report-0.txt: Likewise. * tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-9.txt: Likewise. * tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: Likewise. 2018-04-13 Dodji Seketeli [abipkgdiff]: in leaf mode we always show redundant changes * tools/abipkgdiff.cc (set_diff_context_from_opts): diff_context::show_leaf_changes_only automatically makes us show redundant changes. So do not try to show redundant changes in that case. 2018-04-13 Dodji Seketeli When we say an a change was reported earlier give its source location * src/abg-reporter-priv.h (RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2) (RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3): Report the location of the artifact. 2018-04-13 Dodji Seketeli Avoid reporting an enum change if it has already been reported * src/abg-default-reporter.cc (default_reporter::report): In the enum_diff overload, do not report a node if it's always been reported; rather, say that it has been reported earlier. 2018-04-13 Dodji Seketeli Always show redundant changes in leaf mode * src/abg-comparison.cc (diff_context::show_leaf_changes_only): Show redundant changes when in leaf mode. 2018-04-12 Dodji Seketeli Fix leaf report of class data member changes * src/abg-leaf-reporter.cc (leaf_reporter::report): In the class_or_uion_diff overload, do not emit the data member changes header twice. * src/abg-reporter-priv.cc (represent): In the var_diff_sptr overload, show data member changes when its textual representation changed. 2018-04-12 Dodji Seketeli Only show leaf type changes in the leaf type changes section * src/abg-leaf-reporter.cc (report_type_changes_from_diff_maps): Split this out from leaf_reporter::report_changes_from_diff_maps and make it report only about leaf *type* changes. (leaf_reporter::report_changes_from_diff_maps): Use the new report_type_changes_from_diff_maps function. (leaf_reporter::report): In the overload for corpus_diff, use the new report_type_changes_from_diff_maps function, instead of the report_changes_from_diff_maps function. 2018-04-12 Dodji Seketeli Don't filter out typedef changes with redundant underlying type changes * src/abg-default-reporter.cc (default_reporter::report): In the overload for typedef, report underlying type changes een when they are redundant, if the whole typedef change needs to be repoted. 2018-04-12 Dodji Seketeli Improve function changes reporting in leaf and default mode * src/abg-default-reporter.cc (default_reporter::report): In the overload for fn_parm_diff, consider that parameter type changes are never redundant. * src/abg-ir.cc (equals): In the overload for function_type, consider that if the textual representation of the function return type or a function parameter changed, then that's a local change for the current instance of function_type. Likewise, in the overload for function_decl, consider that a change in the textual representation of the function_decl is a local change. Likewise, in the overload of function_decl::parameter, consider that a change in the textual representation of the parameter type is a local change. * src/abg-leaf-reporter.cc (leaf_reporter::report): Report leaf changes to functions. 2018-04-12 Dodji Seketeli Better handle category propagation of pointer changes * src/abg-comparison.cc (leaf_diff_node_marker_visitor::visit_begin): Do not consider local pointer changes as being leaf changes. (suppression_categorization_visitor::visit_end): Allow propagation of the SUPPRESSED_CATEGORY category to pointer diff nodes. (redundancy_marking_visitor::visit_end): Allow propagation of the REDUNDANT_CATEGORY category to pointer diff nodes. * src/abg-ir.cc (equals): In the pointer_type_def overload, consider changes where the textual representation of the pointed-to changed as being local to the pointer type. * src/abg-leaf-reporter.cc (leaf_reporter::report): In the pointer_diff overload, report the change in the textual representation of the pointer. 2018-04-11 Dodji Seketeli Fix meaning of "harmless name change" to avoid overfiltering * include/abg-ir.h (enum_has_non_name_change): Declare new * function. Make it a friend of class enum_type_decl. * src/abg-comp-filter.cc (has_harmless_name_change): A typedef name change cannot be harmless if the textual representation of the underlying type changes too. Also, use the new enum_has_non_name_change to tighten the harmless name change definition for an enum. * src/abg-default-reporter.cc (default_reporter::report_local_typedef_changes): If the name of the typedef changed, report it no matter what. * src/abg-ir.cc (enum_has_non_name_change): Define new function. 2018-04-11 Dodji Seketeli Do not mark "distinct" diff nodes as being redundant * include/abg-comp-filter.h (is_mostly_distinct_diff): Declare new function. * include/abg-fwd.h (peel_typedef_pointer_or_reference_type): Take a boolean to decide to peel qualified types or not. * src/abg-comp-filter.cc (is_mostly_distinct_diff): Define this function. * src/abg-comparison.cc (redundancy_marking_visitor::visit_begin): Do not mark distinct_diff nodes as being redundant. * src/abg-ir.cc (peel_typedef_pointer_or_reference_type): Implement taking a boolean to decide to peel qualified types or not. 2018-04-11 Dodji Seketeli Overhaul of the report diff stats summary * include/abg-comparison.h (corpus_diff::diff_stats::{num_leaf_type_changes, num_leaf_type_changes_filtered_out, net_num_leaf_type_changes, num_leaf_func_changes, num_leaf_func_changes_filtered_out, net_num_leaf_func_changes, num_leaf_var_changes, num_leaf_var_changes_filtered_out, net_num_leaf_var_changes}): Declare new member functions. * src/abg-comparison-priv.h (corpus_diff::priv::count_leaf_type_changes): Declare new member function. * src/abg-comparison.cc (corpus_diff::diff_stats::net_num_leaf_changes): Fix comment. (corpus_diff::diff_stats::{num_leaf_type_changes, num_leaf_type_changes_filtered_out, net_num_leaf_type_changes, num_leaf_func_changes, num_leaf_func_changes_filtered_out, net_num_leaf_func_changes, num_leaf_var_changes, num_leaf_var_changes_filtered_out, net_num_leaf_var_changes}): Define these member functions. (do_count_diff_map_changes): Move this macro out of ... (corpus_diff::priv::count_leaf_changes): ... this. Also, use the new function corpus_diff::priv::count_leaf_type_changes. (corpus_diff::priv::count_leaf_type_changes): Splitted this out of the previous corpus_diff::priv::count_leaf_changes function. (corpus_diff::priv::apply_filters_and_compute_diff_stats): Account for (filtered) types, functions and variables, in a leaf change manner. (corpus_diff::priv::emit_diff_stats): Emit a better stat summary that takes into account leaf-changed types, functions and variables. 2018-04-10 Dodji Seketeli Do not show decl-only-to-def changes in the leaf reporter * include/abg-comp-filter.h (has_class_decl_only_def_change): Declare this function. * src/abg-comp-filter.cc (has_class_decl_only_def_change): Make this function be non-static. * src/abg-comparison.cc (leaf_diff_node_marker_visitor::visit_begin): Use it to avoid marking class-decl-only-def changes as being leaf changes. * libtest43-decl-only-def-change-leaf-report-v0.so: New test input file. * libtest43-decl-only-def-change-leaf-report-v1.so: Likewise. * test43-decl-only-def-change-leaf-report-0.txt: Likewise. * test43-decl-only-def-change-leaf-report-v0.cc: Likewise. * test43-decl-only-def-change-leaf-report-v1.cc: Likewise. * tests/test-diff-filter.cc (in_out_specs): Run the test over the new test input. * tests/data/Makefile.am: Add the new test materials to source distribution. 2018-03-30 Dodji Seketeli Don't possibly forget type definition when reading a CorpusGroup * src/abg-dwarf-reader.cc (add_or_update_class_type): Look for declaration-only-ness to determine if we've already seen the same type from the main corpus of the group. 2018-03-30 Dodji Seketeli Don't crash when invoking kmidiff with no debug info root dir * tools/kmidiff.cc (main): Do not crash on empty debug info root dir. 2018-03-30 Dodji Seketeli Do not enable fedabipkgdiff tests if fedabipkgdiff itself is disabled * tests/Makefile.am: Run runtestfedabipkgdiff{py3?}.py only if fedabipkgdiff itself is enabled. 2018-03-25 Chenxiong Qi Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 * configure.ac: Add new option --enable-python3. Add new test runner file tests/runtestdefaultsupprs-py3 and tests/runtestfedabipkgdiffpy3.sh. Add required six Python module. * tests/Makefile.am: Add new test files tests/runtestdefaultsupprspy3.sh and tests/runtestfedabipkgdiffpy3.sh accordingly. * tests/mockfedabipkgdiff.in: Convert print statement to six.print_. Replace call to function filter with list comprehension. Replace basestring with six.string_types. * tests/runtestdefaultsupprspy3.sh.in: New shell script to run test runtestdefaultsupprs with Python 3. * tests/runtestdefaultsupprs.py.in: Repalce a few tabs with proper number of spaces which is detected by Python 3 interpreter. * tests/runtestfedabipkgdiffpy3.sh.in: New shell script to run test runtestfedabipkgdiff with Python 3. * tests/runtestfedabipkgdiff.py.in: Use python from env in shebang instead of a fixed path to a Python interpreter. * tools/fedabipkgdiff: Globally replace print statement with a function call to print which is available by importing print_function from __future__ module. Use six.print_ to output string to stderr instead. Convert function call to map to for-loop. (cmp_nvr): Change argument to handle a Koji build mapping instead of only the nvr. (Brew.listBuilds): use the new cmp_nvr to sort builds. 2018-03-29 Dodji Seketeli Detect the presence of 'rpm' as it's now needed by abipkgdiff * configure.ac: Detect that the 'rpm' is present. Otherwise, disable rpm support. 2018-03-28 Dodji Seketeli Make abipkgdiff avoid comparing private DSOs from RPMs * doc/manuals/abipkgdiff.rst: Add documentation for the new --private-dso option. * include/abg-tools-utils.h (execute_command_and_get_output) (execute_command_and_get_output, remove_trailing_white_spaces): Declare new functions. * src/abg-tools-utils.cc (execute_command_and_get_output) (get_dsos_provided_by_rpm, remove_trailing_white_spaces): Define new functions. * tests/test-diff-pkg.cc (in_out_specs): Add the new --private-dso option where it makes sense. * tools/abipkgdiff.cc (options::compare_private_dsos): Add new data member. (options::options): Initialize it. (package::public_dso_sonames_): Add new data member. (package::public_dso_sonames): Add new accessors pair. (display_usage): Add a help string for the new --private-dso option. (maybe_create_public_dso_sonames_set) (must_compare_public_dso_only): Define new static functions. (create_maps_of_package_content): Call the new maybe_create_public_dso_sonames_set. Skip packages which SONAME is not in the set of public SONAMES. (parse_command_line): Parse the new --private-dso option. 2018-03-16 Dodji Seketeli Skip changes to function *types* in the leaf reporter * src/abg-leaf-reporter.cc (leaf_reporter::report_changes_from_diff_maps): Don't report function type changes. 2018-03-16 Dodji Seketeli Report change locations in leaf reports * src/abg-leaf-reporter.cc (report_diffs): Report the source location of the diff. * tests/data/test-diff-filter/test42-leaf-report-output-0.txt: Update test reference output. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt: Likewise. * tests/data/test-diff-suppr/test35-leaf-report-0.txt: Likewise. * tests/data/test-diff-suppr/test36-leaf-report-0.txt: Likewise. 2018-03-06 Dodji Seketeli Make the "upload-release" target be usable in parallel * Makefile.am: Re-arrange the upload-release target to make it usable with 'make upload-release -jN'. 2018-03-06 Dodji Seketeli Bump version number to 1.3 * configure.ac: Now that 1.2 is out of the door, bump version number to 1.3 2018-03-06 Dodji Seketeli Update website for 1.2 * doc/website/mainpage.txt: Update link to download the tarball, for 1.2. 2018-03-06 Dodji Seketeli Update ChangeLog for 1.2 * ChangeLog: Updated automatically by running make update-changelog. 2018-03-06 Dodji Seketeli Update NEWS file for 1.2 * NEWS: Update for 1.2 2018-01-31 Dodji Seketeli Fix typo in abipkgdiff documenation * doc/manuals/abipkgdiff.rst: Fix a typo 2018-01-31 Dodji Seketeli Update abipkgdiff documentation wrt suppression specifications * doc/manuals/abipkgdiff.rst: Mention the .abignore file that is read by the tool and considered as a suppression specification file. 2018-03-06 Dodji Seketeli Fix indentation in the DWARF reader * src/abg-dwarf-reader.cc (build_subrange_type): Fix indentation. 2018-03-02 Dodji Seketeli Fix the output indentation of abidiff --help * tools/abidiff.cc (display_usage): Fix indentation of the help string for the --drop-private-types option. 2018-03-02 Dodji Seketeli Bug 22913 - Correctly de-duplicate pointers to anonymous structs inside a given * src/abg-dwarf-reader.cc (pointer_or_qual_die_of_anonymous_class_type) (die_is_qualified_type): Define new functions. (compare_dies): If pointers, reference or qualified type have an anonymous struct as their underlying type, then we need to structurally compare the underlying anonymous struct. * tests/data/test-diff-dwarf/libtest43-PR22913-v{0,1}.so: New binary test input files. * tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: New reference output of the comparison of the two binaries above. * tests/data/test-diff-dwarf/test43-PR22913-v{0,1}.c: Source code of the binaries above. * tests/test-diff-dwarf.cc (in_out_specs): Make the test harness compare the two binaries above. * tests/data/Makefile.am: Add the new test files above to the source distribution. 2018-02-27 Dodji Seketeli Initial support for Ada ranges * include/abg-ir.h (type_maps::subrange_types): Declare new accessors. (is_ada_language, is_subrange_type): Declare new functions. (class array_type_def::subrange_type): Make this extend type_base and decl_base. (array_type_def::subrange_type::{get_language, operator==, get_pretty_representation, traverse}): Declare new member functions. (ir_node_visitor::visit_begin): Add new overloads for array_type::def::subrange_type. * src/abg-dwarf-reader.cc (build_subrange_type): Define new static function. (build_subranges_from_array_type_die): Cleanup the parameters of this function. (build_array_type): Adjust. (build_ir_node_from_die): Support free-form DW_TAG_subrange_type. (read_context::odr_is_relevant): Handle Ada. (die_qualified_type_name): Support DW_TAG_subrange_type. (die_pretty_print_type): Likewise. Make the handling of DW_TAG_subrange_type use die_qualified_type_name. Adjust the use of build_subranges_from_array_type_die. (get_scope_die): a DW_TAG_array_type cannot be a scope. Rather, it's its scope that can be a scope. * src/abg-ir.cc (type_maps::priv::subrange_types_): New data member. (type_maps::empty): Adjust. (type_maps::subrange_types): Define new accessors. (is_ada_language, is_subrange_type): Define new functions. (odr_is_relevant): Support Ada. (maybe_update_types_lookup_map): Add an overload for array_type_def::subrange_type. In the decl_base_sptr overload, add support for the array_type_def::subrange_type type. (struct array_type_def::subrange_type::priv::location_): Remove this as it's now carried by the parent decl_base type. (array_type_def::subrange_type::subrange_type): Adjust. Take an environement pointer, a name, an underlying type and a language. (array_type_def::subrange_type::{g,s}et_underlying_type): Define new accessors. (array_type_def::subrange_type::{get_language, get_pretty_representation, traverse}): Define new member functions. (array_type_def::subrange_type::as_string): Add a representation for Ada. (equals): Define new overload for array_type_def::subrange_type. (array_type_def::subrange_type::operator==): Define three new overloads for decl_base, type_base and subrange_type. (array_type_def::subrange_type::operator!=): Define new operator. (get_type_representation): In the overload for array_type_def, support Ada. (array_type_def::get_language): Define new member function. (ir_node_visitor::visit_{begin,end}): Define new overloads for array_type_def::subrange_type. * src/abg-reader.cc (build_subrange_type): Adjust documentation. Support the new 'id', 'name', and 'type-id' properties. * src/abg-writer.cc (write_array_subrange_type): Define new static function. (write_array_type_def): Use the new write_array_subrange_type function. * tests/data/test-abidiff/test-PR18166-libtirpc.so.abi: Adjust. * tests/data/test-annotate/libtest23.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-annotate/test7.so.abi: Likewise. * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Likewise. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise. * tests/data/test-read-dwarf/libtest23.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test7.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-write/test25.xml: Likewise. 2018-02-06 Dodji Seketeli Add newline at end of version string display * tools/abidiff.cc (main): Add a newline at the end of the version string line. * tools/abidw.cc (main): Likewise. * tools/abipkgdiff.cc (main): Likewise. * tools/kmidiff.cc (main): Likewise. 2018-01-31 Dodji Seketeli Bump version number to 1.2 * configure.ac: Bump version number to 1.2 2018-01-25 Dodji Seketeli Update website for 1.1 * doc/website/mainpage.txt: Update for 1.1. 2018-01-25 Dodji Seketeli Update ChangeLog for 1.1 * ChangeLog: Automatically update using 'make update-changelog'. 2018-01-25 Dodji Seketeli Update NEWS file for 1.1 * NEWS: Update for 1.1 2018-01-29 Dodji Seketeli Correctly link with pthread * src/Makefile.am: use -lpthread, not -pthread. 2018-01-18 Dodji Seketeli Skip class types with changed names in leaf reports * include/abg-comp-filter.h (has_class_or_union_type_name_change) (has_basic_or_class_type_name_change): Declare new functions. * include/abg-comparison.h (is_diff_of_class_or_union_type): Likewise. * src/abg-comp-filter.cc (has_class_or_union_type_name_change) (has_basic_or_class_type_name_change): * src/abg-comparison.cc (leaf_diff_node_marker_visitor::visit_begin): Use the new filtering::has_basic_or_class_type_name_change to test if a basic or class/union diff type carries a name change. Update comment. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt: Adjust. 2018-01-16 Dodji Seketeli Only consider local changes when filtering subtype changes * src/abg-comparison-priv.h (class_or_union_diff::priv::{count_filtered_subtype_changed_dm, count_filtered_changed_dm}): Take an additional flag. * src/abg-comparison.cc (class_or_union_diff::priv::{count_filtered_subtype_changed_dm, count_filtered_changed_dm}): Likewise. When asked, only consider local changes. * src/abg-leaf-reporter.cc (leaf_reporter::report): Consider reporting only the *net local* data member changes. 2018-01-16 Dodji Seketeli Make kmidiff show the wrong option when it complains about it * tools/kmidiff.cc (parse_command_line): Don't forget to record the wrong option in options::wrong_option. 2018-01-12 Dodji Seketeli Fix typo in abipkgdiff.cc * tools/abipkgdiff.cc (compare_task::perform): Fix a typo in a comment. 2018-01-12 Dodji Seketeli Suppress duplicates when listing package content * tools/abipkgdiff.cc (maybe_update_package_content): Rename maybe_update_vector_of_package_content into this. Take a set of strings, rather than a vector of strings. (get_interesting_files_under_dir): Adjust. 2018-01-12 Dodji Seketeli Fix symlinks paths handling in abipkgdiff * include/abg-tools-utils.h (real_path): Declare new function. * src/abg-tools-utils.cc (real_path): Define it. * tools/abipkgdiff.cc (package::convert_path_to_relative): Use the new real_path function to consider real path (where symlinks are resolved) of the extraction directory of the package. (get_interesting_files_under_dir): Similarly, use the new real_path function to consider the real path of the directory we are exploring. 2018-01-12 Dodji Seketeli Fix logic in common_prefix * src/abg-tools-utils.cc (common_prefix): Fix logic error. 2018-01-12 Dodji Seketeli abipkgdiff --verbose shouldn't trigger --fail-no-dbg * tools/abipkgdiff.cc (compare): In the overload for elf_files, separate the effect of --verbose from the one of --fail-no-dbg. 2018-01-10 Dodji Seketeli Bug 22692 - Consider Java as a language that supports the ODR * include/abg-ir.h (is_java_language): Declare new function. * src/abg-dwarf-reader.cc (odr_is_relevant): Adjust to consider that Java also respects the ODR. * src/abg-ir.cc (is_java_language): Define new function. (odr_is_relevant): Adjust to consider that Java also respects the ODR. 2018-01-09 Dodji Seketeli Fix version revision number printing in tools --help option * configure.ac: Properly set the VERSION_REVISION macro. * include/abg-tools-utils.h (get_library_version_string): Declare new function. * src/abg-tools-utils.cc (get_library_version_string): Define the new function. (gen_suppr_spec_from_kernel_abi_whitelist): Dis-ambiguate the use of the 'config' type. * tools/abicompat.cc (main): Use the new abigail::tools_utils::get_library_version_string function. * tools/abidiff.cc (main): Likewise. * tools/abidw.cc (main): Likewise. * tools/abilint.cc (main): Likewise. * tools/abipkgdiff.cc (main): Likewise. * tools/abisym.cc (main): Likewise. * tools/kmidiff.cc (main): Likewise. 2018-01-09 Dodji Seketeli Bug 22684 - Add --d{1,2} options to kmidiff * doc/manuals/kmidiff.rst: Add documentation for the new options. * tools/kmidiff.cc (options::{di_root_path{1,2}): New data members. (display_usage): Add help strings for the new options. (parse_command_line): Parse the new options. (main): Pass the debug info root directory to build_corpus_group_from_kernel_dist_under. 2018-01-08 Dodji Seketeli Update copyright notice for all source files * update-copyright.sh: New sed-based script to update the year in the copyright notice. * include/abg-comp-filter.h: Updated the year in the copyright notice. * include/abg-comparison.h: Likewise. * include/abg-config.h: Likewise. * include/abg-corpus.h: Likewise. * include/abg-diff-utils.h: Likewise. * include/abg-dwarf-reader.h: Likewise. * include/abg-fwd.h: Likewise. * include/abg-hash.h: Likewise. * include/abg-ini.h: Likewise. * include/abg-interned-str.h: Likewise. * include/abg-ir.h: Likewise. * include/abg-libxml-utils.h: Likewise. * include/abg-libzip-utils.h: Likewise. * include/abg-reader.h: Likewise. * include/abg-reporter.h: Likewise. * include/abg-sptr-utils.h: Likewise. * include/abg-suppression.h: Likewise. * include/abg-tools-utils.h: Likewise. * include/abg-traverse.h: Likewise. * include/abg-viz-common.h: Likewise. * include/abg-viz-dot.h: Likewise. * include/abg-viz-svg.h: Likewise. * include/abg-workers.h: Likewise. * include/abg-writer.h: Likewise. * src/abg-comp-filter.cc: Likewise. * src/abg-comparison-priv.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus-priv.h: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-default-reporter.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-internal.h: Likewise. * src/abg-ir-priv.h: Likewise. * src/abg-ir.cc: Likewise. * src/abg-leaf-reporter.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-reporter-priv.cc: Likewise. * src/abg-reporter-priv.h: Likewise. * src/abg-sptr-utils.cc: Likewise. * src/abg-suppression-priv.h: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. * tests/print-diff-tree.cc: Likewise. * tests/test-abicompat.cc: Likewise. * tests/test-abidiff-exit.cc: Likewise. * tests/test-abidiff.cc: Likewise. * tests/test-alt-dwarf-file.cc: Likewise. * tests/test-core-diff.cc: Likewise. * tests/test-diff-dwarf-abixml.cc: Likewise. * tests/test-diff-dwarf.cc: Likewise. * tests/test-diff-filter.cc: Likewise. * tests/test-diff-pkg.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tests/test-diff2.cc: Likewise. * tests/test-ir-walker.cc: Likewise. * tests/test-lookup-syms.cc: Likewise. * tests/test-read-dwarf.cc: Likewise. * tests/test-read-write.cc: Likewise. * tests/test-types-stability.cc: Likewise. * tests/test-utils.cc: Likewise. * tests/test-utils.h: Likewise. * tests/test-write-read-archive.cc: Likewise. * tools/abiar.cc: Likewise. * tools/abicompat.cc: Likewise. * tools/abidiff.cc: Likewise. * tools/abidw.cc: Likewise. * tools/abilint.cc: Likewise. * tools/abipkgdiff.cc: Likewise. * tools/abisym.cc: Likewise. * tools/binilint.cc: Likewise. * tools/kmidiff.cc: Likewise. 2017-12-15 Dodji Seketeli Bug 22437 - Make fedabipkgdiff use all debug info RPMs of a sub-RPM * tools/fedabipkgdiff (RPM::get_all_debuginfo_rpms): Define new member function. (RPM::generate_comparison_halves): The ancillary debuginfo RPM of a given RPM now has a list type; there can be more than one debuginfo RPM associated to a given RPM, especially if the RPM is a devel one. (format_debug_info_pkg_options): Define new function. (abipkgdiff): Use the new function above. 2017-12-15 Dodji Seketeli Improve comments wording in fedabipkgdiff * tools/fedabipkgdiff (class RPM): Fix wording. (RPM::__init__): Likewise. 2017-12-11 Dodji Seketeli Update & cleanup the tools manuals summary * doc/manuals/abidw.rst: Use the same header structure as or the other tools manual. * doc/manuals/kmidiff.rst: Likewise. * doc/manuals/libabigail-tools.rst: Add the new kmidiff tool to the summary. 2017-12-01 Dodji Seketeli Bug 22488 - Make abipkgdiff handle different binaries with same basename * include/abg-tools-utils.h (string_suffix) (sorted_strings_common_prefix): Declare new functions. (dir_name): Take a new keep_separator_at_end parameter at the end. * src/abg-tools-utils.cc (dir_name): Take a new keep_separator_at_end parameter at the end. Add a comment for it and update. (string_suffix, sorted_strings_common_prefix): Define new functions. (common_prefix): Define new static function. * tools/abipkgdiff.cc (get_interesting_files_under_dir): Forward declare this pre-existing static function. (package::{common_paths_prefix_, elf_file_paths_}): New data members. (package::{common_paths_prefix, elf_file_paths, convert_path_to_relative, convert_path_to_unique_suffix, load_elf_file_paths}): New member functions. (create_maps_of_package_content): Use the new package::{load_elf_file_paths, convert_path_to_unique_suffix} functions. (compare_prepared_userspace_packages): Show relative paths of package elements in reported. * tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt: Update test ouptut. * tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt: Likewise. 2017-12-01 Dodji Seketeli Fully report diagnostic about alternate debug info file not found * src/abg-dwarf-reader.cc (status_to_diagnostic_string): Report textual diagnostic for the STATUS_ALT_DEBUG_INFO_NOT_FOUND case too. 2017-11-27 Dodji Seketeli Bug 22436 - make abipkgdiff accept several debuginfo packages * doc/manuals/abipkgdiff.rst: Document the fact that --d{1,2} can be provided several times on the command line. * tools/abipkgdiff.cc (options::debug_packages{1,2}): Rename the debug_package{1,2} data members into this, and make them be vector of strings, rather than just strings. (package::debug_info_packages_): Renamed package::debug_info_package_ into this and make it be a vector of package_sptr, rather than just a package_sptr. (package::debug_info_packages): Renamed the method package::debug_info_package into this and -- for the getter overload -- make it return a vector of package_sptr, rather than just a package_sptr. Likewise for the setter overload. Add a non-const getter overload. (package::erase_extraction_directories) (extract_package_and_map_its_content): Adjust. (extract_rpm, extract_deb): Do not erase the content of the extraction directory (if it was pre-existing) prior to extracting the RPM/deb into it. (pkg_extraction::pkgs): Renamed pkg_extraction::pkg into this and make it be a vector of packages, rather than just a package. (pkg_extraction::pkg_extraction): Adjust to take a package_sptr rather than just a package. Add an overload to take a vector of packages_sptr. (pkg_extraction::perform): Extract the vector of package that the task is not responsible for, not just one random package. (extract_package_and_map_its_content): Adjust. (prepare_packages): Take smart pointers to package rather than just packages. Adjust accordingly. (compare_prepared_package): Make the overload that takes two packages to take two smart pointers of packages. (compare): Make the overload that takes two package take two package_sptr. (parse_command_line): Parse having --d{1,2} several times for a given input package. (main): Take several debug info packages for one input file. * include/abg-tools-utils.h (split_string): Declare ... * src/abg-tools-utils.cc (split_string): ... new function. * tests/data/test-diff-pkg/libxfce4ui-debuginfo-4.12.1-8.fc27.ppc64.rpm: Add a new RPM test input file. * tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-ok-0.txt: new reference output file. * tests/data/Makefile.am: Add the new test input files above to source distribution. * tests/test-diff-pkg.cc (in_out_spec): Add new test entry to specify two debug info packages for one input package. (test_task::perform): Support having several debug info package paths in the IntOutSpec::{first,second}_in_debug_package_path data member. The debug info packages paths are separated by either a white space or commas. 2017-11-22 Dodji Seketeli Update version number to 1.1 * configure.ac: Update version number to 1.1 2017-11-22 Dodji Seketeli Bug 22076 - Disable fedabipkgdiff for old koji clients * configure.ac: Try to invoke the koji.read_config method. If it fails then disable the fedabipkgdiff feature. 2017-11-22 Dodji Seketeli Update the release text template after 1.0 * release-text-template.txt: Update some wording. 2017-11-22 Dodji Seketeli Update website for 1.0 * doc/website/mainpage.txt: Update after 1.0 release. 2017-11-21 Dodji Seketeli Update NEWS file for 1.0 * NEWS: Update for 1.0 2017-11-21 Dodji Seketeli Automatically Update ChangeLog for 1.0 * ChangeLog: Automatically update for 1.0 2017-11-21 Dodji Seketeli Bug 22438 - Emit a clear message when debug info is not found * include/abg-dwarf-reader.h (enum abigail::dwarf_reader::status): Add a new STATUS_ALT_DEBUG_INFO_NOT_FOUND enumerator there. (refers_to_alt_debug_info): Declare new function. * src/abg-dwarf-reader.cc (read_corpus_from_elf): Detect when the referred-to alternate debug info file is not found and flip the STATUS_ALT_DEBUG_INFO_NOT_FOUND bit of the status accordingly. If the debug info was found but not the alternate debug info, then do not try to read the debug info at all. (refers_to_alt_debug_info): Define new function. * tools/abidiff.cc (handle_error): Define new static function. (main): Use it, rather than handling errors preventing libabigail from reading the corpus on a case by case basis. tools/abipkgdiff.cc (compare): Handle the case where no alternate debug info was found. * tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64-self-report-0.txt: New test output reference. * tests/data/test-diff-pkg/libxfce4ui-devel-4.12.1-8.fc27.ppc64.rpm: New test input RPM. * tests/data/test-diff-pkg/libxfce4ui-devel-debuginfo-4.12.1-8.fc27.ppc64.rpm: Likewise. * tests/data/Makefile.am: Add the new test files above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add a new test case from the new input files above. 2017-11-13 Dodji Seketeli Support systems where fts.h can't be used with _FILE_OFFSET_BITS set * configure.ac: Detect if we are on a system where fts.h cannot be included with _FILE_OFFSET_BITS defined. If that is the case, then define the BAD_FTS macro. * src/abg-tools-utils.cc: If BAD_FTS is defined then include fts.h with _FILE_OFFSET_BITS not defined (that is, before config.h) but then make sure that open and fopen are 64 bits aware. * tools/abipkgdiff.cc: Likewise. 2017-11-08 Dodji Seketeli Edit the NEWS file a tiny little bit for 1.0 * NEWS: Cleanup. 2017-11-06 Dodji Seketeli Automatically Update ChangeLog for 1.0 * ChangeLog: Update this file by running "make update-changelog". 2017-11-06 Dodji Seketeli Update NEWS file for 1.0 changes * NEWS: Update for 1.0 changes 2017-11-06 Dodji Seketeli Bump version number to 1.0 * configure.ac: Bump version number to 1.0 2017-11-08 Dodji Seketeli Don't make system headers depend on config.h * tools/abipkgdiff.cc: Include config.h after system headers and before libabigail's headers. 2017-11-02 Dodji Seketeli Wire the --no-show-locs option to abidw * doc/manuals/abidw.rst: Update the documentation. * tests/test-annotate.cc: Now that --no-show-locs has an effect on the ABIXML output, let's not use it here, because it changes the output and we don't want that. * tools/abidw.cc (display_usage): Fix a typo in the help string. (load_corpus_and_write_abixml): Set the "show-locs" option to the write_context object that we use. 2017-11-02 Dodji Seketeli Allow setting options to instances of xml_writer::write_context * include/abg-writer.h (create_write_context, set_show_locs) (set_annotate): Declare new functions. (write_corpus, write_corpus_group): Remove the output stream and the annotate parameters as these can be retrieved from the context. * src/abg-writer.cc (write_context::m_show_locs): New data member. (write_context::write_context): Initialize it. (write_context::{get_show_locs, set_show_locs}): Add new member functions. (write_location): Take a write_context, rather than an output stream. From the context, we detect if the user did set the "show loc" option and act accordingly. Write the second overload in terms of the first one. (create_write_context, set_show_locs, set_annotate): Define new functions. (write_type_decl, write_qualified_type_def) (write_pointer_type_def, write_reference_type_def) (write_array_type_def, write_enum_type_decl, write_typedef_decl) (write_var_decl, write_function_decl) (write_class_decl_opening_tag, write_union_decl_opening_tag) (write_type_tparameter, write_non_type_tparameter) (write_function_tdecl, write_class_tdecl): Adjust the invocation of write_location. (write_corpus, write_corpus_group): Remove the output stream and the annotate parameters as these can be retrieved from the context. Adjust. * tools/abidw.c: (load_corpus_and_write_abixml): Create a write_context object, set the 'annotate' option to it and use that object to actually write out the corpus. 2017-11-02 Dodji Seketeli Remove useless vertical space from src/abg-writer.cc * src/abg-writer.cc (class write_context): Remove useless vertical space near the end of the class definition. 2017-10-16 Dodji Seketeli Add a --suppressions option to fedabipkgdiff * tools/fedabipkgdiff (abipkgdiff): If a suppression file was provided, pass it to the underlying abipkgdiff tool. (build_commandline_args_parser): Parse the new --suppressions option. * docs/manuals/fedabipkgdiff.rst: Add documentation for the new --suppressions option. 2017-10-16 Dodji Seketeli Handle exceptions when global_config is not yet set in fedabipkgdiff * tools/fedabipkgdiff: When handling an exception, if the global_config object is not yet set then just let the exception through. 2017-10-11 Dodji Seketeli Fix a indentation warning from GCC 7.2.1 * tools/abipkgdiff.cc (compare): In the overload of elf_file, fix a mis-indentation pointed out by a GCC 7.2.1 warning. 2017-10-11 Dodji Seketeli Cleanup a switch-case logic to avoid a GCC 7.2.1 warning * src/abg-dwarf-reader.cc (die_qualified_type_name): Cleanup a switch case to make the form support more what we meant, and shut down a GCC 7.2.1 warning. 2017-10-09 Mark Wielaard Fix -Wmisleading-indentation warning in abg-leaf-reporter.cc. * src/abg-leaf-reporter.cc (leaf_reporter::report): Fix misleading indentation. 2017-10-06 Dodji Seketeli Add --impacted-changes option to kmidiff * doc/manuals/kmidiff.rst: Document the new --impacted-changes option. * tools/kmidif.cc (options::show_impacted_interfaces): Add new data member. (options::options): Initialize the new data member to false. (display_usage): Add a description string for the new --impacted-changes option. (parse_command_line): Parse the new --impacted-changes option. (set_diff_context): Update the 'show-impacted-interface' property accordingly. 2017-10-04 Dodji Seketeli Add --full-impact option to kmidiff * doc/manuals/kmidiff.rst: Add documentation for the new --full-impact|-f option. * tools/kmidiff.cc (options::leaf_changes_only): Add new data member. (option::option): Initialize the new data member. (display_usage): Add a documentation string for the new --full-impact|-f option. (parse_command_line): Parse the new --full-impact|-f option. (set_diff_context): Set the diff context appropriately. 2017-09-18 Dodji Seketeli Add a --leaf-changes-only option to abipkgdiff * doc/manuals/abipkgdiff.rst: Add documentation for the new --leaf-change-only, --impacted-interfaces and --full-impact options. * tools/abipkgdiff.cc (options::{leaf_changes_only, show_impacted_interfaces, show_full_impact_report): Add new data members. (options::options): Initialize them. (display_usage): Add help strings for the new --leaf-change-only, --impacted-interfaces and --full-impact|-f options. (set_diff_context_from_opts): Set the diff context for the 'leaf-changes-only' and 'show-impacted-interfaces' flags. (parse_command_line): Parse the --leaf-change-only, --impacted-interfaces and --full-impact options. Handle the case where the --linux-kernel-abi-whitelist|-w option is given a whitelist *package*. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt: New test output reference. * tests/test-diff-pkg.cc (in_out_spec): Compare data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64.rpm and data/test-diff-pkg/spice-server-0.12.8-1.el7.x86_64.rpm with the new --leaf-changes-only and --impacted-interfaces options, using the new output reference above. * tests/data/Makefile.am: Add the new test material to source distribution. 2017-08-02 Dodji Seketeli Initial implementation of a --leaf-changes-only option to abidiff * doc/manuals/abidiff.rst: Add documentation the new --leaf-changes-only and --impacted-interfaces options. * src/abg-leaf-reporter.cc: New file. * src/Makefile.am: Add the new src/abg-leaf-reporter.cc file to source distribution. * include/abg-fwd.h (get_var_size_in_bits) (function_decl_is_less_than): Declare new functions. (get_name): Add new overload for type_or_decl_base*. * include/abg-ir.h (struct type_or_decl_hash, type_or_decl_equal) (type_or_decl_base_comp): Define new types. (artifact_sptr_set_type, artifact_ptr_set_type): Define new typedefs. * include/abg-comp-filter.h: Update copyright year. (has_basic_type_name_change): Add new function declaration. * src/abg-comp-filter.cc (decl_name_changed): Take a type_or_decl_base rather than just a decl. Add an overload for diff*. (has_basic_type_name_change): Define new function. * include/abg-comparison.h: Update copyright year. (string_diff_ptr_map): Define this new typedef. (class diff_maps): Define this new class. (diff_context::{set_corpora}): Remove this member function. (diff_context::{set_corpus_diff, get_corpus_diff, show_leaf_changes_only, show_impacted_interfaces, forbid_visiting_a_node_twice_per_interface}): Declare these new member functions. (diff_node_visitor::priv_): Add a new pimpl data member. (diff_node_visitor::{diff_node_visitor, get_visiting_kind, set_visiting_kind}): Turn these into out-of-line member functions. (diff_node_visitor::{set,get}_current_topmost_iface_diff): Add new member functions. (class {scope_diff, function_type_diff, corpus_diff}): Add class leaf_reporter as a friend. (corpus_diff::mark_leaf_diff_nodes, get_leaf_diffs): Declare new member functions. (diff::{visiting_a_node_twice_is_forbidden_per_interface, parent_interface_node}): Define new member functions. (is_diff_of_basic_type): Return a type_decl_diff* rather than just a bool. (is_enum_diff, is_array_diff, is_function_type, is_typedef_diff) (is_corpus_diff): Declare new functions. (corpus_diff::diff_stats::{num_leaf_changes, num_leaf_changes_filtered_out, net_num_leaf_changes}): Add new member functions. (is_distinct_diff): Declare new function. * include/abg-reporter.h: Forward-declare "class diff_maps". (reporter_base::diff_to_be_reported): Declare a new virtual member function. (reporter_base::{report_local_typedef_changes, report_local_reference_type_changes, report_local_function_type_changes}): Declare new member functions. (class leaf_reporter): Define new type. * src/abg-comparison-priv.h (struct diff_hash, diff_equal): Define new types. (diff_artifact_set_map_type): Define new typedef. (diff_context::priv::{first_corpus_, second_corpus_}): Remove these data members. (diff_context::priv::{corpus_diff_, leaf_changes_only_, reset_visited_diffs_for_each_interface_, show_impacted_interfaces_}): Add new data members. (diff_context::priv::priv): Adjust. (corpus_diff::priv::{leaf_diffs_, parent_interface_}): Add new data member. (corpus_diff::diff_stats::priv::{num_leaf_changes, num_leaf_changes_filtered_out}): Add new data members. (corpus_diff::priv::count_leaf_changes): Define new member function. (sort_artifacts_set, get_fn_decl_or_var_decl_diff_ancestor) (is_diff_of_global_decls): Declare new functions. (function_comp::operator()): Factorize this out into the new function abigail::ir::function_decl_is_less_than. * src/abg-ir.cc (get_var_size_in_bits) (function_decl_is_less_than): Define new functions. (get_name): Define new overload for type_or_decl_base*. * src/abg-comparison.cc (is_enum_diff, is_typedef_diff) (is_array_diff, is_function_type_diff, is_corpus_diff) (is_distinct_diff, sort_artifacts_set, is_diff_of_global_decls): Define new functions. (is_union_diff): Fix comment. (diff_context::forbid_visiting_a_node_twice_per_interface): Define new member functions. (diff_context::set_corpus_diff, get_corpus_diff) (diff_context::show_leaf_changes_only) (diff_context::visiting_a_node_twice_is_forbidden_per_interface) (diff_context::show_impacted_interfaces): Define new member functions. (diff_context::get_reporter): Create the reporter that matches what diff_context::show_leaf_changes_only says. (diff_node_visitor::priv): Define a new type. (diff_node_visitor::{diff_node_visitor, get_visiting_kind, set_visiting_kind, or_visiting_kind, set_current_topmost_iface_diff, get_current_topmost_iface_diff}): Define new out-of-line member functions. (struct diff_maps::priv): Define new type. (diff_maps::{diff_maps, get_type_decl_diff_map, get_type_decl_diff_map, get_enum_diff_map, get_class_diff_map, get_union_diff_map, get_typedef_diff_map, get_array_diff_map, get_function_type_diff_map, get_function_decl_diff_map, get_var_decl_diff_map, get_reference_diff_map, get_fn_parm_diff_map, get_distinct_diff_map, insert_diff_node, lookup_impacted_interfaces}): Define member functions. (corpus_diff::{mark_leaf_diff_nodes, get_leaf_diffs}): Define new member functions. (struct leaf_diff_node_marker_visitor): Define new type. (corpus_diff::apply_filters_and_suppressions_before_reporting): Mark diff nodes in here. (corpus_diff::traverse): Appropriately set the current topmost interface into the visitor before visiting a diff node. (compute_diff): In the overload for corpus_sptr, adjust to reflect that we are now storing the corpus_diff in the diff context. (is_diff_of_basic_type): Return a type_decl_diff*, not just a bool. (corpus_diff::priv::count_leaf_changes): Define a new member function. (corpus_diff::diff_stats::{num_leaf_changes, num_leaf_changes_filtered_out, net_num_leaf_changes}): Define new member functions. (corpus_diff::priv::apply_filters_and_compute_diff_stats): Use the new corpus_diff::priv::count_leaf_changes to compute the number of leaf changes. (corpus_diff::priv::emit_diff_stats): Emit the report about leaf type changes when necessary. * src/abg-reporter-priv.h (report_mem_header): Declare new overload. (maybe_show_relative_offset_change,): Pass the var_diff_sptr parameter by const reference. (represent): Pass the var_diff_sptr parameter by const reference and take a new "local-only" flag. (maybe_show_relative_size_change) (maybe_report_interfaces_impacted_by_diff): Declare new functions. * src/abg-default-reporter.cc: Adjust copyright year. (default_reporter::{report_local_typedef_changes, report_local_qualified_type_changes, report_local_reference_type_changes, report_local_function_type_changes}): Define new member functions. (default_reporter::report): Adjust. Add an overload for function_type_diff&. In the overload for qualified_type_diff, if the name of the underlying type changed, do not detail the changes any further. In the overload for function_decl_diff, Adjust to use the new diff_context::get_{first, second}_corpus member function. In the overload for enum_diff, call the new maybe_report_interfaces_impacted_by_diff that is advertised below. * src/abg-reporter-priv.cc (represent): Adjust the overload for var_diff_sptr. (report_mem_header): Define new overload. (maybe_show_relative_size_change) (maybe_report_interfaces_impacted_by_diff): Define new functions. (reporter_base::diff_to_be_reported): Define new member function. (maybe_show_relative_offset_change): Pass the var_diff_sptr parameter by const reference. (represent): In the overload for var_diff_sptr, pass the var_diff_sptr parameter by reference. Take a 'local_only' flag. Iisplay type changes only if we are not displaying "local changes only". Display size changes of data members too, when in "local-only" mode. * src/abg-suppression.cc (sonames_of_binaries_match) (names_of_binaries_match): Adjust. * tools/abidiff.cc (options::{leaf_changes_only, show_impacted_interfaces}): Add new data members. (display_usage): Emit usage string for the new --leaf-changes-only and --impacted-interfaces options. (parse_command_line): Parse the new --leaf-changes-only and the --impacted-interfaces options. (set_diff_context_from_opts): Set the 'show-leaf-changes' and the 'show-impacted-interfaces' flags. * tests/data/test-diff-filter/libtest42-leaf-report-v{0,1}.so: New test input. * tests/data/test-diff-filter/test42-leaf-report-output-0.txt: New test reference output. * tests/data/test-diff-filter/test42-leaf-report-v{0,1}.cc: Source code of the new test inputs. * tests/test-diff-filter.cc (in_out_specs): Use the new test inputs above in this harness. * tests/data/test-diff-suppr/libtest35-leaf-v0.so: New test input. * tests/data/test-diff-suppr/test35-leaf-report-0.txt: New test reference output. * tests/data/test-diff-suppr/test35-leaf-v{0,1}.cc: Source code of the new test inputs. * tests/data/test-diff-suppr/test35-leaf.suppr: Suppression specification to use for the test35 test. * tests/data/test-diff-suppr/libtest36-leaf-v0.so: New test input. * tests/data/test-diff-suppr/libtest36-leaf-v1.so: Likewise. * tests/data/test-diff-suppr/test36-leaf-report-0.txt: New reference test output. * tests/data/test-diff-suppr/test36-leaf-v0.cc: Source code of test input above. * tests/data/test-diff-suppr/test36-leaf-v1.cc: Likewise. * tests/test-diff-suppr.cc (in_out_specs): Use the new test inputs above in this harness. * tests/data/Makefile.am: Add the new test inputs above to source distribution. 2017-07-17 Dodji Seketeli Allow several kinds of reports to be emitted * include/Makefile.am: Add the new abg-reporter.h header file to source distribution. * include/abg-comparison.h: Include the new abg-reporter.h header file. (diff_context::{g,s}et_reporter): Declare new accessors. ({type_diff_base, decl_diff_base, corpus_diff}::priv): Make this be a struct rather than a class. ({decl_diff_base, class_diff, scope_diff, function_type_diff, corpus_diff}): Declare default_reporter a friend class of these. * include/abg-reporter.h: New file. * src/Makefile.am: Add abg-comparison-priv.h, abg-reporter-priv.{h,cc} and abg-default-reporter.cc files to source distribution. * src/abg-comparison-priv.h: New file. * src/abg-comparison.cc (sort_enumerators) (sort_changed_enumerators, sort_data_members) (sort_string_function_ptr_map) (sort_string_function_decl_diff_sptr_map) (sort_string_var_diff_sptr_map, sort_string_elf_symbol_map) (sort_string_var_ptr_map, sort_string_data_member_diff_sptr_map) (sort_unsigned_data_member_diff_sptr_map) (sort_string_diff_sptr_map, sort_string_base_diff_sptr_map) (sort_string_base_sptr_map, sort_string_fn_parm_diff_sptr_map) (sort_string_parm_map, get_leaf_type, sort_enumerators) (sort_changed_enumerators): Make these functions non-static and move them at the beginning of the file. These functions are now declared in abg-compared-priv.h so they can be shared privately with other files in src/. (diff_context::{g,s}et_reporter): Define new accessors. ({diff_context, diff, type_diff_base, decl_diff_base, distinct_diff, pointer_diff, array_diff, reference_diff, qualified_type_diff, enum_diff, class_or_union_diff, class_diff, base_diff, scope_diff, fn_parm_diff, function_type_diff, function_decl_diff, type_decl_diff, typedef_diff, translation_unit_diff, corpus_diff::diff_stats, corpus_diff}::priv) (diff_less_than_functor, enumerator_value_comp) (changed_enumerator_comp, base_spec_comp, base_diff_comp) (data_member_diff_comp, diff_comp, fn_parm_diff_comp, parm_comp) (elf_symbol_comp, function_comp, function_decl_diff_comp) (var_diff_sptr_comp): Move these type definitions to abg-comparison-priv.h (report_size_and_alignment_changes, report_loc_info) (maybe_report_diff_for_member, maybe_report_diff_for_symbol) (represent, represent_data_member) (maybe_show_relative_offset_change, represent) (report_size_and_alignment_changes, report_loc_info) (report_name_size_and_alignment_changes, report_mem_header) (maybe_report_diff_for_member, maybe_report_diff_for_symbol) (show_linkage_name_and_aliases): Move these definitions to abg-reporter-priv.cc. ({distinct_diff, var_diff, pointer_diff, array_diff, reference_diff, qualified_type_diff, enum_diff, class_or_union_diff, class_diff, base_diff, union_diff, scope_diff, fn_parm_diff, function_type_diff, type_decl_diff, typedef_diff, corpus_diff}::report): Use the reporter object to report about the changes carried by the the current diff node. * src/abg-default-reporter.cc: New file. * src/abg-reporter-priv.h: Likewise. 2017-10-04 Dodji Seketeli Update copyright year to tools/abidiff.cc * tools/abidiff.cc: Update copyright year. 2017-10-04 Dodji Seketeli Add missing comment to type declaration * include/abg-comparison.h (struct diff_sptr_hasher): Add missing comment. 2017-10-04 Dodji Seketeli Misc style fixes in abg-writer.cc * src/abg-writer.cc (type_hasher): Add comment. (write_context::record_decl_as_emitted): Remove useless newline. 2017-10-04 Dodji Seketeli Initialize naked canonical type * src/abg-ir.cc (type_base::priv::priv): Initialize the naked canonical type data member. 2017-10-04 Dodji Seketeli [abixml writer] Use an unordered set when appropriate * src/abg-writer.cc (write_context::m_emitted_decl_only_set): Renamed m_emitted_decl_only_map into this and make the type be a set, rather than a map. (write_context::{record_decl_only_type_as_emitted, decl_only_type_is_emitted}): Adjust. 2017-09-29 Dodji Seketeli [abixml writer] Store pointers to emitted types rather than type-ids * src/abg-writer.cc (type_ptr_set_type): Declare new typedef. (writer_context::m_emitted_type_id_map): Remove this data member. (writer_context::m_emitted_type_set): Add a new data member. (writer_context::{record_type_id_as_emitted, type_id_is_emitted, clear_emitted_types_map}): Remove these member functions. (writer_context::{record_type_as_emitted, type_is_emitted}): Use the new m_emitted_type_set data member above. 2017-09-27 Dodji Seketeli Use an unordered map for canonical DIE offsets * src/abg-dwarf-reader.cc (read_context::canonical_type_die_offsets_): Renamed the canonical_type_die_vecs_ data member into this. (read_context::canonical_decl_die_offsets_): Renamed the canonical_decl_die_vecs_ data member into this. (read_context::{initialize, compute_canonical_die_offset, compute_canonical_die, get_canonical_die, get_or_compute_canonical_die, set_canonical_die_offset, get_canonical_die_offset}): Adjust. 2017-09-27 Dodji Seketeli Bug 22190 - crash in read_context::get_or_compute_canonical_die * src/abg-dwarf-reader.cc: 2017-09-27 Dodji Seketeli Remove redundant (useless) typedef declaration * src/abg-dwarf-reader.cc (dwarf_offsets_type): There are two instances of this typedef declaration, remove one. 2017-09-27 Dodji Seketeli Renamed offset_offset_map type name into offset_offset_map_type * src/abg-dwarf-reader.cc (offset_offset_map_type): Renamed offset_offset_map into this. (read_context::{primary_die_parent_map_, alternate_die_parent_map_, type_section_die_parent_map_}): Adjust the type of these data members. (read_context::{die_parent_map, type_section_die_parent_map}): Adjust the type of these member functions. (read_context::{build_die_parent_relations_under, get_parent_die}): Adjust for the type name in these functions. 2017-09-27 Dodji Seketeli Add missing newlines to kmidiff's usage strings * tools/kmidiff.cc (display_usage): Add newlines after the lines for --vmlinux1 and --vmlinux2. 2017-09-21 Dodji Seketeli 22160 - Annotate state flag unitialized in abidw * tools/abidw.cc (options::options): Initialize the annotate data member. 2017-09-18 Dodji Seketeli Don't crash on classes that differ in their virtual member fn count * src/abg-ir.cc (equals): In the overload for class_decl, when we detect that the virtual member function counts are different, get out, even when we are being asked about the kind of the change. 2017-09-18 Dodji Seketeli Avoid adding the same data member twice in the DWARF reader * src/abg-dwarf-reader.cc (add_or_update_class_type): After a we try to create a data member type, look *again* if the data member wasn't added recursively by the creation of the data member type. 2017-09-11 Mark Wielaard Bug 22075 - data_member_diff_comp forgets data members names * src/abg-comparison.cc (data_member_diff_comp): Make the comparison take the qualified name of the data member into account. Also, if the initial offset and qualified names of the data members of the diff nodes are equal, consider the offset and qualified names of the new data members. 2017-09-11 Dodji Seketeli Bug 22122 - Fail to represent 'const array' * src/abg-dwarf-reader.cc (die_is_array_type): Define new static function. (die_is_pointer_or_reference_type): Also test that the DIE can be an array. * tests/data/test-read-dwarf/PR22122-libftdc.so: New binary test input. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: New reference output. * tests/data/Makefile.am: Add the two new test files above to source distribution. * tests/test-read-dwarf.cc (in_out_specs): Run this test harness over the new test input. 2017-09-08 Dodji Seketeli Finer detection of local changes of var_decl type * src/abg-ir.cc (equals): In the var_decl overload detect size changes of type as being a local change. 2017-09-08 Dodji Seketeli Misc style fixes * include/abg-fwd.h (get_pretty_representation): Add missing white space. * src/abg-ir.cc (get_name): Fix typo in comment. 2017-09-02 Mark Wielaard readdir_r() is deprecated, use readdir(). * src/abg-tools-utils.cc (dir_is_empty): Use readdir() instead of readdir_r(). 2017-09-02 Mark Wielaard Declare eval_last_constant_dwarf_sub_expr with [u]int64_t not [s]size_t. * src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr): Declare expr_len as uint64_t and value as int64_t. 2017-08-28 Dodji Seketeli Bug 22015 - Failing to return global scope of a DIE in certain cases * src/abg-dwarf-reader.cc (get_scope_for_die): If the translation unit of the parent die hasn't yet been constructed, then return the global scope of the current translation unit. * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so: New binary test input. * tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: New reference test output. * tests/data/Makefile.am: Add the new test materials above to source distribution. * tests/test-read-dwarf.cc (in_out_specs): Add the new test input to the test suite. 2017-07-17 Dodji Seketeli Fix some make distcheck failures * tests/data/Makefile.am: Add test-diff-dwarf/test42-PR21296-libgcc.so, test-diff-dwarf/test42-PR21296-libclang.so, test-diff-dwarf/test42-PR21296-clanggcc-report0.txt to the source distribution. Also look for test-diff-filter/test39* tests inputs in the test-diff-filter/test39/ directory. 2017-07-17 Dodji Seketeli Avoid crashing when the elf file could not be read * src/abg-dwarf-reader.cc (read_context::elf_architecture_is_ppc64): Do not crash if the elf handle is nil. 2017-07-10 Dodji Seketeli Bug 21730 - Make abipkgdiff compare Linux Kernel packages as expected * include/abg-tools-utils.h (get_vmlinux_path_from_kernel_dist): Declare new function. (get_binary_paths_from_kernel_dist): Re-organize order of parameters. (file_is_kernel_package, file_is_kernel_debuginfo_package): Make the file_path parameter be const. (build_corpus_group_from_kernel_dist_under): Take an additional debug_info_root parameter. * src/abg-tools-utils.cc (file_is_kernel_package) (file_is_kernel_debuginfo_package): Const-ify the file_name parameter. (find_vmlinux_path): Define new static function. (get_binary_paths_from_kernel_dist): Re-organize the order of parameters. The debug_info_root_path parameter is now an input parameter. (get_vmlinux_path_from_kernel_dist): Define new function. (get_binary_paths_from_kernel_dist): Adjust invocation of get_binary_paths_from_kernel_dist. (build_corpus_group_from_kernel_dist_under): Take an additional debug_info_root parameter. * tools/abidw.cc (load_kernel_corpus_group_and_write_abixml): Adjust invocation to build_corpus_group_from_kernel_dist_under. * tools/abipkgdiff.cc (create_maps_of_package_content): Don't map the content of a Linux Kernel package. (compare_prepared_userspace_packages) (compare_prepared_linux_kernel_packages, compare_prepared): Define new functions. (compare): Use the new functions above here. * tools/kmidiff.cc (print_kernel_dist_binary_paths_under): Adjust the invocation of get_binary_paths_from_kernel_dist. (main): Adjust the invocation of build_corpus_group_from_kernel_dist_under. Make sure that a kernel package is accompanied by a debug info package. 2017-07-11 Dodji Seketeli Support up to two --wp options for abipkgdiff * doc/manuals/abipkgdiff.rst: Update the documentation to say that --wp can be provided twice, but not more than that. * tools/abipkgdiff.cc (options::kabi_whitelist_packages): Rename kabi_whitelist_package to this, and make be of vector type. (package::erase_extraction_directories): Erase the white list package extracted data. (maybe_handle_kabi_whitelist_pkg, parse_command_line): Adjust. (main): Make sure there is no more than 2 --wp on the command line. Associate a white list package to each kernel package on the command line. 2017-07-11 Dodji Seketeli Fix support of the --wp option of abipkgdiff * tools/abipkgdiff.cc (parse_command_line): Consider the absolute path of the package given in argument to --wp. 2017-07-11 Dodji Seketeli Use shorter lines in abipkgdiff.cc * tools/abipkgdiff.cc (parse_command_line): Use shorter lines here. 2017-07-11 Dodji Seketeli Add missing space in abipkgdiff error message * tools/abipkgdiff.cc (extract_package): Add missing space here. 2017-07-11 Dodji Seketeli Replace --lkaw with -w and --lkaw-pkg with --wp * doc/manuals/abipkgdiff.rst: Adjust the documentation. * tools/abipkgdiff.cc (display_usage): Adjust the usage string. (parse_command_line): Parse -w instead of --lkaw and --wp insteadof --lkaw-pkg. 2017-07-11 Dodji Seketeli speed up class type lookup in a corpus * src/abg-ir.cc (lookup_class_type): In the overload that looks for a class name denoted by an interned_string in the corpus, do not look for the class in the translation units when the type wasn't found in the type map of the corpus. (maybe_update_types_lookup_map): Remove the erase_if_exists_already parameter and the code that uses it. (lookup_class_type_through_translation_units): Remove this function that is now useless. 2017-07-06 Dodji Seketeli Bug 21644 - abipkgdiff does not emit diagnostics about comparison errors * include/abg-dwarf-reader.h (status_to_diagnostic_string): Declare new function. * src/abg-dwarf-reader.cc (status_to_diagnostic_string): Define new function. * tools/abipkgdiff.cc (compare): Take a new detailed_error_status parameter. (compare_task::perform): Get the details of the error, in case the status of the comparison is ABIDIFF_ERROR. 2017-07-05 Dodji Seketeli Bug 21153 - abipkgdiff reports undetermined interface subtype changes * src/abg-ir.cc (get_name_of_qualified_type): A noop-qualified type has an empty string as reprsentation for its qualifier. * src/abg-dwarf-reader.cc (die_qualified_type_name): Adjust to comply with what is done in get_name_of_qualified_type. Adjust comment too. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64--libcdio-0.94-2.fc26.x86_64-report.1.txt: New reference test output. * tests/data/test-diff-pkg/libcdio-0.94-1.fc26.x86_64.rpm: New test binary input. * tests/data/test-diff-pkg/libcdio-0.94-2.fc26.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/libcdio-debuginfo-0.94-1.fc26.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/libcdio-debuginfo-0.94-2.fc26.x86_64.rpm Likewise. * tests/data/Makefile.am: Add the new test inputs to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Make this test harness run on the new test inputs above. 2017-07-03 Dodji Seketeli Fix typo in comments * src/abg-ir.cc (type_base::get_canonical_type_for): Fix a typo in a command. 2017-07-03 Dodji Seketeli Fix a typo when reporting size change wrt a decl-only class * src/abg-comparison.cc (report_size_and_alignment_changes): Fix typo. 2017-07-03 Dodji Seketeli Better handle decl-only classes being different from their definition * src/abg-comparison.cc (function_decl_diff::report): Don't report possible vtable changes between a decl-only class and its definition. * src/abg-ir.cc (type_base::get_canonical_type_for): Consider that a decl-only class is different from its definition when comparing types for the purpose of type canonicalization. (equals): In the class_or_union overload, only consider the global decl_only_class_equals_definition() property to know when to consider that a decl-only class is different from its definition when comparing two classes. * src/abg-reader.cc (build_class_decl): Read the size property of a class, even if it's a decl-only class. * src/abg-writer.cc (write_class_decl_opening_tag): Write size property of types even if the types are decl-only classes. * tests/data/test-annotate/test13-pr18894.so.abi: Adjust. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2017-06-28 Dodji Seketeli Don't add empty translation unit to corpus * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): A translation unit DIE that has no child DIE shall not be added to the current ABI corpus. 2017-06-27 Dodji Seketeli Bug 21631 - Forgot a "break" statement in stv_to_elf_symbol_visibility * src/abg-dwarf-reader.cc (stv_to_elf_symbol_visibility): Add a missing break statement. 2017-06-26 Dodji Seketeli Bug 21630 - A this pointer DIE can be const * src/abg-dwarf-reader.cc (die_this_pointer_is_const): If the DIE is not a DW_TAG_pointer_type then don't crash. 2017-06-23 Dodji Seketeli Bug 21629 - equivalent DIEs must be of the same DIE source * src/abg-dwarf-reader.cc (compare_dies): Don't propagate a canonical DIE to a DIE that comes from a different source. 2017-06-22 Dodji Seketeli Bug 21627 - Libabigail doesn't consider translation unit compile dir *if* that translation unit has already been seen in the current binary, instead of creating a new one altogether. This patch doesn't carry a regression test as the problem was found while running the https://pagure.io/libabigail-selfcheck/blob/master/f/selfcheck.py script over the Fedora 25 critpath packages. The patch does however update existing reference outputs of existings tests where appropriate. * include/abg-ir.h (translation_unit::{get_compilation_dir_path, set_compilation_dir_path, get_absolute_path}): * src/abg-corpus.cc (corpus::add): Use the new translation_unit::get_absolute_path() as the key for the tu path -> tu map. * src/abg-dwarf-reader.cc (read_context::resolve_declaration_only_classes): Use the new translation_unit::get_absolute_path(). (build_translation_unit_and_add_to_ir): Set the compilation directory of the translation unit. * src/abg-ir-priv.h (translation_unit::priv::{comp_dir_path_, abs_path_}): * src/abg-ir.cc (translation_unit::set_path): Update comment. (translation_unit::{get_compilation_dir_path, set_compilation_dir_path, get_absolute_path}): Define new member functions. * src/abg-reader.cc (read_translation_unit): Take the new 'comp-dir-path' attribute into account. * src/abg-writer.cc (write_translation_unit): Emit the new 'comp-dir-path' attribute. * tests/data/test-annotate/libtest23.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Adjust. * tests/data/test-annotate/test0.abi: Adjust. * tests/data/test-annotate/test1.abi: Adjust. * tests/data/test-annotate/test13-pr18894.so.abi: Adjust. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-annotate/test17-pr19027.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-annotate/test2.so.abi: Adjust. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-annotate/test21-pr19092.so.abi: Adjust. * tests/data/test-annotate/test3.so.abi: Adjust. * tests/data/test-annotate/test4.so.abi: Adjust. * tests/data/test-annotate/test5.o.abi: Adjust. * tests/data/test-annotate/test6.so.abi: Adjust. * tests/data/test-annotate/test7.so.abi: Adjust. * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Adjust. * tests/data/test-read-dwarf/libtest23.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust. * tests/data/test-read-dwarf/test0.abi: Adjust. * tests/data/test-read-dwarf/test1.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test2.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test3.so.abi: Adjust. * tests/data/test-read-dwarf/test4.so.abi: Adjust. * tests/data/test-read-dwarf/test5.o.abi: Adjust. * tests/data/test-read-dwarf/test6.so.abi: Adjust. * tests/data/test-read-dwarf/test7.so.abi: Adjust. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2017-05-04 Dodji Seketeli Misc style fixes * src/abg-dwarf-reader.cc (read_context::{die_wip_classes_map, die_wip_function_types_map, types_to_canonicalize, tu_die_imported_unit_points_map, die_parent_map, load_kernel_symbol_table}): Add missing space to statement. (get_parent_die): Likewise. (build_enum_type): Fix typo in comment. (e_machine_to_string, get_version_definition_for_versym) (lookup_public_function_symbol_from_elf) (lookup_public_variable_symbol_from_elf) (lookup_data_tag_from_dynamic_segment, die_is_declaration_only) (die_is_reference_type, die_function_type_is_method_type): Fix indentation. (read_context::{resolve_declaration_only_classes, fixup_functions_with_no_symbols, load_symbol_maps_from_symtab_section, load_dt_soname_and_needed, load_elf_architecture, load_elf_properties, maybe_adjust_address_for_exec_or_dyn, maybe_adjust_fn_sym_address, address_is_in_opd_section, load_elf_architecture, build_die_parent_maps}): Likewise. (op_pushes_constant_value, op_manipulates_stack): Use the dwarf_expr_eval_context::push method. (op_is_control_flow, die_return_and_parm_names_from_fn_type_die) (die_function_signature, die_pretty_print_type) (get_default_array_lower_bound) (build_translation_unit_and_add_to_ir, build_enum_type) (add_or_update_class_type, build_function_type) (build_function_decl, build_ir_node_from_die) (lookup_public_function_symbol_from_elf): Fix indentation. * src/abg-ir.cc (maybe_update_types_lookup_map): Remove useless space. 2017-05-31 Dodji Seketeli Fix doc glitch in abidiff.rst * doc/manuals/abidiff.rst: Fix glitch. 2017-06-12 Dodji Seketeli Symbols with the same zero value are not aliases * src/abg-dwarf-reader.cc (load_symbol_maps_from_symtab_section): Do not consider symbols with zero value as being aliases. * tests/data/test-diff-filter/test20-inline-report-0.txt: Adjust. * tests/data/test-diff-filter/test20-inline-report-1.txt: Likewise. * test-diff-filter/test41-PR21486-abg-writer.gcc.o: New test binary input. * tests/data/test-diff-filter/test41-PR21486-abg-writer.llvm.o: Likewise. * tests/data/Makefile.am: Add the new test material to source distribution. * tests/test-diff-filter.cc (in_out_specs): Run the test harness on the new test input above. * tests/data/test-diff-dwarf/test5-report.txt: Adjust. * tests/data/test-diff-filter/test9-report.txt: Adjust. * tests/data/test-diff-filter/test20-inline-report-0.txt: Adjust. * tests/data/test-diff-filter/test20-inline-report-1.txt: Adjust. 2017-06-12 Dodji Seketeli Support ELF symbol visibility property * include/abg-ir.h (enum elf_symbol::visibility): Define new enum. (elf_symbol::{elf_symbol, create}): Take a visibility parameter. (elf_symbol::{set, get}_visibility): Declare new accessors. (string_to_elf_symbol_binding): Declare new function. * src/abg-ir.cc (elf_symbol::priv::visibility_): New data member. (elf_symbol::priv::priv): Adjust. (elf_symbol::elf_symbol): Take a visibility parameter. (elf_symbol::create): Likewise (elf_symbol::{s,g}et_visibility): Define new accessors. (elf_symbol::is_public): Adjust. (operator<<(std::ostream&, elf_symbol::visibility)): Define new operator. (string_to_elf_symbol_visibility): Define new function. * src/abg-dwarf-reader.cc (stv_to_elf_symbol_visibility): Define new static function. (lookup_symbol_from_sysv_hash_tab) (lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_symtab) (create_default_var_sym, create_default_fn_sym): Adjust. * src/abg-reader.cc (read_elf_symbol_binding): Define new function. (build_elf_symbol): Adjust. * src/abg-writer.cc (write_elf_symbol_visibility): Define new function. * tests/data/test-annotate/libtest23.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Adjust. * tests/data/test-annotate/test0.abi: Adjust. * tests/data/test-annotate/test1.abi: Adjust. * tests/data/test-annotate/test13-pr18894.so.abi: Adjust. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-annotate/test17-pr19027.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-annotate/test2.so.abi: Adjust. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-annotate/test21-pr19092.so.abi: Adjust. * tests/data/test-annotate/test3.so.abi: Adjust. * tests/data/test-annotate/test4.so.abi: Adjust. * tests/data/test-annotate/test5.o.abi: Adjust. * tests/data/test-annotate/test6.so.abi: Adjust. * tests/data/test-annotate/test7.so.abi: Adjust. * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Adjust. * tests/data/test-read-dwarf/libtest23.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust. * tests/data/test-read-dwarf/test0.abi: Adjust. * tests/data/test-read-dwarf/test1.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test2.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test3.so.abi: Adjust. * tests/data/test-read-dwarf/test4.so.abi: Adjust. * tests/data/test-read-dwarf/test5.o.abi: Adjust. * tests/data/test-read-dwarf/test6.so.abi: Adjust. * tests/data/test-read-dwarf/test7.so.abi: Adjust. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-write/test26.xml: Adjust. * tests/data/test-read-write/test27.xml: Adjust. * tests/data/test-read-write/test28-without-std-fns-ref.xml: Adjust. * tests/data/test-read-write/test28-without-std-vars-ref.xml: Adjust. 2017-06-09 Dodji Seketeli Filter top cv qualifier changes on function parameter types * include/abg-comparison.h (enum diff_category): Add a new FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY enumerator. "Or" the enumerator to the EVERYTHING_CATEGORY enumerator. * src/abg-comp-filter.cc (has_fn_parm_type_cv_qual_change): Define new static function. (categorize_harmless_diff_node): Categorize changes to top cv qualifiers on function parameter types into the new FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY. * src/abg-comparison.cc (get_default_harmless_categories_bitmap): Add the new FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY category to the set of harmless categories. (operator<<(ostream&, diff_category)): Adjust to serialize the new FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY. * tests/data/test-diff-filter/libtest40-v0.so: New test input binary. * tests/data/test-diff-filter/libtest40-v1.so: Likewise. * tests/data/test-diff-filter/test40-report-0.txt: New test reference output. * tests/data/test-diff-filter/test40-v0.cc: Source code of the test binary above. * tests/data/test-diff-filter/test40-v1.cc: Likewise. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-filter.cc (in_out_specs): Add new binaries to compare. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Likewise. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt: Likewise. 2017-05-28 Dodji Seketeli Do not report about voffset when it's not set in debug info * include/abg-ir.h (mem_fn_context_rel::mem_fn_context_rel): Initialize the virtual offset to -1. * src/abg-comparison.cc (represent): In the overload to represent a method_decl, do not represent the vofffset if it's not set. * src/abg-writer.cc (write_voffset): The virtual offset is signed because if it's -1, it means no offset is set. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Adjust. * tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. 2017-05-17 Dodji Seketeli Allow selective resolution of class declaration * include/abg-fwd.h (type_base_wptrs_type) (istring_type_base_wptrs_map_type): Define new typedefs. (lookup_class_types): Declare new functions. * include/abg-ir.h (environment::decl_only_class_equals_definition): Declare new accessor. (type_maps::{*_types}): Make these accessors return istring_type_base_wptrs_map_type& instead of istring_type_base_wptr_map_type&. * src/abg-dwarf-reader.cc (read_context::resolve_declaration_only_classes): Implement the new selective declaration resolution scheme. * src/abg-ir.cc (type_maps::priv::{*_types_}): Change the type of these data members from istring_type_base_wptr_map_type to istring_type_base_wptrs_map_type. (type_maps::{*_types}): Make these accessors definitions return istring_type_base_wptrs_map_type& instead of istring_type_base_wptr_map_type&. (translation_unit::bind_function_type_life_time): Adjust. (environment::priv::decl_only_class_equals_definition_): New data member. (environment::priv::priv): Initialize it. By default, a decl-only class is now considered different from its definition. (environment::decl_only_class_equals_definition): Define new accessor. (lookup_types_in_map, lookup_class_types): Define new functions. (lookup_type_in_map, lookup_union_type_per_location) (lookup_basic_type, lookup_basic_type_per_location) (lookup_class_type, lookup_class_type_per_location) (lookup_union_type, lookup_enum_type) (lookup_enum_type_per_location, lookup_typedef_type) (lookup_typedef_type_per_location, lookup_qualified_type) (lookup_pointer_type, lookup_reference_type, lookup_array_type) (lookup_function_type, maybe_update_types_lookup_map) (maybe_update_types_lookup_map) (maybe_update_types_lookup_map): Adjust. (type_base::get_canonical_type_for): When doing type comparison here, we can now consider that an unresolved class declaration compares different to an incompatible class definition of the same name. So no need to look through decl-only classes in that case. (equals): In the overload for class_or_union, if environment::decl_only_class_equals_definition() is false, then an unresolved class declaration of name "N" compares different to a class definition named "N". * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt: Adjust. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Adjust. * tests/data/test-diff-filter/test38/Makefile: New test material. * tests/data/test-diff-filter/test38/test38-a.c: Likewise. * tests/data/test-diff-filter/test38/test38-b.c: Likewise. * tests/data/test-diff-filter/test38/test38-c.c: Likewise. * tests/data/test-diff-filter/test38/test38-report-0.txt: Likewise. * tests/data/test-diff-filter/test38/test38-v0: Likewise. * tests/data/test-diff-filter/test38/test38-v1: Likewise. * tests/data/test-diff-filter/test38/test38.h: Likewise. * tests/data/test-diff-filter/test39/Makefile: Likewise. * tests/data/test-diff-filter/test39/test39-a-v0.c: Likewise. * tests/data/test-diff-filter/test39/test39-a-v1.c: Likewise. * tests/data/test-diff-filter/test39/test39-b-v0.c: Likewise. * tests/data/test-diff-filter/test39/test39-b-v1.c: Likewise. * tests/data/test-diff-filter/test39/test39-c-v0.c: Likewise. * tests/data/test-diff-filter/test39/test39-c-v1.c: Likewise. * tests/data/test-diff-filter/test39/test39-main.c: Likewise. * tests/data/test-diff-filter/test39/test39-report-0.txt: Likewise. * tests/data/test-diff-filter/test39/test39-v0: Likewise. * tests/data/test-diff-filter/test39/test39-v1: Likewise. * tests/data/test-diff-filter/test39/test39.h: Likewise. * tests/data/Makefile.am: Add the new test material above to the source distribution. * tests/test-diff-filter.cc (in_out_specs): Add the new test inputs above to the test harness. 2017-05-31 Dodji Seketeli Add documentation for the kmidiff tool * doc/manuals/kmidiff.rst: New doc file. * doc/manuals/Makefile.am: Add the above file to source distribution. 2017-05-31 Dodji Seketeli Allow re-using the ELF/DWARF read_context when loading a corpus group * include/abg-dwarf-reader.h (reset_read_context): Declare new function. * src/abg-dwarf-reader.cc (read_context::elf_paths_): Make this to be non const. (read_context::initialize): New function to initialize all data members. (read_context::read_context): Use the new read_context::initialize function, rather than initializing data members 'inline' here. (reset_read_context): Define a new function to reset a read_context so that it can be re-used to load a new corpus. 2017-05-31 Dodji Seketeli Add --vmlinux{1,2} option to abidw and kmidiff * include/abg-tools-utils.h (build_corpus_group_from_kernel_dist_under): Add a new vmlinux_path parameter. * src/abg-tools-utils.cc (find_vmlinux_and_module_paths): Do not try to find a vmlinux binary if we already have the path to one. (build_corpus_group_from_kernel_dist_under): Add a new vmlinux_path parameter. * tools/abidw.cc (options::vmlinux): New data member. (display_usage): Add a usage string for --vmlinux (parse_command_line): Parse the new --vmlinux option. (load_kernel_corpus_group_and_write_abixml): Fix some return code when the function fails. Verify the presence of the vmlinux binary that was given. Adjust. * tools/kmidiff.cc (options::{vmlinux1, vmlinux2}): New data members. (display_usage): Add a usage string for --vmlinux1 and --vmlinux2. (parse_command_line): Parse the --vmlinux1 and --vmlinux2 options. (main): Adjust. 2017-05-18 Dodji Seketeli Cache function type name computation results * src/abg-ir.cc (get_type_name): Cache function type names. 2017-05-29 Dodji Seketeli Fix innacurate test condition when reading an enum type from abixml * src/abg-reader.cc (build_enum_type_decl): Do not check for errno which might have been set earlier by something else. Rather, check the returned value for overflow or underflow. 2017-05-28 Dodji Seketeli Do not report about voffset when it's not set in debug info * include/abg-ir.h (mem_fn_context_rel::mem_fn_context_rel): Initialize the virtual offset to -1. * src/abg-comparison.cc (represent): In the overload to represent a method_decl, do not represent the vofffset if it's not set. * src/abg-writer.cc (write_voffset): The virtual offset is signed because if it's -1, it means no offset is set. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Adjust. * tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. 2017-05-18 Dodji Seketeli Speedup DIE representation computing esp function signature in C * src/abg-dwarf-reader.cc (die_function_signature): For C DIEs, just return the (linkage) name of the function. * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-annotate/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. 2017-05-17 Dodji Seketeli Allow selective resolution of class declaration * include/abg-fwd.h (type_base_wptrs_type) (istring_type_base_wptrs_map_type): Define new typedefs. (lookup_class_types): Declare new functions. * include/abg-ir.h (environment::decl_only_class_equals_definition): Declare new accessor. (type_maps::{*_types}): Make these accessors return istring_type_base_wptrs_map_type& instead of istring_type_base_wptr_map_type&. * src/abg-dwarf-reader.cc (read_context::resolve_declaration_only_classes): Implement the new selective declaration resolution scheme. * src/abg-ir.cc (type_maps::priv::{*_types_}): Change the type of these data members from istring_type_base_wptr_map_type to istring_type_base_wptrs_map_type. (type_maps::{*_types}): Make these accessors definitions return istring_type_base_wptrs_map_type& instead of istring_type_base_wptr_map_type&. (translation_unit::bind_function_type_life_time): Adjust. (environment::priv::decl_only_class_equals_definition_): New data member. (environment::priv::priv): Initialize it. By default, a decl-only class is now considered different from its definition. (environment::decl_only_class_equals_definition): Define new accessor. (lookup_types_in_map, lookup_class_types): Define new functions. (lookup_type_in_map, lookup_union_type_per_location) (lookup_basic_type, lookup_basic_type_per_location) (lookup_class_type, lookup_class_type_per_location) (lookup_union_type, lookup_enum_type) (lookup_enum_type_per_location, lookup_typedef_type) (lookup_typedef_type_per_location, lookup_qualified_type) (lookup_pointer_type, lookup_reference_type, lookup_array_type) (lookup_function_type, maybe_update_types_lookup_map) (maybe_update_types_lookup_map) (maybe_update_types_lookup_map): Adjust. (type_base::get_canonical_type_for): When doing type comparison here, we can now consider that an unresolved class declaration compares different to an incompatible class definition of the same name. So no need to look through decl-only classes in that case. (equals): In the overload for class_or_union, if environment::decl_only_class_equals_definition() is false, then an unresolved class declaration of name "N" compares different to a class definition named "N". * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt: Adjust. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Adjust. * tests/data/test-diff-filter/test38/Makefile: New test material. * tests/data/test-diff-filter/test38/test38-a.c: Likewise. * tests/data/test-diff-filter/test38/test38-b.c: Likewise. * tests/data/test-diff-filter/test38/test38-c.c: Likewise. * tests/data/test-diff-filter/test38/test38-report-0.txt: Likewise. * tests/data/test-diff-filter/test38/test38-v0: Likewise. * tests/data/test-diff-filter/test38/test38-v1: Likewise. * tests/data/test-diff-filter/test38/test38.h: Likewise. * tests/data/test-diff-filter/test39/Makefile: Likewise. * tests/data/test-diff-filter/test39/test39-a-v0.c: Likewise. * tests/data/test-diff-filter/test39/test39-a-v1.c: Likewise. * tests/data/test-diff-filter/test39/test39-b-v0.c: Likewise. * tests/data/test-diff-filter/test39/test39-b-v1.c: Likewise. * tests/data/test-diff-filter/test39/test39-c-v0.c: Likewise. * tests/data/test-diff-filter/test39/test39-c-v1.c: Likewise. * tests/data/test-diff-filter/test39/test39-main.c: Likewise. * tests/data/test-diff-filter/test39/test39-report-0.txt: Likewise. * tests/data/test-diff-filter/test39/test39-v0: Likewise. * tests/data/test-diff-filter/test39/test39-v1: Likewise. * tests/data/test-diff-filter/test39/test39.h: Likewise. * tests/data/Makefile.am: Add the new test material above to the source distribution. * tests/test-diff-filter.cc (in_out_specs): Add the new test inputs above to the test harness. 2017-05-04 Dodji Seketeli Avoid de-duplicating different C types that have identical name * src/abg-dwarf-reader.cc (die_decl_map_type, die_type_map_type): Remove these typedefs. (die_artefact_map_type, istring_dwarf_offsets_map_type): New typedefs. (die_is_at_class_scope, die_qualified_type_name) (die_qualified_decl_name, die_qualified_type_name_empty) (die_return_and_parm_names_from_fn_type_die) (die_function_type_is_method_type): Const-ify the read_context& parameter. (read_context::die_source_dependant_container_set::get_container): Likewise. (read_context::{name_artefacts_map_, per_tu_name_artefacts_map_, die_decl_map_, alternate_die_decl_map_, type_unit_die_decl_map_, die_type_map_, alternate_die_type_map_, type_unit_die_type_map_}): Remove data members. (read_context::{die_decl_map, alternate_die_decl_map, associate_die_to_decl_primary, associate_die_to_decl_alternate, associate_die_to_decl_from_type_unit, lookup_decl_from_die_offset_primary, lookup_decl_from_die_offset_alternate, lookup_decl_from_type_unit_die_offset, lookup_type_artifact_from_die_per_tu, lookup_artifact_from_per_tu_die_representation, associate_die_to_artifact_by_repr, associate_die_to_artifact_by_repr_internal, clear_die_type_maps}): Remove member functions. (read_context::{decl_die_repr_die_offsets_maps_, type_die_repr_die_offsets_maps_, decl_die_artefact_maps_, type_die_artefact_maps_, dwarf_expr_eval_context_}): Add new data members. (read_context::clear_per_translation_unit_data): Don't clear read_context::per_tu_name_artefacts_map_ data member as it's removed. (read_context::clear_per_corpus_data): Don't clear read_context::name_artefacts_map_ and all the other relevant data members that got removed. (read_context::{dwarf_per_die_source, decl_die_repr_die_offsets_maps, type_die_repr_die_offsets_maps, get_canonical_die, get_die_from_offset, decl_die_artefact_maps, type_die_artefact_maps, dwarf_expr_eval_ctxt}): Add new member functions. (compare_dies, compare_as_decl_dies) (compare_as_type_dies, maybe_finish_function_decl_reading) (die_is_anonymous): Define new functions. (read_context::associate_die_to_decl): Remove the do_associate_by_repr_per_tu parameter. Use the new read_context::{decl_die_artefact_maps_, get_canonical_die} member functions. (read_context::lookup_decl_from_die_offset): Use Dwarf_Off rather than size_t for the type of the die_offset parameter. Use the lookup_artifact_from_die_offset member function. (read_context::lookup_type_artifact_from_die): Const-ify. In one overload, take a new 'die_as_type' parameter. Use the new get_canonical_die, type_die_artefact_maps and decl_die_artefact_maps member functions. In the second overload, use the first overload. (read_context::odr_is_relevant): Add an overload that takes a DIE. (read_context::associate_die_to_type): Remove the do_associate_by_repr and do_associate_per_tu parameters. Use the new get_canonical_die and type_die_artefact_maps member functions. (read_context::lookup_type_from_die): Use the new lookup_artifact_from_die member function. (read_context::lookup_type_from_die_offset): Use the new type_die_artefact_maps member function. When the found artifact is a function_decl, return its type. (read_context::schedule_type_for_late_canonicalization): Use the new get_canonical_die and type_die_artefact_maps member functions. (die_function_signature): Const-ify. Get the scope name right even for scopes that are not types. (die_member_offset): Make eval_last_constant_dwarf_sub_expr use the new cached DWARF expression evalution context. (get_parent_die): Support where_offset equals to zero. This means we are looking at a C binary, basically. (build_enum_type) : Use the new overload of read_context::odr_is_relevant that takes a DIE. Adjust. (add_or_update_union_type, add_or_update_class_type): Don't lookup classes/unions per location anymore. Now that we can compare DIEs in a fined grain manner, the approximation of the location is not useful anymore. (build_pointer_type) (build_function_type): Associate DIE to type if we reuse an existing type. (build_or_get_fn_decl_if_not_suppressed): When re-using a function decl internal representation from an equivalent DIE that we've seen before, it can happen that we want to augment that function decl internal representation with new properties coming from the DIE we are currently looking at; do that here. (is_function_for_die_a_member_of_class): Remove the "where_offset" parameter. (add_or_update_member_function): Adjust. * tests/data/test-annotate/libtest23.so.abi: Adjust. * tests/data/test-annotate/test13-pr18894.so.abi: Adjust. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-annotate/test17-pr19027.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-annotate/test21-pr19092.so.abi: Adjust. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Adjust. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt: Adjust. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Adjust. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Adjust. * tests/data/test-read-dwarf/libtest23.so.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2017-04-14 Dodji Seketeli Speedup access to unreferenced symbols when loading corpus_group * src/abg-corpus.cc (corpus_group::unrefed_{fun, var}_symbol_map): New data members. (corpus_group::priv::priv): Adjust. (corpus_group::priv::add_unref_{fun,var}_symbols): Define new member functions. (corpus_group::add_corpus): Update the map of unreferenced symbols. (corpus_group::get_unreferenced_{function,variable}_symbols) Adjust logic. 2017-04-07 Dodji Seketeli Initial support of de-serializing the KMI of a Linux Kernel Tree * include/abg-libxml-utils.h (advance_to_next_sibling_element): Declare new function. * src/abg-libxml-utils.cc (go_to_next_sibling_element_or_stay) (advance_to_next_sibling_element): Define new functions. * include/abg-reader.h (read_corpus_group_from_input) (read_corpus_group_from_native_xml) (read_corpus_group_from_native_xml_file): Declare new functions. * src/abg-reader.cc (read_context::m_corpus_group): New data member. (read_context::{get_corpus_group, set_corpus_group}): Define new member functions. (read_translation_unit_from_input): Cleanup logic. (read_corpus_from_input): Don't assume that the document is starting with an 'abi-corpus' element. Support the mode where a caller called the xmlTextReaderExpand function (and so we are given an expanded xmlNodePtr) and the mode where we need to use the xmlTextReader API to walk through the 'abi-corpus' element. Also, if we are building a corpus group, do not clear what used to be 'per-corpus' data. That data must be shared by all the corpora of a given abi-corpus-group. (read_corpus_group_from_input, read_corpus_group_from_native_xml) (read_corpus_group_from_native_xml_file): Define new functions. * include/abg-tools-utils.h (FILE_TYPE_XML_CORPUS_GROUP): New enumerator of the file_type enum. * src/abg-tools-utils.cc (operator<<): In the overload for file_type, add a case for the new FILE_TYPE_XML_CORPUS_GROUP. (guess_file_type): Dectect abi-corpus-group xml element. * tools/abidiff.cc (adjust_diff_context_for_kmidiff): Define new static function. (main): Adjust to handle the new FILE_TYPE_XML_CORPUS_GROUP. That is, compare two FILE_TYPE_XML_CORPUS_GROUP if they are present. * tools/abilint.cc (main): Likewise. * tools/kmidiff.cc (main): Detect that one of two .kmi files are passed. In that case, load the .kmi file(s), build a corpus_group of it and use it in the comparison. 2017-04-06 Dodji Seketeli Initial support of the serialization of the KMI of a Linux Kernel Tree * include/abg-tools-utils.h (check_dir) (get_binary_paths_from_kernel_dist) (build_corpus_group_from_kernel_dist_under): Declare new functions. The last two functions are being moved from tools/kmidiff.cc so that they can be re-used. * include/abg-writer.h (write_corpus): Declare one overload that takes a write_context parameter. (write_corpus_group): Declare three overloads of this new function. * src/abg-tools-utils.cc (check_dir): Define new function. (load_generate_apply_suppressions, is_vmlinux, is_kernel_module) (find_vmlinux_and_module_paths) (get_binary_paths_from_kernel_dist) (build_corpus_group_from_kernel_dist_under): Define new functions. * src/abg-writer.cc (write_context::set_annotate): Define new member function. (write_corpus): Add an overload that takes a write_context. Adapt the existing overload to make it use this new one. (write_corpus_group): Define this new function and two additional overloads for it. * tools/kmidiff.cc (set_suppressions, is_vmlinux) (is_kernel_module, find_vmlinux_and_module_paths) (get_binary_paths_from_kernel_dist) (build_corpus_group_from_kernel_dist_under): Remove. (main): Adjust the call to build_corpus_group_from_kernel_dist_under as its arguments are now adapted since it's been factorized out into abg-tools-utils.h. * tools/abidw.cc (options::corpus_group_for_linux): Define new data member. (options::options): Adjust. (display_usage): Add help strings for the new --linux-tree option. (load_corpus_and_write_abixml): Factorize this function out of the main function. (load_kernel_corpus_group_and_write_abixml): Define new function. (main): Use the factorized load_corpus_and_write_abixml and the new load_corpus_and_write_abixml functions. * tests/test-read-write.cc: Adjust. * doc/manuals/abidw.rst: Add documentation for the new --linux-tree option. 2017-04-06 Dodji Seketeli Adjust test reference outputs after changes in abg-writer.cc * tests/data/test-annotate/test13-pr18894.so.abi: Adjust. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-annotate/test17-pr19027.so.abi: Adjust. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. 2017-04-06 Dodji Seketeli Fix indentation glitch before the tag in abixml * src/abg-writer.cc (write_corpus): Indent before emitting the closing tag. 2017-04-06 Dodji Seketeli Avoid emitting some empty translation units to abixml * src/abg-writer.cc (write_corpus): Do not emit a translation unit that appears empty beforehand. 2017-04-06 Dodji Seketeli Avoid emitting duplicated decls in abixml * src/abg-writer.cc (write_context::m_emitted_decls_map): New data member. (write_context::{decl_name_is_emitted, record_decl_as_emitted}): Define new memeber functions. (write_translation_unit): Do not emit a decl that has already been emitted. (write_var_decl, write_function): Record the decl as emitted. 2017-04-04 Dodji Seketeli Rename write_corpus_to_native_xml into write_corpus * include/abg-writer.h (write_corpus): Rename write_corpus_to_native_xml to this. * src/abg-writer.cc (write_corpus): Rename write_corpus_to_native_xml to this. * tests/test-read-dwarf.cc (test_task::perform): Adjust. * tests/test-read-write.cc: Remove a useless "using abigail::xml_writer::write_corpus_to_native_xml". * tools/abidw.cc (main): Adjust. * tools/abilint.cc (main): Adjust. 2017-04-04 Dodji Seketeli Update the reference output of regression tests after kabidiff work * tests/data/test-annotate/test0.abi: Adjust. * tests/data/test-annotate/test13-pr18894.so.abi: Adjust. * tests/data/test-annotate/test14-pr18893.so.abi: Adjust. * tests/data/test-annotate/test15-pr18892.so.abi: Adjust. * tests/data/test-annotate/test17-pr19027.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-annotate/test21-pr19092.so.abi: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Adjust. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt: Adjust. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Adjust. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Adjust. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Adjust. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Adjust. * tests/data/test-read-dwarf/test0.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2017-06-12 Dodji Seketeli Introduce the --kmi-whitelist option to abidiff * doc/manuals/abidiff.rst: Add documentation for the --kmi-whitelist option. * tools/abidiff.cc (display_usage): Emit help string for the --kmi-whitelist option (parse_command_line): Parse the new --kmi-whitelist option, of the -w shortcut. 2017-04-04 Dodji Seketeli Make abidw support the --kmi-whitelist option * tools/abidw.cc (options::{kabi_whitelist_paths, kabi_whitelist_supprs}): New data members. (display_usage): Add a help string for the new --kmi-whitelist option. (parse_command_line): Parse the new --kmi-whitelist option. (maybe_check_suppression_files): Check the presence of the linux kernel abi white list passed by the option --kmi-whitelist. (main): Ignore loading the symbol table if the kernel abi white list is provided. * doc/manuals/abidw.rst: Add documentation for the new option. 2017-04-03 Dodji Seketeli Make abipkgdiff compare two kernel packages * include/abg-suppression.h (variable_suppression::variable_suppression): Add default arguments to the parameters. * include/abg-tools-utils.h (dir_exists, dir_is_empty) (string_begins_with, get_rpm_name, get_rpm_arch, get_deb_name) (file_is_kernel_package, file_is_kernel_debuginfo_package): Declare new functions. * src/abg-tools-utils.cc (dir_exists, dir_is_empty) (string_begins_with, get_deb_name, get_rpm_name, get_rpm_arch) (file_is_kernel_package, file_is_kernel_debuginfo_package): Define new functions. (gen_suppr_spec_from_kernel_abi_whitelist): The kernel ABI whitelist is made of ELF symbols names that ought to match functions *and* variables that have ELF symbols with those names. So generate variable suppression specifications as well. Not just function suppression specifications. * tools/abipkgdiff.cc (options::{kabi_whitelist_package, show_symbols_not_referenced_by_debug_info, kabi_whitelist_paths, kabi_suppressions}): New data members. (options::options): Adjust. (package::KIND_KABI_WHITELISTS): New enumerator in the package::kind enum. (package::kabi_whitelist_package_): New data member. (package::{base_name, kabi_whitelist_package, }): New member functions. (display_usage): Add a help string to the new --linux-kernel-abi-whitelist and --no-unreferenced-symbols options. (parse_command_line): Parse the new --no-unreferenced-symbols, --linux-kernel-abi-whitelist and --lkaw-pkg options. (maybe_check_suppression_files): Check the presence of kabi whitelist files. (set_diff_context_from_opts): Consider (not) showing symbols not referenced by debug info. (compare): If we are looking at linux kernel packages, take the kernel abi whitelist into account, apply the suppressions resulting from the kabi whitelists to the ELF read context. (maybe_collect_kabi_whitelists) (get_kabi_whitelists_from_arch_under_dir) (maybe_handle_kabi_whitelist_pkg, maybe_collect_kabi_whitelists) (get_interesting_files_under_dir): Define new functions. (maybe_update_vector_of_package_content): Take a new file_name_to_look_for parameter. (create_maps_of_package_content) (extract_package_and_map_its_content): Consider the case of the package being a linux kernel package. (main): Take the potential --lkaw-pkg into account. * doc/manuals/abipkgdiff.rst: Add documentation for options --linux-kernel-abi-whitelist, --lkaw-pkg and --no-unreferenced-symbols. 2017-04-03 Dodji Seketeli Avoid loading a translation unit twice from abixml * src/abg-reader.cc (read_translation_unit): Take (in parameter) a reference as the resulting translation unit. (get_or_read_and_add_translation_unit): Define new static function. (read_context::get_scope_for_node) (read_translation_unit_from_input): Use the new get_or_read_and_add_translation_unit. 2017-04-03 Dodji Seketeli Support loading and comparing two kernel trees * include/abg-dwarf-reader.h (set_read_context_corpus_group) (read_and_add_corpus_to_group_from_elf, set_ignore_symbol_table) (get_ignore_symbol_table): Declare new functions. * abg-dwarf-reader.cc (read_context::options_type): Define new type. (die_dependant_container_set::clear): Define new member function. (read_context::{bss, tesxt, rodata, data, data1}_section_): Add new data members. (read_context::{symbol_versionning_sections_loaded_, symbol_versionning_sections_found_}): Likewise. (read_context::corpus_group_): Likewise. (read_context::{load_in_linux_kernel_mode, load_all_types, show_stats, do_log_}): Replace these options by .. (read_context::options_): ... this instance of the new read_context:options_type. (read_context::read_context): Adjust. (read_context::{clear_alt_debug_info_data, clear_per_corpus_data, env, get_data_section_for_variable_address, load_all_types, load_in_linux_kernel_mode, show_stats, do_log}): Adjust. (create_read_context): Adjust. (read_context::~read_context): Define destructor. (read_context::{options, bss_section, text_section, rodata_section, data_section, data1_section, current_corpus_group, has_corpus_group, main_corpus_from_current_group, main_corpus_from_current_group, current_corpus_is_main_corpus_from_current_group, should_reuse_type_from_corpus_group}): Define new member functions. (read_context::get_die_qualified_type_name): Handle the name of the current translation unit. (read_context::load_symbol_maps): Really don't load (linux kernel specific) symbol maps if we were told to ignore the ELF symbol table. (set_ignore_symbol_table, get_ignore_symbol_table) (create_default_var_sym, create_default_fn_sym, add_symbol_to_map) (set_read_context_corpus_group) (read_and_add_corpus_to_group_from_elf): Define new functions. (build_type_decl, build_typedef_type, build_enum_type) (add_or_update_class_type) (add_or_update_union_type): Reuse the type being built, from the main corpus of the corpus group. (build_qualified_type): Cleanup logic. (build_var_decl, build_function_decl): Create a default symbol for the variable or function if we are supposed to ignore the symbol table of the current binary. Add that symbol to the symbol table that is created in the read context. (read_debug_info_into_corpus): Don't load the ELF symbol table information if we are asked to ignore the symbol table. But set the symbol table that we built artificially while loading functions and variables, into the ABI corpus being built. (read_context::maybe_adjust_var_sym_address): Adjust. (build_ir_node_from_die): Add ir node to its logical scope. For the C language, the scope of a type is the global scope. (read_corpus_from_elf): Don't load ELF properties if we were asked to avoid the ELF symbol table. * include/abg-comparison.h (compute_diff): Declare ... * src/abg-comparison.cc (compute_diff): ... an overload to compare corpus_group. * tools/kmidiff.cc: New tool. 2017-03-31 Dodji Seketeli Initial support to lookup types per location * include/abg-fwd.h (get_name_of_qualified_type) (get_name_of_reference_to_type, lookup_basic_type_per_location) (lookup_class_type_per_location, lookup_union_type_per_location) (lookup_enum_type_per_location, lookup_typedef_type) (lookup_typedef_type_per_location, lookup_pointer_type) (lookup_reference_type, lookup_type_per_location) (lookup_type_through_translation_units) (lookup_type_from_translation_unit, odr_is_relevant): Declare new functions or new function overloads. * include/abg-ir.h (location::expand): Declare new member function. (type_maps::empty): Likewise. (operator|=): Declare an overload for qualified_type_def::CV. (get_string_representation_of_cv_quals) (get_name_of_qualified_type, lookup_qualified_type): Declare new functions. * src/abg-ir.cc (location::expand): Define new member function. (type_maps::empty): Likewise. (odr_is_relevant): Likewise. (get_string_representation_of_cv_quals) (get_name_of_reference_to_type, get_name_of_qualified_type) (lookup_union_type_per_location): Define new functions or overloads. (lookup_basic_type, lookup_enum_type, lookup_typedef_type) (lookup_qualified_type, lookup_pointer_type) (lookup_reference_type, lookup_type_from_translation_unit) (lookup_basic_type_per_location, lookup_basic_type_per_location) (lookup_class_type_per_location, lookup_class_type_per_location) (lookup_enum_type_per_location, lookup_enum_type_per_location) (lookup_typedef_type_per_location) (lookup_typedef_type_per_location, lookup_type_per_location): Define new overloads. (maybe_update_types_lookup_map) (maybe_update_types_lookup_map) (maybe_update_types_lookup_map): Add a new use_type_name_as_key parameter. If it's false, then associates the type to its location rather than to its name. (maybe_update_types_lookup_map): In the overloads for type_decl, class_decl, union_decl, enum_type, typedef_decl, array_type_def, record the type in the lookup map per location, in addition to the per-name recording. (qualified_type_def::build_name): Use the new get_name_of_qualified_type. (qualified_type_def::get_cv_quals_string_prefix): Use the new get_string_representation_of_cv_quals. (operator|=): Define a new overload for qualified_type_def::CV. (pointer_type_def::get_qualified_name): Use the new get_name_of_pointer_to_type. (reference_type_def::get_qualified_name): Use the new get_name_of_reference_to_type. 2017-03-30 Dodji Seketeli Create a Corpus Group API extension * include/abg-corpus.h (corpus::{find_translation_unit, get_type_per_loc_map}): Declare new member functions. (corpus::{get_architecture_name, is_empty}): Make these member functions const. (corpus::{get_sorted_fun_symbols, get_functions, get_variables, get_unreferenced_function_symbols, get_unreferenced_variable_symbols}): Make these member functions virtual. (class corpus_group): Declare a new type. * include/abg-fwd.h (corpus_sptr, corpus_group_sptr) (string_tu_map_type, istring_var_decl_ptr_map_type) (istring_function_decl_ptr_map_type): Define new typedefs. * src/abg-corpus-priv.h (corpus_priv::{path_tu_map, type_per_loc_map_}): Add new data members. * src/abg-corpus.cc (corpus_add): Complete the function comment. Assert that at most one translation unit of a given path can be added to the corpus. (corpus::{find_translation_unit, get_type_per_loc_map}): Define new member functions. (corpus::{get_architecture_name}): Make this member function const. (struct corpus_group::priv): Define new type. (corpus_group::{corpus_group, ~corpus_group, add_corpus, get_corpora, is_empty, get_functions, get_variables, get_var_symbol_map, get_fun_symbol_map, get_sorted_fun_symbols, get_sorted_var_symbols, get_unreferenced_function_symbols, get_unreferenced_variable_symbols}): Define member functions of the new corpus_group type. 2017-07-03 Dodji Seketeli Fix some typos in abidiff.cc * tools/abidiff.cc (main): Fix typos. 2017-07-03 Dodji Seketeli Avoid comparing kernel.img file from the grub2 package * default.abignore: Do not compare kernel.img files. 2017-06-14 Dodji Seketeli Bug 21567 - Fedabipkgdiff matches build distro names too tightly * tools/fedabipkgdiff (get_distro_from_string): Define new function. (Brew.get_package_latest_build): Also consider builds which distro property is less than the expected distro string that we were given. 2017-06-14 Sinny Kumari Check if return_codes list is empty in fedabipkgdiff * tools/fedabipkgdiff (run_abipkgdiff()): Check if return_codes list is empty 2017-06-13 Dodji Seketeli Do not forget to erase temporary directories in abipkgdiff * tools/abipkgdiff.cc (maybe_erase_temp_dirs): Define new static function. (compare): Call the new maybe_erase_temp_dirs on all return points. 2017-05-11 Ben Woodard Fix more clang build warnings * include/abg-ini.h (config::section::priv): Make this be a class, not a struct. * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir) (build_ir_node_from_die): Add parenthesis around assignment expressions inside conditional expression. * src/abg-suppression.cc (read_function_suppression): Likewise. 2017-05-11 Ben Woodard Fix some clang compile problems * include/abg-comp-filter.h (class filter_base): Declare this as a struct. * include/abg-comparison.h (class filtering::filter_base): Likewise. (struct diff_traversable_base): Declare this as a class. * include/abg-ir.h (function_decl::parameter): Declare this before using it. * src/abg-corpus.cc (corpus::priv::build_unreferenced_symbols_tables): Add missing parenthesis around assignment expressions inside conditional expressions. 2017-05-21 Sinny Kumari Add --self-compare option in fedabipkgdiff * bash-completion/fedabipkgdiff: Add new option --self-compare * tests/data/Makefile.am: Add new test file * tests/data/test-fedabipkgdiff/test7-self-compare-from-fc23-dbus-glib-report-0.txt: New reference output for testing ABI comparison on same package * tests/runtestfedabipkgdiff.py.in (FEDABIPKGDIFF_TEST_SPECS): Add test case for --self-compare * tools/fedabipkgdiff (build_commandline_args_parser()): Add new option --self-compare (generate_comparison_halves()): Find second comparision half in same package list while doing self-compare (self_compare_rpms_from_distro()): New function to perform ABI comparision on same pacakge (main()): Add if condition when --self-compare option is enabled 2017-03-31 Dodji Seketeli Avoid building DIE -> parent DIE map when analyzing a C binary * include/abg-ir.h (global_scope_sptr): Make this be a share_ptr of scope_decl, not of global_scope. (translation_unit::get_global_scope): Return a reference to scope_decl_sptr. * src/abg-ir.cc (translation_unit::get_global_scope): Return a scope_decl not a global_scope. * src/abg-dwarf-reader.cc (read_context::nil_scope_): Add new data member. (read_context::{global_scope, nil_scope}): Define new member functions. (read_context::build_die_parent_maps): Do not build the map if we are looking at a C (or asm) translation unit. (get_scope_die, get_scope_for_die): If we are looking at a C translation unit then do return the global scope. 2017-04-06 Dodji Seketeli Speed up access to the definition of a class declaration-only type * include/abg-ir.h (class_or_union::get_naked_definition_of_declaration): Declare a new member function. (class_decl::get_naked_definition_of_declaration): Likewise. * src/abg-ir.cc ({type_decl, qualified_type_def, array_type_def, enum_type_decl}::operator==): Use the get_naked_canonical_type and get_naked. (class_or_union::priv::naked_definition_of_declaration_): Define new data member. (class_or_union::priv::priv): Adjust to initialize the new data member. (class_or_union::get_naked_definition_of_declaration): Define new member function. ({class_or_union, class_decl}::operator==): Use the new get_naked_definition_of_declaration instead of get_definition_of_declaration. (equals): In the overload for class_or_union, do the same. (class_decl::get_naked_definition_of_declaration): Define new member function. (hash_type_or_decl): Likewise. 2017-04-06 Dodji Seketeli Speedup comparison of decl-only classes * src/abg-ir.cc (equals): In the overload for class_decl, if we are looking at a decl-only class, then directly call the equals function for class_or_union. That one knows how to perform the comparison without calling the class_or_union::priv_->comparison_started function, in that case. 2017-04-04 Dodji Seketeli Update the description of what abipkgdiff does * tools/abipkgdiff.cc: Update the description of the sequence of actions performed. 2017-04-06 Dodji Seketeli Misc cleanups in abg-writer.cc * src/abg-writer.cc (class write_context): Fix indentation. (write_location, write_visibility, write_binding) (write_array_size_and_alignment, write_size_and_alignment): Fix these declarations to use the *_sptr typedefs rather than the explicit shared_ptr<*> types. (write_translation_unit): Fix comment. 2017-05-10 Dodji Seketeli Don't consider changes to basic types as being redundant * include/abg-comparison.h (is_diff_of_basic_type) (has_basic_type_change_only): Declare these functions ... * src/abg-comparison.cc (is_diff_of_basic_type) (has_basic_type_change_only): ... and define them. (redundancy_marking_visitor::visit_begin): Use the new has_basic_type_change_only. * tests/data/test-diff-filter/libtest37-v0.so: New binary test input. * tests/data/test-diff-filter/libtest37-v1.so: Likewise. * tests/data/test-diff-filter/test37-report-0.txt: New test reference output. * tests/data/test-diff-filter/test37-v0.cc: Source code of the new binary test input. * tests/data/test-diff-filter/test37-v1.cc: Likewise. * tests/data/Makefile.am: Update to add the new test material to the source distribution. * tests/test-diff-filter.cc (in_out_spec): Add the new test input to this test harness. 2017-05-10 Dodji Seketeli Rename fn_parm_diff::get_type_diff into fn_parm_diff::type_diff * include/abg-comparison.h (fn_parm_diff::type_diff): Renamed fn_parm_diff::get_type_diff intot his. * src/abg-comparison.cc (fn_parm_diff::type_diff): Likewise. (fn_parm_diff::report): Adjust. (redundancy_marking_visitor::visit_begin): Likewise. (is_diff_of_variadic_parameter): Likewise. 2017-05-03 Dodji Seketeli Invalidate function and variable ID cache when invoking ::set_symbol * src/abg-ir.cc ({function, var}_decl::set_symbol): Invalidate the ID cache. 2017-05-03 Dodji Seketeli Remove useless overloads of is_type * include/abg-fwd.h (is_type): Remove the overloads that take decl_base and type_base types. * src/abg-ir.cc (is_type): Likewise. 2017-05-04 Dodji Seketeli Ensure build_qualified_type can return non-qualified types * src/abg-dwarf-reader.cc (build_qualified_type): Return a type_base_sptr. (build_ir_node_from_die): Adjust the call to build_qualified_type. 2017-05-04 Dodji Seketeli Fix array subranges (wrongly) having the same lower bound * src/abg-dwarf-reader.cc (build_subranges_from_array_type_die): Consider the 'lower_bound' parameter as the default lower bound for each sub-ranges. 2017-03-31 Dodji Seketeli Fix buffer overrun in 'equals' function for arrays * src/abg-ir.cc (equals): In the overload for arrays, check for the end of the subranges of the two arrays, not just for the first one. 2017-04-18 Dodji Seketeli Fix a race condition in queue::priv::do_bring_workers_down * src/abg-workers.cc (queue::priv::tasks_todo_mutex): Make this data member mutable. (more_tasks_to_execute): (queue::priv::do_bring_workers_down): Update the queue::priv::bring_workers_down only in the critical section defined by queue::priv::queue_cond_mutex. (worker::wait_to_execute_a_task): Testing for queue::priv::bring_workers_down is done in the critical section defined by queue::priv::queue_cond_mutex. The loop over waiting ont the condition is also in the critical section, as it ought to be. * tests/test-read-write.cc (struct test_task): New type. (main): Express in terms of the new test_task type. 2017-04-12 Ondrej Oprala cppcheck: mitigate performance warnings * include/abg-diff-utils.h (print_snake): pass argument of type snake by const reference. * include/abg-ir.h (location::operator{==,<}): Likewise. * include/abg-viz-dot.h (node_base::{node_base,parent_node,child_node}): Likewise. * include/abg-viz-svg.h (svg::svg) Likewise. * src/abg-config.cc (config::config): Member initialization in ctor body. * src/abg-dwarf-reader.cc (class_decl_sptr::add_or_update_class_type): Initial value never used. * src/abg-ir.cc: (decl_base::priv::priv) Member initialization in ctor body, pass argument of type location by const reference. (equals): Variable initial value never used. * src/abg-reader.cc (read_corpus_from_input): Initial variable value never used. (build_elf_symbol_db): Use pre-increment. * src/abg-suppression-priv.h (suppression_matches_type_location): Pass argument of type location by const reference. * src/abg-suppression.cc: Likewise. 2017-04-11 Ondrej Oprala Fix cppcheck error: "Same iterator is used with different containers" * src/abg-dwarf-reader.cc (type_or_decl_base_sptr::lookup_artifact_from_per_tu_die_representation): Fix an error found by cppcheck. 2017-04-11 Ondrej Oprala Clean up scripts/* * scripts/dot_to_png.sh: Clean up the script according to shellcheck warnings and remarks. * scripts/dot_to_svg.sh: Likewise. * scripts/svg_to_plain_svg.sh: Likewise. * scripts/svg_to_png_and_pdf.sh: Likewise. 2017-04-12 Ondrej Oprala Fix comparison used instead of an assignment * src/abg-ir.cc (parse_integral_type): An attempt at clang compilation has discovered there to be a comparison with unused result, that apparently should be an assignment. 2017-04-12 Dodji Seketeli Fix some random deadlock while running fedabipkgidiff in tests * tools/fedabipkgdiff (abipkgidff): Do not use Popen.communicate() as it might hang if the data is large. Rather, busy wait for the abipkgdiff process to finish and then get its output. 2017-03-22 Slava Barinov Fix types in header to meet sources * include/abg-fwd.h: Include stdint.h for uint64_t. (ir::set_data_member_offset): Take uint64_t rather than size_t. (ir::get_data_member_offset): Return uint64_t rather than size_t. 2017-03-24 Dodji Seketeli Launch fedabipkgdiff tests first * tests/Makefile.am: Run the fedabipkgdiff test first. 2017-03-24 Dodji Seketeli Bug 21296 - Reporting diff of const ref against non-const ref aborts * include/abg-fwd.h (look_through_no_op_qualified_type): Declare new function. * src/abg-ir.cc (look_through_no_op_qualified_type): Define it. (compute_diff_for_types): Use the new look_through_no_op_qualified_type here rather than open-coding it. (equals): In the overload for function_decl::parameter, use the new look_through_no_op_qualified_type function. * tests/data/test-diff-dwarf/test40-PR21296-clanggcc.cc: Source code of the new test inputs. * tests/data/test-diff-dwarf/test40-PR21296-clanggcc-report0.txt: New test input. * tests/data/test-diff-dwarf/test40-PR21296-libgcc.so: New binary test input. * tests/data/test-diff-dwarf/test40-PR21296-libclang.so: Likewise. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test inputs to the test harness. 2017-03-05 Chenxiong Qi Bug 20087 - Clean cache before or after ABI comparison * configure.ac: Require shutil module. * doc/manuals/fedabipkgdiff.rst: Add document for new option clean-cache, clean-cache-before, and clean-cache-after. * tools/fedabipkgdiff (build_commandline_args_parser): Add new option --clean-cache, --clean-cache-before and --clean-cache-after. (diff_local_rpm_with_latest_rpm_from_koji): Delete download cache directory before or after downloading RPMs. (diff_latest_rpms_based_on_distros): Likewise. (diff_two_nvras_from_koji): Likewise. (diff_from_two_rpm_files): Likewise. * bash-completion/fedabipkgdiff: Add new options. * tests/mockfedabipkgdiff.in (get_download_dir): Rewrite to behave just like the original get_download_dir. (mock_get_download_dir): Removed. (DOWNLOAD_CACHE_DIR): New global variable pointing directory holding packages during tests. (run_fedabipkgdiff): Mock original get_download_dir with the rewrite get_download_dir. * tests/runtestfedabipkgdiff.py.in (run_fedabipkgdiff_tests): Add --clean-cache to run tests to ensure no regression. 2017-03-17 Dodji Seketeli Shut down a helgrind false positive in the "system" libc call * tests/test-valgrind-suppressions.supp: Add a suppression that occurs during an internal libc signal handling occasion. 2017-03-15 Dodji Seketeli Fix data race on worker::queue::priv::bring_workers_down * src/abg-workers.cc (worker::wait_to_execute_a_task): Protect the read of the queue::priv::bring_workers_down down variable with the queue::priv::tasks_todo_mutex. 2017-03-07 Dodji Seketeli Bug 21228 - Handle cloning union member functions * include/abg-ir.h (class_or_union::add_member_function): Move the class_decl::add_member_function overload declaration into the class class_or_union class. (class class_decl): Make the class class_or_union be a friend of class_decl. * src/abg-ir.cc (class_decl::add_member_function): Transform the definition of this overload into ... (class_or_union::add_member_function): ... this one. Make sure that when setting the virtual-ness attributes of the member function, we are effectively looking at the a function that is a member of a class. (function_decl::clone): Do not assert that a member function is necessarily a member of a class_decl. It can also a member of a union_decl!. So, rather, assert that the scope of the member function is of type class_or_union. * tests/data/test-diff-pkg/tbb-2017-8.20161128.fc26.x86_64.rpm: New test input RPM. * tests/data/test-diff-pkg/tbb-2017-9.20170118.fc27.x86_64.rpm: * tests/data/test-diff-pkg/tbb-debuginfo-2017-8.20161128.fc26.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/tbb-debuginfo-2017-9.20170118.fc27.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/tbb-2017-8.20161128.fc26.x86_64--tbb-2017-9.20170118.fc27.x86_64.txt: New reference test output. * tests/data/Makefile.am: Add the new test input RPMs to the source distribution. * tests/test-diff-pkg.cc (in_out_specs): Take the new input tests above into account. 2017-03-03 Dodji Seketeli Consider file path when sorting virtual member functions * src/abg-ir.cc (virtual_member_function_less_than::operator()): Take the file path into account in the sorting. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. 2017-03-03 Dodji Seketeli Fix virtual members sorting to unbreak the build on EL6 * src/abg-ir.cc (virtual_member_function_less_than::operator()): Update comment. When two virtual functions have the same virtual index and one of them has no ELF symbol, then that function is less than the one with an ELF symbol. * tests/data/Makefile.am: Remove test-annotate/{test9-pr18818-clang.so.abi, test11-pr18828.so.abi, test12-pr18844.so.abi, test16-pr18904.so.abi, test22-pr19097-libstdc++.so.6.0.17.so.abi}. * tests/data/test-annotate/test10-pr18818-gcc.so.abi: Remove. * tests/data/test-annotate/test11-pr18828.so.abi: Likewise. * tests/data/test-annotate/test12-pr18844.so.abi: Likewise. * tests/data/test-annotate/test16-pr18904.so.abi: Likewise. * tests/data/test-annotate/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/test-annotate.cc (in_out_specs): Remove those tests above which input files have been removed. 2017-03-02 Dodji Seketeli Make Helgrind suppressions less specific to libgcc_s version * tests/test-valgrind-suppressions.supp: Make Helgrind suppressions less specific to libgcc_s version. 2017-03-02 Dodji Seketeli More Helgrind suppressions * tests/test-valgrind-suppressions.supp: More specific suppressions. 2017-03-02 Dodji Seketeli Silence Helgrind reports about exception stack unwinding * tests/test-valgrind-suppressions.supp: Silence Helgrind reports about exception stack unwinding. 2017-03-01 Dodji Seketeli Make the helgrind suppressions less specific * tests/test-valgrind-suppressions.supp: Make the ostream writting suppressions be less specific so that they can apply to all the related false positives. 2017-03-01 Dodji Seketeli Move test-read-dwarf.cc to abigail::workers * tests/test-read-dwarf.cc (iospec, spec_lock, write_lock) (out_abi_base, in_elf_base, in_abi_base): Remove these global variables. (handle_in_out_spec): Remove this. (struct test_task): Write this task that does what handle_in_out_spec was doing. (test_task_sptr): Define new typedef. (main): Remove the pthreads artifacts. Use the new test_task type along with the abigail::workers interface. * tests/test-valgrind-suppressions.supp: Add more helgrind suppressions for ostream writting false positives. 2017-02-28 Dodji Seketeli Display the command that failed the runtestfedabipkgdiff.py test * tests/runtestfedabipkgdiff.py.in (run_fedabipkgdiff_tests): When A test fails, display the fedabipkgdiff command that triggered the failure. 2017-02-24 Dodji Seketeli Make abipkgdiff.cc use the abigail::workers interface * tools/abipkgdiff.cc: Remove ftw.h, pthread.h, unistd.h, add fts.h and abg-workers.h. (verbose, elf_file_paths_tls_key, reports_map, env_map, map_lock) (arg_lock, prog_options): Remove all these global variables. (struct package_descriptor): Remove this type. (pthread_routine_extract_package) (first_package_tree_walker_callback_fn) (second_package_tree_walker_callback_fn, pthread_routine_compare) (pthread_join, pthread_routine_extract_pkg_and_map_its_content): Remove these functions. (options::{num_workers, verbose}): Define new data members. (options::options): Initialize the new verbose and num_workers data members. (package::erase_extraction_directory) (erase_created_temporary_directories_parent): Take the program options in parameter. Don't use the global verbose variable anymore. (package::erase_extraction_directories) (erase_created_temporary_directories, extract_package): Take the program options in parameter. (extract_rpm, extract_deb, extract_tar): Likewise. And don't use the global verbose variable anymore. (compare): Don't use the global verbose variable anymore. Use the new compare_task type along with the abigail::workers::queue type. (pkg_extraction_task, pkg_prepare_task, compare_task) (comparison_done_notify): Define new classes. (maybe_update_vector_of_package_content): Define new static function. (create_maps_of_package_content): Don't take the ftw_cp_type anymore. Don't use the global verbose variable anymore. Use the fts_{open,read,close} functions, rather than the ftw one. (extract_package_and_map_its_content): Don't use pthreads anymore. Use the new pkg_extraction_task type created along with the abigail::workers::queue type. (prepare_packages): Don't use pthreads anymore. Use the new pkg_prepare_task type along with the abigail::workers::queue type. (elf_size_is_greater): Adjust to use abigail::workers::queue::tasks, rather than the previous compaer_args_sptr type. (parse_command_line): Adjust to stop using the global verbose variable. (main): Remove use of global variables prog_options and also the packages variable. * tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt: Adjust. * tests/data/test-diff-pkg/dirpkg-0-report-0.txt: Likewise. * tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt: Likewise. * tests/data/test-diff-pkg/test-rpm-report-0.txt: Likewise. * tests/data/test-diff-pkg/test-rpm-report-1.txt: Likewise. * tests/data/test-diff-pkg/test-rpm-report-2.txt: Likewise. * tests/data/test-diff-pkg/test-rpm-report-3.txt: Likewise. * tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test4-glib-0.100.2-2.fc20.x86_64.rpm-glib-0.106-1.fc23.x86_64.rpm-report-0.txt: Likewise. 2017-02-24 Dodji Seketeli Do not ignore valgrind checks returning an error * autoconf-archive/ax_valgrind_check.m4 (check-valgrind): Don't ignore errors. 2017-02-24 Dodji Seketeli Add a "make check-valgrind-helgrind-recursive" target * tests/Makefile.am (check-valgrind-helgrind-recursive): New target to run the tests recursively under the control of Valgrind's Helgrind tool. * tests/test-valgrind-suppressions.supp: Update this suppression file with suppressions for Helgrind. 2017-02-24 Dodji Seketeli Several fixes and enhancements to abigail::workers * Don't try to schedule a task if the pointer to the task is nil * Fix a data race when bringing workers (of a queue) down * Always try to wake up all waiting threads when bringing down queue workers. * Fix a data race when accessing the queue condition variable * Fix a data race when notifying listeners about the end of the job performed by the task. Enhancements ============ * Pass the "task done" notifier by reference, to the worker queue. Without this, the worker queue needs to copy the "task done" notifier by value. This implies that user code needs to provide task done notifier instances that come with potentially complicated copy constructors. By passing it by reference and by just re-using the notifier from the user code, we do away with the need for copying altogether. This also fixes some latent copying bugs. * Add a workers::queue::schedule_tasks() method This allows user code to schedule a vector of tasks at once. * make workers::queue::get_completed_tasks() return a non-const vector This enables user code to sort the completed tasks as they wish. * include/abg-workers.h (queue::tasks_type): New typedef. (queue::queue): Pass task_done_notify by reference. (queue::schedule_tasks): Declare new member function. (queue::get_completed_tasks): Return non-const vector. * src/abg-workers.cc (queue::priv::default_notify): New data member. (queue::priv::notify): Make this data member be a reference. (queue::priv::priv): Initialize the notify data member to either the new default_notify (if no notifier is provided by the constructor) or to the notifier provided by the constructor. (queue::priv::schedule_task): Do not schedule a nil task. Update comment. (queue::priv::schedule_tasks): Add a new member function. (queue::priv::do_bring_workers_down): Update comment. Protect access to "bring_workers_down" with tasks_todo_mutex to prevent a data race. Call pthread_cond_broadcast on the queue_cond unconditionaly to prevent some worker threads to keep waiting for ever. Also, protect the access to the queue_cond by the queue_cond_mutex to precent a data race. (queue::queue): Pass the notifier by reference. Update comment. (queue::schedule_task): Update comment. (queue::schedule_tasks): Define new member function. (queue::wait_for_workers_to_complete): Update comment. (queue::get_completed_tasks): Return a non-const vector. Update comment. (worker::wait_to_execute_a_task): Update several comments. Make the execution of the notification code to be synchronized (on the tasks_done_mutex). 2017-02-14 Dodji Seketeli Fix typo in help string of abipkgdiff * tools/abipkgdiff.cc (display_usage): Remove erroneous end line. 2017-01-23 Dodji Seketeli fedabipkgdiff refuses to compare packages with the same release number * tools/fedabipkgdiff (RPM.is_peer): Update comment. Fix logic. * tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-0.39.1-1.fc22.x86_64.rpm: New test input file. * tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-debuginfo-0.39.1-1.fc22.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/packages/vte291/0.39.1/1.fc22/x86_64/vte291-devel-0.39.1-1.fc22.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-0.39.90-1.fc22.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-debuginfo-0.39.90-1.fc22.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/packages/vte291/0.39.90/1.fc22/x86_64/vte291-devel-0.39.90-1.fc22.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/vte291-0.39.1-1.fc22.x86_64--vte291-0.39.90-1.fc22.x86_64-report-0.txt: Likewise. * tests/data/Makefile.am: Add the new test input data to source distribution. * tests/mockfedabipkgdiff.in: Update the package and build information to add the new vte291-0.39.1-1.fc22.x86_64.rpm and vte291-0.39.90-1.fc22.x86_64.rpm packages (as well as their devel and debuginfo packages) into the "mock" Koji build database. * tests/runtestfedabipkgdiff.py.in: Make this test harness run over the two aforementioned packages. 2017-01-24 Dodji Seketeli Add missing tests input files to distribution files * tests/data/Makefile.am: Add three missing test input files to the source distribution tarball. Renamed test-fedabipkgdiff/test6-missing-devel-debuginfo-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt into test-fedabipkgdiff/test6-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt. * tests/runtestfedabipkgdiff.py.in (FEDABIPKGDIFF_TEST_SPECS): Renamed test6-missing-devel-debuginfo-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt into test6-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt. 2017-01-24 Dodji Seketeli Add missing new line to an error message of runtestfedabipkgdiff.py * tests/runtestfedabipkgdiff.py.in (run_fedabipkgdiff_tests): Add missing new line to an error message. 2017-01-24 Dodji Seketeli Fix silent failure of tests/runtestfedabipkgdiff.py * tests/mockfedabipkgdiff.in (run_fedabipkgdiff): Patch fedabipkgdiff.DEFAULT_KOJI_TOPURL instead of fedabipkgdiff.DEFAULT_KOJI_TOPDIR. * tests/runtestfedabipkgdiff.py.in (main): Properly return 0 upon success, 1 otherwise. 2017-01-14 Dodji Seketeli Misc style fixes * include/abg-ir.h (class_or_union): Fix indentation. * src/abg-dwarf-reader.cc (get_die_pretty_representation): Add new line. * src/abg-ir.cc (struct class_decl::priv): Fix indentation. (virtual_member_function_less_than::operator()): Fix a typo in a comment. 2017-01-13 Dodji Seketeli Bug 20476 - Compare virtual member functions when comparing classes * include/abg-ir.h (class_decl::get_biggest_vtable_offset): Declare new member function. * src/abg-ir.cc (virtual_member_function_less_than::operator()): Either compare the symbol id strings if the functions have symbols or just compare their pretty representations. (class_decl::get_biggest_vtable_offset): Define new member function. (methods_equal_modulo_elf_symbol) (method_matches_at_least_one_in_vector): New static methods. (equals): In the overload for classes, compare the virtual member functions while comparing classes. * src/abg-comparison.cc (represent): In the overload for method_decl_sptr, fix the way we compute the highest vtable offset number for a give class_decl. (class_decl::ensure_lookup_tables_populated): Don't forget added and removed virtual member functions in the report for changed classes. * tests/data/test-diff-dwarf/libtest41-PR20476-hidden-old.so: New test binary input file. * tests/data/test-diff-dwarf/libtest41-PR20476-hidden-new.so: Likewise. * tests/data/test-diff-dwarf/test41-PR20476-hidden-report-0.txt: New reference output. * tests/data/Makefile.am: Add the new test material above to the source distribution. * tests/test-diff-dwarf.cc (in_out_spec): Add the new tests here. * tests/data/test-annotate/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-annotate/test11-pr18828.so.abi: Adjust. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-annotate/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. 2017-02-14 Dodji Seketeli Fix indentation in src/abg-writer.cc * src/abg-writer.cc (annotate): Fix indentation. 2017-02-13 Dodji Seketeli Adjust reference output of test-annotate * tests/data/test-annotate/test15-pr18892.so.abi: Adjust this reference output. 2017-02-13 Dodji Seketeli Fix help string for --header-dirs * tools/abidw.cc (display_usage): Fix patch -> path typo. 2017-02-13 Dodji Seketeli Make abidw --headers-dir work with the --out-file option * tools/abidw.cc (parse_command_line): Don't require an empty output file when parsing the --headers-dir option. This was a thinko. 2017-01-17 Ondrej Oprala Bug 20970 - Add a --annotate option to abidw * doc/manuals/abidiff.rst: Document the '--no-corpus-path' option. * doc/manuals/abidw.rst: Document the '--no-corpus-path' and '--annotate' options. * include/abg-libxml-utils.h ({un,}escape_xml_comment): Add new function declarations. * include/abg-writer.h: Add new annotate functions (write_{translation_unit,corpus_to_{archive,native_xml_file}}): Add an optional "annotate" parameter defaulting to "false". * src/abg-libxml-utils.cc ({un,}escape_xml_comment): Add new function definitions. * src/abg-writer.cc (annotate): Define new templatized function and specialize it for necessary cases. * tests/Makefile.am: Add runtestannotate as a new test. * tests/data/Makefile.am: Add paths to below reference test outputs. * tests/data/test-annotate/libtest23.so.abi: New reference test output. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-annotate/test0.abi: Likewise. * tests/data/test-annotate/test1.abi: Likewise. * tests/data/test-annotate/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-annotate/test11-pr18828.so.abi: Likewise. * tests/data/test-annotate/test12-pr18844.so.abi: Likewise. * tests/data/test-annotate/test13-pr18894.so.abi: Likewise. * tests/data/test-annotate/test14-pr18893.so.abi: Likewise. * tests/data/test-annotate/test15-pr18892.so.abi: Likewise. * tests/data/test-annotate/test16-pr18904.so.abi: Likewise. * tests/data/test-annotate/test17-pr19027.so.abi: Likewise. * tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-annotate/test2.so.abi: Likewise. * tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-annotate/test21-pr19092.so.abi: Likewise. * tests/data/test-annotate/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-annotate/test3.so.abi: Likewise. * tests/data/test-annotate/test4.so.abi: Likewise. * tests/data/test-annotate/test5.o.abi: Likewise. * tests/data/test-annotate/test6.so.abi: Likewise. * tests/data/test-annotate/test7.so.abi: Likewise. * tests/data/test-annotate/test8-qualified-this-pointer.so.abi: Likewise. * tests/data/test-annotate/test9-pr18818-clang.so.abi: Likewise. * tests/test-annotate.cc: New test for ABIXML annotations. * tools/abidiff.cc: Add the new option '--no-corpus-path'. * tools/abidw.cc: Likewise. Also add the '--annotate' option. reviews round 1 2017-01-20 Dodji Seketeli Fix test-diff-pkg after commit 2dcc606 * tests/test-diff-pkg.cc (in_out_specs): Fix paths to spice-server packages. 2017-01-20 Dodji Seketeli Add --harmless option to abipkgdiff * doc/manuals/abidiff.rst: Fix a typo. * doc/manuals/abipkgdiff.rst: Document the --harmless option. * tools/abipkgdiff.cc: Update copyright year. (options::show_harmless_changes): Add new data member. (options::options): Initialize the new data member. (display_usage): Add a help string for the new --harmless option. (parse_command_line): Parse the new --harmless option. (set_diff_context_from_opts): Configure the diff context accordingly, if the user provided the --harmless option. 2017-01-20 Dodji Seketeli Fix suppression category propagation in diff node graph * include/abg-comparison.h (diff::get_class_of_equiv_category): Declare new member function. * src/abg-comparison.cc: Update copyright year. (diff::get_class_of_equiv_category): Define new member function. (suppression_categorization_visitor::visit_end): When considering children nodes category for propagation, consider the category of the class of equivalence of children nodes. * spice-debuginfo-0.12.4-19.el7.x86_64.rpm: New input test package. * spice-debuginfo-0.12.8-1.el7.x86_64.rpm: Likewise. * spice-server-0.12.4-19.el7.x86_64.rpm: Likewise. * spice-server-0.12.8-1.el7.x86_64.rpm: Likewise. * spice-server-devel-0.12.4-19.el7.x86_64.rpm: Likewise. * spice-server-devel-0.12.8-1.el7.x86_64.rpm: Likewise. * spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-0.txt: New reference test output. * spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-1.txt: Likewise. * spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: Likewise. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the new test inputs to the list of packages to test. 2017-01-18 Dodji Seketeli Bug 21058 - abipkgdiff wrongly drops non-public types * doc/manuals/abidiff.rst (--dont-drop-private-types): Remove documentation. (--drop-private-types): Document this new option. * src/abg-tools-utils.cc: Update copyright notice (handle_fts_entry): On the generated suppression specification, do not set the flag to drop matched types. Also, don't match types defined in files which patch start with "/usr/include/". * tools/abidiff.cc (options::options): Initialize the drop_private_types data member to false. (display_usage): Remove usage string for --dont-drop-private-types. Add a new one for --drop-private-types. (parse_command_line): Don't part --dont-drop-private-types, rather, parse --drop-private-types. (set_suppressions): When the suppression for private types is generated, if --drop-private-types was provided, then instruct the suppression to drop matched types. * tools/abipkgdiff.cc (options::drop_private_types): New option. (options::options): Initialize the new drop_private_types data member to false. (display_usage): Add a usage string for --drop-private-types. (parse_command_line): Parse the new --drop-private-types option. (maybe_create_private_types_suppressions): Don't take just a package, but a package_descriptor because the latter carries the options. So when the user used the --drop-private-types option, make the generated private types suppression to drop matched types. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Adjust. * tests/test-diff-suppr.cc (in_out_specs): Likewise. 2017-01-18 Dodji Seketeli Fix some include logic in abg-suppression.cc * src/abg-suppression.cc: Update copyright notice. Fix include files logic. 2017-01-16 Dodji Seketeli Support virtual member functions with vtable offset not yet set * include/abg-fwd.h (member_function_has_vtable_offset): Declare new function. (get_member_function_vtable_offset): Return a ssize_t, not a size_t. (set_member_function_vtable_offset): Take a ssize_t, not a size_t. * include/abg-ir.h (class_decl::virtual_mem_fn_map_type): Adjust the map typedef to make it take ssize_t as the type of the key. (mem_fn_context_rel::vtable_offset_in_bits_): Make this data member be of ssize_t type, not size_t. (mem_fn_context_rel::mem_fn_context_rel): Initialize the vtable_offset_in_bits_ data member to -1. * src/abg-ir.cc (member_function_has_vtable_offset): Define new function. (get_member_function_vtable_offset): Return a ssize_t, not a size_t. (set_member_function_vtable_offset): Take a ssize_t, not a size_t. * src/abg-dwarf-reader.cc (die_virtual_function_index): Take an int64_t& rather than a uint64_t&. (finish_member_function_reading): Don't set the vtable offset if it's -1. * src/abg-reader.cc (build_class_decl): Likewise. 2017-01-14 Dodji Seketeli [comparison engine] Don't crash when the context is null * src/abg-comparison.cc (RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER): Guard against null context. (diff::is_filtered_out): Likewise. 2017-01-14 Dodji Seketeli [dwarf reader] Don't abort when trying to canonicalize a non-type * src/abg-dwarf-reader.cc (maybe_canonicalize_type): Don't abort when trying to canonicalize a decl. 2017-01-14 Dodji Seketeli [dwarf reader] properly separate function decls and types in lookup * src/abg-dwarf-reader.cc (read_context::associate_die_to_artifact_by_repr_internal): Choose the right type of representation depending on if we are associating a type or a decl. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Adjust. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2017-01-14 Dodji Seketeli [dwarf reader] Allow updating and de-duplicating member functions * src/abg-dwarf-reader.cc (add_or_update_class_type): Register member functions for lookup by member function DIE representation. 2017-01-14 Dodji Seketeli [dwarf reader] Do not over de-duplicate function *definitions* * src/abg-dwarf-reader.cc (build_or_get_fn_decl_if_not_suppressed): Do try to de-duplicate a function if it's to be completed. 2017-01-13 Dodji Seketeli [dwarf reader] Fix pretty printing static methods from DWARF * src/abg-dwarf-reader.cc (die_return_and_parm_names_from_fn_type_die): Take a new 'is_static' parameter. (die_qualified_type_name, die_pretty_print_type): Adjust calling die_return_and_parm_names_from_fn_type_die. (die_function_signature): Likewise. Also, do not forget to print the first parameter for a static method. 2017-01-13 Dodji Seketeli Handle several virtual member functions having the same vtable offset * include/abg-ir.h (class_or_union::virtual_mem_fn_map_type): Define new typedef. (class_decl::get_virtual_mem_fns_map): Declare new accessor. * src/abg-ir.cc (class_decl::priv::virtual_mem_fns_map_): New data member. (class_decl::get_virtual_mem_fns_map): Define new accessor. (fixup_virtual_member_function): Populate the new virtual member functions map. (class_decl::on_canonical_type_set): Sort the virtual member function vectors stored in the new virtual member functions map. (class_decl::add_member_function): Call set_member_function_is_virtual *after* calling set_member_function_vtable_offset because the former updates the virtual function map, so it needs the vtable offset. * src/abg-dwarf-reader.cc (finish_member_function_reading): Likewise. * src/abg-reader.cc (build_class_decl): Likewise. 2017-01-13 Dodji Seketeli Speed up pretty representing (function) types * include/abg-ir.h (type_base::get_cached_pretty_representation): Declare new function. (function_type::get_cached_name): Likewise. * src/abg-ir.cc (get_method_type_name): Use the new type_base::get_cached_pretty_representation function. (type_base::priv::{internal_cached_repr_, cached_repr_}): Add new data members. (function_type::priv::{internal_cached_name_, cached_name_}): Likewise. (type_base::get_cached_pretty_representation): Define new function. (function_type::get_cached_name): Likewise. (type_base::get_canonical_type_for): Call type_base::get_cached_pretty_representation here, so the internal representation is cached right before canonicalization. (function_type::{mark_as_being_compared, unmark_as_being_compared, comparison_started}): Uset he new type_base::get_cached_name to speed up function type name retrieval. 2017-01-13 Dodji Seketeli Add missing deep comparison operators for {function, method}_decl_sptr * include/abg-ir.h (operator==): Declare two new overloads for function_decl_sptr an method_decl_sptr. * src/abg-ir.cc (operator==): Define two new overloads for function_decl_sptr an method_decl_sptr. 2017-01-16 Dodji Seketeli Fix performance regression while analyzing libjvm.so * include/abg-ir.h ({type_base, class_decl}::on_canonical_type_set): Declare new virtual member function. * src/abg-ir.cc (type_base::on_canonical_type_set): Define new virtual member function that does nothing. (class_decl::on_canonical_type_set): Define new virtual member function that sorts the virtual member functions of class_decl. (canonicalize): Invoke type_base::on_canonical_type_set when the canonical type is set. (fixup_virtual_member_function): Don't sort virtual member functions here. * src/abg-dwarf-reader.cc (finish_member_function_reading): Do not sort virtual member functions here. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. 2017-01-14 Dodji Seketeli Update copyright notice for abg-fwd.h, abg-ir.h and test-abidiff.cc * include/abg-fwd.h: Adjust copyright. * include/abg-ir.h: Likewise. * tests/test-abidiff.cc: Likewise. 2017-01-16 Dodji Seketeli Remove unused functions from abg-ir.cc * src/abg-ir.cc (convert_node_to_decl): Remove specializations for class_decl_sptr, type_base_sptr and var_decl_sptr. 2016-11-10 Dodji Seketeli Support Linux Kernel ABI whitelist files * include/abg-suppression.h (function_suppression::function_suppression): Make the declaration of the default constructor public. * src/abg-suppression-priv.h (function_suppression::priv::priv): Declare a default constructor. * src/abg-suppression.cc (function_suppression::function_suppression): Define default constructor. * include/abg-tools-utils.h (gen_suppr_spec_from_kernel_abi_whitelist): Declare new function. * src/abg-tools-utils.cc (gen_suppr_spec_from_kernel_abi_whitelist): Define new function. * tools/abidiff.cc (options::kernel_abi_whitelist_paths): (display_usage): Display a help string for the new --linux-kernel-abi-whitelist option. (parse_command_line): Parse the --linux-kernel-abi-whitelist from the command line. (maybe_check_suppression_files): Check the presence of the kernel abi whitelist files. (set_suppressions): Generate suppression specifications from the whitelist files. 2016-10-10 Dodji Seketeli Support Linux Kernel binaries * include/abg-dwarf-reader.h (create_read_context): Take a new flag to say if the context is to read an ELF binary in linux kernel mode. * src/abg-dwarf-reader.cc (typedef address_set_type) (address_set_sptr): New typedefs. (get_binary_load_address): The load address of the binary is the load address specified by the program header that is at the smallest offset; not by the program header that is at offset zero. (read_context::{ksymtab_section_, ksymtab_gpl_section_, linux_exported_fn_syms_, linux_exported_var_syms_, linux_exported_gpl_fn_syms_, linux_exported_gpl_var_syms_, load_in_linux_kernel_mode_}): New data members. (read_context::read_context): Initialize ksymtab_section_, ksymtab_gpl_section_ and load_in_linux_kernel_mode_. (read_context::{find_symbol_table_section, find_opd_section, lookup_elf_fn_symbol_from_address, lookup_elf_var_symbol_from_address, get_function_address, get_variable_address}): Make these const. (read_context::{find_ksymtab_section, find_ksymtab_gpl_section, lookup_elf_symbol_from_address, function_symbol_is_exported, variable_symbol_is_exported, linux_exported_fn_syms, create_or_get_linux_exported_fn_syms, linux_exported_var_syms, create_or_get_linux_exported_var_syms, linux_exported_gpl_fn_syms, linux_exported_gpl_var_syms, create_or_get_linux_exported_gpl_fn_syms, linux_exported_gpl_var_syms, create_or_get_linux_exported_gpl_var_syms, architecture_word_size, load_kernel_symbol_table, load_ksymtab_symbols, load_ksymtab_gpl_symbols, load_linux_specific_exported_symbol_maps, load_in_linux_kernel_mode}): New member functions. (read_context::read_int_from_array_of_bytes): Factorize this new member function out of ... (read_context::{lookup_ppc64_elf_fn_entry_point_address}): ... this. Make this function const too. (read_context::read_uint64_from_array_of_bytes): New function. Uses read_int_from_array_of_bytes above. (read_context::{fun_entry_addr_sym_map_sptr}): Try to load symbol maps only when it's necessary. (read_context::elf_architecture_is_big_endian): Fix logic. (read_context::{var_addr_sym_map}): Express the const variant in terms of the non-const one. In the non-const one, load the map only when necessary. (read_context::load_symbol_maps_from_symtab_section): Renamed load_symbol_maps into this. (read_context::is_linux_kernel_binary): Define new member function. (read_context::{function, variable}_symbol_is_exported): If we are not prevented from considering loading in linux kernel mode, then just looking at a linux kernel binary makes us consider the special kernel sections. (read_debug_info_into_corpus): Likewise. (build_ir_node_from_die): Take a new flag that says if the ir node is a declaration required by another concrete IR node. (enum read_context::kernel_symbol_table_kind): New enum. (read_context::load_symbol_maps): Support loading linux kernel specific sections too. (build_var_decl): Use the new read_context::variable_symbol_is_exported. (function_is_suppressed): Suppress non-member functions or variables that are not declarations and that have no symbol. (variable_is_suppressed, build_var_decl_if_not_suppressed): Take a new flag that says if the variable is a declaration required by a concrete variable. If non member variable that is a declaration is not the specification of another concrete variable, then it's suppressed. (add_fn_symbols_to_map, add_var_symbols_to_map): New function definitions. (read_debug_info_into_corpus): If we are reading linux kernel or linux kernel modules, only set explicitely exported symbols (in the linux kernel binary sense) as exported function or variable symbols. (create_read_context): Take a new flag to say if the context is to read an ELF binary in linux kernel mode. * tools/abidiff.cc (options::options): Initialize options::linux_kernel_mode to true. (display_usage): Display usage of the --no-linux-kernel-mode option. (parse_command_line): Parse the --no-linux-kernel-mode option. * tools/abidw.cc (options::options): Initialize options::linux_kernel_mode to true. (display_usage): Display usage of --no-linux-kernel-mode option. (parse_command_line): Parse the --no-linux-kernel-mode option. * doc/manuals/abidiff.rst: Document the new --no-linux-kernel-mode options. * doc/manuals/abidw.rst: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/libtest23.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust. 2017-01-06 Dodji Seketeli Add debug routines to dump locations to a stream * src/abg-writer.cc (dump_location): Define new function and one overload. (dump_decl_location): Re-write in terms of the new dump_location. 2017-01-06 Dodji Seketeli Better de-duplicate classes, unions, enums in non-odr contexts * src/abg-dwarf-reader.cc (build_enum_type) (add_or_update_class_type, add_or_update_union_type): When the ODR is not relevant, use the location of the type to detect if two enum, class or union types of the same name actually represent the same type. 2017-01-06 Dodji Seketeli Adjust some reference outputs of the test-read-dwarf test harness * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2017-01-04 Ondrej Oprala Bug 18754 - Add the "--no-added-syms" option to abidiff * doc/manuals/abidiff.rst: Document the new --no-added-syms option. * tools/abidiff.cc (struct options): Add show_added_syms and set it to true by default. (display_usage): Document the new options --no-added-syms. If this is the only suppression option specified, it is equivalent to specifying --show_{changed,deleted}_{fns,vars} as arguments to abidiff. If any of those options are specified before --no-added-syms, then it has no effect. (parse_command_line): Parse the new option and set show_added_{fns,vars,syms} and show_all_{fns,vars} to false if --no-added-syms is specified. * tests/test-diff-filter.cc: Add a test for the new option. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt: Reference results for the new test. * tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt: Likewise. * tests/data/Makefile.am: Add the above test files to the list of test data. 2017-01-05 Dodji Seketeli Update copyright year on a bunch of files * include/abg-corpus.h: Update copyright year to 2017. * src/abg-dwarf-reader.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-writer.cc: Likewise. * tools/abicompat.cc: Likewise. * tools/abidw.cc: Likewise. 2017-01-05 Dodji Seketeli [apidoc] Allow brief description at the top of class description pages * doc/api/libabigail.doxy: Don't disable "brief member desc". 2017-01-05 Dodji Seketeli Misc style fixes * include/abg-corpus.h: Remove corpus_sptr typedef. It's in abg-fwd.h now. * src/abg-ir.cc: Remove some unnecessary vertical space. * src/abg-reader.cc (build_function_decl): Cleanup some asserts. * src/abg-writer.cc (write_function_type): Each the inspection of the type id from within the debugger. 2017-01-05 Dodji Seketeli Misc comments and apidoc fixes * src/abg-dwarf-reader.cc (lookup_symbol_from_gnu_hash_tab): Fix typo in comment. * tools/abicompat.cc (perform_compat_check_in_weak_mode): Better comments. * tools/abidw.cc (dislay_usage): Fix white spaces. Conflicts: tools/abidw.cc 2017-01-05 Dodji Seketeli Speedup set_member_is_static * src/abg-ir.cc (set_member_is_static): When comparing data members, consider only their names. 2017-01-05 Dodji Seketeli Avoid unnecessary updates to type lookup maps * src/abg-ir.cc (class_or_union::get_is_declaration_only): Try to update the type maps only when a declaration-only class type is now defined. 2017-01-05 Dodji Seketeli Update tests/data/test-read-dwarf/*.abi files * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2017-01-05 Dodji Seketeli Update tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Update. 2017-01-05 Dodji Seketeli [abixml writer] Make sure all function types are emitted * src/abg-writer.cc (write_translation_unit): Fix logic to avoid forgetting referenced function types. 2017-01-05 Dodji Seketeli [abixml writer] Fix comparison of pointer to types * src/abg-writer.cc (type_ptr_comp::operator()): Do not add an empty type id string to the type -> type id map when the entry for a given type is empty. 2017-01-05 Dodji Seketeli [dwarf-reader] Don't early canonicalize function types * src/abg-dwarf-reader.cc (maybe_canonicalize_type): Late-canonicalize function types. signed-off-by: Dodji Seketeli 2017-01-05 Dodji Seketeli Fix qualified name caching for some types * src/abg-ir.cc ({qualified, pointer, array}_type_def::get_qualified_name): Don't cache internal and non-internal qualified name when the type is not canonicalized. 2017-01-04 Dodji Seketeli Cleanup ODR-based type canonicalization optimization gating logic * src/abg-ir.cc (type_base::get_canonical_type_for): Make it clear that the ODR-based optimization is allowed only on C++ ABI corpora. 2017-01-04 Dodji Seketeli Fix a typo in method name computation * src/abg-ir.cc (get_method_type_name): Really return the method name. 2017-01-05 Dodji Seketeli Update tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Adjust. 2017-01-05 Dodji Seketeli Update tests/data/test-read-write/test27.xml * tests/data/test-read-write/test27.xml: Adjust. 2017-01-04 Dodji Seketeli [dwarf-reader] Handle per translation-unit type de-duplication * src/abg-dwarf-reader.cc (read_context::per_tu_name_artefacts_map_): New data member. (read_context::clear_per_translation_unit_data): Clear the new read_context::per_tu_name_artefacts_map_. (read_context::associate_die_to_decl): Take a flag to say if we should associate a DIE to its representation and another one to say if the association should be done per-tu or per-corpus. (read_context::lookup_{type_artifact, artifact}_from_die): Update apidoc. (read_context::lookup_artifact_from_die_representation): Likewise. (read_context::{associate_die_to_artifact_by_repr, associate_die_to_artifact_by_repr_internal, associate_die_to_type}): Take a flag to say if the associating should be done on a per-tu basis. (read_context::lookup_{type_artifact, artifact}_from_die_per_tu): New member functions. (read_context::{lookup_artifact_from_per_tu_die_representation, odr_is_relevant}): Likewise. (build_enum_type, add_or_update_class_type) (add_or_update_union_type): If ODR is not relevant, do not perform per-corpus de-duplication. (build_pointer_type_def, build_typedef_type): Do not associate the type to its representation as these kinds of typs are not de-duplicated. (build_function_type): If ODR is not relevant, perform per-tu de-duplication. When ODR is relevant, per-corpus de-duplication is performed. (build_or_get_fn_decl_if_not_suppressed): Function decls are always de-duplicated per-corpus. (build_ir_node_from_die): For data members, do not update the die representation map as data members are not de-duplicated. Do not do it for function decls either. [1]: https://en.wikipedia.org/wiki/One_Definition_Rule 2017-01-02 Dodji Seketeli Handle per translation unit and per corpus types maps * include/abg-fwd.h (lookup_type_in_corpus): Remove. This is to be replaced by the new lookup_type below. (lookup_{basic, class, union, enum, typedef, qualified, pointer, reference, array, function, class_or_typedef, class_typedef_or_enum}_type): (lookup_class_type_through_scopes, lookup_type) (lookup_type_through_scopes, lookup_or_synthesize_fn_type) * src/abg-ir-priv.h (struct translation_unit::priv): Move this private type here, from abg-ir.h. (synthesize_type_from_translation_unit): Declare new functions. * include/abg-ir.h (class type_maps): Define new type. (translation_unit::get_function_types): Remove. (translation_unit::get_types): Now return a type_maps. (translation_unit::get_live_fn_types): Declare new type. (class decl_base): Make canonicalize be a friend of this class. * src/abg-ir.cc (struct translation_unit::priv): Move this to abg-ir-priv.h (struct type_maps::priv): Define new type. (type_maps::{basic, class, union, enum, typedef, qualified, pointer, reference, array, function}_types): Define new accessors. (translation_unit::bind_function_type_life_time): Adjust. (translation_unit::get_function_types): Remove accessor. (translation_unit::get_types, get_live_fn_types): Define new accessors. (lookup_type_in_translation_unit) (lookup_class_type_in_translation_unit) (lookup_function_type_in_translation_unit) (synthesize_type_from_translation_unit) (synthesize_function_type_from_translation_unit) (lookup_class_type_in_translation_unit) Remove function definitions. (lookup_type_in_map): Define function template. (lookup_{basic, class, union, typedef, class_or_typedef, class_typedef_or_enum, qualified, pointer, reference, array, function}_type): Define functions. (lookup_function_type, lookup_type_through_scopes) (lookup_class_type_through_scopes) (lookup_basic_type_through_translation_units) (lookup_union_type_through_translation_units) (lookup_enum_type_through_translation_units) (lookup_class_type_through_translation_units) (lookup_typedef_type_through_translation_units) (lookup_qualified_type_through_translation_units) (lookup_pointer_type_through_translation_units) (lookup_reference_type_through_translation_units) (lookup_array_type_through_translation_units) (lookup_function_type_through_translation_units) (lookup_type_through_translation_units) (lookup_or_synthesize_fn_type, lookup_type): Likewise. (maybe_update_types_lookup_map) (maybe_update_types_lookup_map) (maybe_update_types_lookup_map): Define function template, specilizations and functions. (synthesize_type_from_translation_unit) (synthesize_function_type_from_translation_unit): Define functions. * include/abg-corpus.h (corpus::get_types): Declare new accessor. * src/abg-corpus.cc (corpus::priv::get_types): Define new accessor. (corpus::get_types): Likewise. (lookup_type_in_corpus, lookup_class_type_in_corpus) (lookup_type_in_corpus, lookup_function_type_in_corpus) (maybe_update_types_lookup_map) (maybe_update_types_lookup_map) (maybe_update_types_lookup_map): Remove. (lookup_{basic, class, union, enum, typedef, qualified, pointer, reference, array, function, class_or_typedef, class_typedef_or_enum}_type): Likewise. * src/abg-corpus-priv.h (corpus::priv::{basic, class, union, typedef, qualified, pointer, reference, array, function}_types): Remove these data members. (corpus::priv::get_scopes): Remove member function. (corpus::priv::get_{basic, class, union, enum, typedef, qualified, pointer, reference, array, function}_types): Remove member function declarations. (corpus::priv::types_): New data member. (corpus::priv::get_types): Declare new member function. (lookup_{basic, class, enum, typedef, class_or_typedef, qualified, pointer, reference, array, function}_type): Declare new functions. * src/abg-dwarf-reader.cc (read_context::resolve_declaration_only_classes) (build_translation_unit_and_add_to_ir): Adjust use of lookup_class_type. * src/abg-reader.cc (read_context::type_is_from_translation_unit): Adjust to the use of lookup_function_type_in_translation_unit that got renamed into lookup_function_type. * src/abg-writer.cc (type_ptr_cmp::operator()): New operator implementation. (read_context::sort_type): Add new overloads. (write_translation_unit): Adjust to get the function types from the new translation_unit::get_live_fn_types and sort them. * tools/abicompat.cc (perform_compat_check_in_weak_mode): Adjust to use the new lookup_or_synthesize_fn_type, in lieu of lookup_function_type_in_corpus. Adjust to use lookup_type in lieu of lookup_type_in_corpus. 2016-12-21 Dodji Seketeli Make abg-fwd.h use *_sptr typedefs * include/abg-ir.h: Move convience typedef declarations and some necessary forward declarations to ... * include/abg-fwd.h: ... here. (is_enum_type, is_var_decl): Take a pointer to type_or_decl_base. (lookup_type_in_scope): Return a type_base_sptr. (lookup_type_through_scopes): Introduce this to later replace the overload of lookup_type_in_translation_unit that takes a list of strings. (lookup_type_in_scope): Return a type_base_sptr, not a decl_base_sptr. * src/abg-ir.cc (lookup_type_in_scope, lookup_node_in_scope) (lookup_var_decl_in_scope): Adjust. (is_enum_type, is_var_decl): Take a pointer to type_or_decl_base. (lookup_node_in_scope): Return a type_or_decl_base_sptr. (lookup_type_in_scope): Return a type_base_sptr. (lookup_node_in_translation_unit): Return a type_or_decl_base_sptr. (lookup_type_through_scopes): Replace lookup_type_in_translation_unit. 2016-12-18 Chenxiong Qi Fix wrong variable name * tools/fedabipkgdiff: (diff_latest_rpms_based_on_distros): Fix wrong variable name distro. 2016-12-18 Chenxiong Qi Warn properly when cannot find peer RPM * tools/fedabipkgdiff: (RPMCollection.get_peer_rpm): Return None when cannot find peer RPM due to nonexistent arch. 2016-12-19 Chenxiong Qi Read Koji config via Koji API * tools/fedabipkgdiff: Read DEFAULT_KOJI_TOPURL and DEFAULT_KOJI_SERVER from Koji config via Koji API read_config. (build_commandline_args_parser): --topdir is renamed to --topurl. * doc/manuals/fedabipkgdiff.rst: Rename --topdir to --topurl. 2016-12-19 Chenxiong Qi Follow moved packages when download * tools/fedabipkgdiff: (download_rpm) Add --location to curl CLI. 2016-12-13 Chenxiong Qi More document for local RPMs comparison * doc/manuals/fedabipkgdiff.rst: Add more document for local RPMs comparison. Also fixed a typo. 2016-12-15 Ondrej Oprala Properly report missing files for abipkgdiff * tools/abipkgdiff.cc: (class options): Add the "nonexistent_file" flag (parse_command_line): Check if the files given exist. (main): Check the nonexistent_file flag. If any of the input files don't exist, report it and exit. Also, for present and future test uniformity, only show the base names of the packages when using their names in error output. * tests/test-diff-pkg.cc: Add a new regression test. * tests/data/test-diff-pkg/test-nonexistent-report-0.txt: The expected output of the above regression test. * tests/data/Makefile.am: Add the above file to the list. 2016-12-15 Dodji Seketeli Misc style cleanup * src/abg-dwarf-reader.cc (build_function_type): Remove unnecessary new line. 2016-12-15 Dodji Seketeli make is_anonymous_type work for unions and classes * src/abg-ir.cc (is_anonymous_type): Make this work for class or union types, no only classes. 2016-12-15 Dodji Seketeli Naming typedefs of classes are not read properly from abixml * src/abg-reader.cc (build_class_decl): Use read_context::build_or_get_type_decl rather than read_context::get_type_decl to build the naming typedef referred to by the class being built. Move the handling of naming typedefs after the class is marked as WIP and keyed. 2016-12-15 Dodji Seketeli Don't early-canonicalize function types when reading abixml * src/abg-reader.cc (read_context::maybe_canonicalize_type): late-canonicalize function types too. 2016-12-12 Ondrej Oprala Check --enable-rpm dependencies more rigorously * configure.ac: Check if both rpm2cpio and cpio exist on the system. If not, disable the option and fail the configuration if --enable-rpm was specified explicitly. 2016-12-12 Ondrej Oprala abipkgdiff doesn't mention --no-default-suppression in help * tools/abipkgdiff.cc (display_usage): Mention --no-default-suppression as one of the options. 2016-12-12 Ondrej Oprala Fix a few remarks made by cppcheck * src/abg-comparison.cc (types_or_decls_equal::operator()): Pass arguments by reference. (class_diff::ensure_lookup_tables_populated): Expression !A || (A && B) can be reduced to !A || B. * src/abg-suppression.cc (suppression_matches_type_no_name): Likewise. 2016-12-09 Ondrej Oprala Bug 19272 - abipkgdiff doesn't report arch change * src/abg-comparison.cc (corpus_diff::has_incompatible_changes): The architecture change into account. (corpus_diff::has_net_changes): Take architecture and soname changes into account. * tools/abicompat.cc (perform_compat_check_in_normal_mode): Use corpus_diff::{has_net_changes, has_incompatible_changes}. * tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.armv7hl.rpm: New test input. * tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64--dbus-glib-0.104-3.fc23.armv7hl-report-0.txt: New test reference output. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-pkg.cc (in_out_spec): Compare the new package above against an x86_64 one. 2016-08-11 Chenxiong Qi Bug 20380 - Compare two local RPMs * configure.ac: add dependent mimetype module. * doc/manuals/fedabipkgdiff.rst: Update to add document for the new use case of comparing two local RPMs. * tests/data/Makefile.am: Include new RPMs for tests. * tests/data/test-fedabipkgdiff/dbus-glib/dbus-glib-0.100.2-2.fc20.x86_64.rpm: New RPM for running test. * tests/data/test-fedabipkgdiff/dbus-glib/dbus-glib-0.106-1.fc23.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/nss-util/nss-util-3.12.6-1.fc14.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/nss-util/nss-util-3.24.0-2.0.fc25.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/nss-util/nss-util-devel-3.24.0-2.0.fc25.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/test4-glib-0.100.2-2.fc20.x86_64.rpm-glib-0.106-1.fc23.x86_64.rpm-report-0.txt: Rename filename by adding .rpm extension. * tests/data/test-fedabipkgdiff/test5-same-dir-dbus-glib-0.100.2-2.fc20.x86_64--dbus-glib-0.106-1.fc23.x86_64-report-0.txt: New reference output for testing comparing local RPMs. * tests/data/test-fedabipkgdiff/test6-missing-devel-debuginfo-nss-util-3.12.6-1.fc14.x86_64--nss-util-3.24.0-2.0.fc25.x86_64-report-0.txt: New reference output for testing comparison without non-existent debuginfo or development package. * tests/runtestfedabipkgdiff.py.in (FEDABIPKGDIFF_TEST_SPECS): Rename filename for test4. Add two new test cases. (run_fedabipkgdiff_tests): Remove semicolon and trailing whitespaces. (main): Likewise. (ensure_output_dir_created): Likewise. * tools/fedabipkgdiff: Require some new modules. Fix of return code. (PkgInfo): Renamed to ComparisonHalf. (match_nvr): New method to determine if a string matches format of N-V-R. (match_nvra): New method to determine if a string matches format of N-V-R.A. (is_rpm_file): New method to guess if a file is a RPM file. (RPM.is_peer): New method to determine if current RPM is a peer of another. (RPM.filename): Use Koji module API to construct the filename. (RPM.nvra): Get nvra from filename instead of constructing manually that is duplicated with Koji module API. (RPMCollection): New class to represent a set of RPMs. (generate_pkg_info_pair_for_abipkgdiff): New method working as a generator to yeild comparison halves for running abipkgdiff. (Brew.getRPM): Fix string format with incorrect argument. (Brew.select_rpms_from_a_build): Return instance of RPMCollection. (abipkgdiff): If there is no debuginfo or development package, just ignore it and leave a warning. If --error-on-warning is specified, raise an exception instead. Arguments are modified to represent the new name ComparisonHalf, and relative docstring is also updated. (magic_construct): Removed. (run_abipkgdiff): Rewrite. (make_rpms_usable_for_abipkgdiff): Removed. (diff_local_rpm_with_latest_rpm_from_koji): Rewrite by using RPMCollection. (diff_latest_rpms_based_on_distros): Likewise. (diff_two_nvras_from_koji): Likewise. (diff_from_two_rpm_files): New method to compare two local RPMs. (build_commandline_args_parser): Add new option --error-on-warning. (main): Add support to compare local RPMs. 2016-12-12 Dodji Seketeli Fix template_decl::hash::operator() * src/abg-hash.cc (template_decl::hash::operator()): Combine the contribution of the qualified name to the contribution of the type name to the hash. 2016-12-09 Dodji Seketeli Fix aborting when reading .foo symbols from a ppc64 binary * abg-dwarf-reader.cc (read_context::find_opd_section): Fix comment. (read_context::load_symbol_maps): If for a given function entry point (that we got by looking at the ".opd" section for a given function pointer value) we already had an entry in the function_entry_address -> symbol, maybe it means that the previous entry that we had was from an entry in the symbol table which value was directly the entry point address of a function. In that case, if the name of the symbol is "foo", the name of the symbol which value is directly the entry point address is ".foo". What we do in this case is that we just keep the reference to the "foo" symbol in the function_entry_address -> symbol map. (read_context::address_is_in_opd_section): Define new member function. * tests/data/test-diff-pkg/gmp-4.3.1-10.el6.ppc64.rpm: New test input. * tests/data/test-diff-pkg/gmp-4.3.1-7.el6_2.2.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/gmp-debuginfo-4.3.1-10.el6.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/gmp-debuginfo-4.3.1-7.el6_2.2.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/gmp-4.3.1-7.el6_2.2.ppc64--gmp-4.3.1-10.el6.ppc64-report-0.txt: New test reference output. * tests/data/Makefile.am: Add the new test input and reference output to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the new test inputs and reference output to the set of inputs that are compared. 2016-12-05 Dodji Seketeli Bug 20927 - Segfault when $HOME is not set * src/abg-tools-utils.cc (get_default_user_suppression_file_path): Handle the case where the HOME environment variable is not set. * tools/abipkgdiff.cc (package::extracted_packages_parent_dir): Likewise. When $HOME is empty set then use $TMPDIR. If it's empty too then use "/tmp". 2016-12-02 Dodji Seketeli Bug 20887 - Show relative change of offsets * doc/manuals/abidiff.rst: Document the new --no-show-relative-offset-changes. * doc/manuals/abipkgdiff.rst: Likewise. * include/abg-comparison.h (diff_context::show_relative_offset_changes): New accessors. * include/abg-ir.h ({set,get}_data_member_offset): Return uint64_t instead of the less portable size_t. * src/abg-comparison.cc (diff_context::priv::show_relative_offset_changes_): New data member. (dif_context::show_relative_offset_changes): Define accessor. (maybe_show_relative_offset_change): Define new function. (represent): In the overload for var_diff, call the new maybe_show_relative_offset_change. (report_size_and_alignment_changes): If the size of the type didn't change then say it now. * src/abg-ir.cc (set_data_member_offset, get_data_member_offset): Take or return a uint64_t instead of a size_t. * tools/abidiff.cc (options::show_relative_offset_changes): New data member. (options::options): Initialize it. (display_usage): Display help string for the new --no-show-relative-offset-changes. (parse_command_line): Parse the new --no-show-relative-offset-changes options. (set_diff_context_from_opts): Set the "show-relative-offset-changes" flag according to the new option.n * tools/abipkgdiff.cc (options::show_relative_offset_changes): New data member. (options::options): Initialize it. (display_usage): Add help string for the new --no-show-relative-offset-changes option. (set_diff_context_from_opts): Set the "show-relative-offset-changes" flag according to the new option. (parse_command_line): Parse the new command line option. * tests/data/test-diff-dwarf/test40-report-0.txt: Add new reference output. * tests/data/test-diff-dwarf/test40-v0.c: Source code of the first test binary. * tests/data/test-diff-dwarf/test40-v1.c: Source code of the second test binay. * tests/data/test-diff-dwarf/libtest40-v0.so: New first test binary. * tests/data/test-diff-dwarf/libtest40-v1.so: New second test binary. * tests/test-diff-dwarf.cc (in_out_spec): Add the new test binaries above to the set of binaries that are compared. * tests/data/Makefile.am: Add the new test material to source distribution. * tests/data/test-abicompat/test7-fn-changed-report-0.txt: Adjust. * tests/data/test-abidiff/test-PR18791-report0.txt: Likewise. * tests/data/test-abidiff/test-enum0-report.txt: Likewise. * tests/data/test-abidiff/test-enum1-report.txt: Likewise. * tests/data/test-abidiff/test-struct1-report.txt: Likewise. * tests/data/test-diff-dwarf/test0-report.txt: Likewise. * tests/data/test-diff-dwarf/test1-report.txt: Likewise. * tests/data/test-diff-dwarf/test10-report.txt: Likewise. * tests/data/test-diff-dwarf/test11-report.txt: Likewise. * tests/data/test-diff-dwarf/test13-report.txt: Likewise. * tests/data/test-diff-dwarf/test15-enum-report.txt: Likewise. * tests/data/test-diff-dwarf/test27-local-base-diff-report.txt: Likewise. * tests/data/test-diff-dwarf/test32-fnptr-changes-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test33-fnref-changes-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test38-union-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test4-report.txt: Likewise. * tests/data/test-diff-dwarf/test5-report.txt: Likewise. * tests/data/test-diff-dwarf/test6-report.txt: Likewise. * tests/data/test-diff-dwarf/test8-report.txt: Likewise. * tests/data/test-diff-filter/test0-report.txt: Likewise. * tests/data/test-diff-filter/test01-report.txt: Likewise. * tests/data/test-diff-filter/test1-report.txt: Likewise. * tests/data/test-diff-filter/test13-report.txt: Likewise. * tests/data/test-diff-filter/test16-report-2.txt: Likewise. * tests/data/test-diff-filter/test16-report.txt: Likewise. * tests/data/test-diff-filter/test17-0-report.txt: Likewise. * tests/data/test-diff-filter/test17-1-report.txt: Likewise. * tests/data/test-diff-filter/test18-report.txt: Likewise. * tests/data/test-diff-filter/test19-enum-report-1.txt: Likewise. * tests/data/test-diff-filter/test2-report.txt: Likewise. * tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt: Likewise. * tests/data/test-diff-filter/test24-compatible-vars-report-1.txt: Likewise. * tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: Likewise. * tests/data/test-diff-filter/test25-cyclic-type-report-1.txt: Likewise. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-0.t: Likewise.xt * tests/data/test-diff-filter/test26-qualified-redundant-node-report-1.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt: Likewise. * tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt: Likewise. * tests/data/test-diff-filter/test3-report.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Likewise. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Likewise. * tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt: Likewise. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Likewise. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-7.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test10-changed-parm-c-report-0.txt: Likewise. * tests/data/test-diff-suppr/test2-struct-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test23-alias-filter-report-0.txt: Likewise. * tests/data/test-diff-suppr/test23-alias-filter-report-2.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test30-report-0.txt: Likewise. * tests/data/test-diff-suppr/test4-local-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test4-local-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-8.txt: Likewise. 2016-12-02 Dodji Seketeli Rename tests/update-test-read-dwarf-output.py * tests/update-test-output.py: renamed tests/update-test-read-dwarf-output.py into this. Update its comments. Make this script executable. 2016-11-30 Dodji Seketeli Add tests/data/test-diff-suppr/test33-report-0.txt to tarball * tests/data/Makefile.am: Add test-diff-suppr/test33-report-0.txt. 2016-11-30 Dodji Seketeli Bug 20670 - abipkgdiff aborts if $XDG_CACHE_HOME does not exist * tools/abipkgdiff.cc (package::extracted_packages_parent_dir): Ensure that the cache directory is created, even when XDG_CACHE_HOME is set. Also, remove the now useless "using abigail::tools_utils::get_random_number_as_string" statement. 2016-11-09 Dodji Seketeli Very light speed improvements * include/abg-comp-filter.h (has_harmless_name_change): Pass smart pointers by reference. * src/abg-comp-filter.cc (access_changed) (function_name_changed_but_not_symbol) (non_static_data_member_type_size_changed) (static_data_member_type_size_changed, is_compatible_change) (decl_name_changed, has_harmless_name_change): Pass smart pointers by reference. * include/abg-ir.h (decl_base::set_context_rel): Take a bare pointer, not a smart pointer. * src/abg-ir.cc (decl_base::priv::context_): Make this data member be a naked pointer, not a smart pointer. (decl_base::priv::priv): Initialize it. (decl_base::priv::~priv): New constructor. (decl_base::{get_context_rel, set_scope}): Adjust. (class_decl::method_decl::{method_decl, set_scope}): Likewise. (equals): In the overload for var_decl, compare the type of the var first as that might be faster (to detect var_decls with different types) in the general case where types are canonicalized. 2016-11-08 Dodji Seketeli Introduce on-the-fly type canonicalization * include/abg-ir.h (environment::do_on_the_fly_canonicalization): Declare new member functions. ({type_base, function_type}::priv_): Make this public so that static non-member functions defined in abg-ir.cc can access it. * src/abg-ir.cc (environment::priv::do_on_the_fly_canonicalization_): New data member. (environment::priv::priv): Initialize it. (environment::do_on_the_fly_canonicalization): Define new member functions. (type_base::get_canonical_type_for): Trigger on-the-fly canonicalization during comparison of the type being canonicalized and an already canonicalized type. (types_are_being_compared, maybe_propagate_canonical_type): Define new static functions. (equals): In overloads for class_decl and function_type, call maybe_propagate_canonical_type when the two types compare equal. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2016-11-06 Dodji Seketeli Fix pretty representation of array types * include/abg-ir.h (array_type_def::is_infinite): Fix indentation. * src/abg-ir.cc (qualified_type_def::build_name): An empty set of sub-ranges for a vector is represented by "[]". (array_type_def::is_infinite): If a vector has no sub-range, that means it has an infinite size. Adjust comment. * tests/data/test-diff-filter/test33-report-0.txt: Adjust. * tests/data/test-read-dwarf/libtest23.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2016-10-11 Dodji Seketeli Support naming typedef and use them to speed up type canonicalization * include/abg-ir.h (typedef_decl_wptr): New typedef. (class_decl::{g,s}et_naming_typedef): Declare new member functions. * src/abg-dwarf-reader.cc (build_typedef_type): When the underlying type of a typedef is an anonymous class, the class type is said to have a naming typedef. * src/abg-ir.cc (is_anonymous_type): An anonymous class that has a naming typedef is said to not be anonymous anymore. (class_decl::priv::naming_typedef): New data member. (class_decl::{g,s}et_naming_typedef): Define new member functions. (class_decl::get_pretty_representation): When called for internal purposes (e.g, for type canonicalization) compute the pretty representation of the class by using its typedef name, when class is anonymous and has a naming typedef. * src/abg-reader.cc (build_class_decl): Read the new "naming-typedef-id" attribute. * src/abg-writer.cc (write_naming_typedef): New function. (write_class_decl_opening_tag): Use the new write_naming_typedef function. * tests/data/test-read-dwarf/libtest23.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2016-11-02 Dodji Seketeli Implement de-duplication for types and decls at DWARF loading time * include/abg-ir.h (method_type::priv_): Introduce new pimpl pointer here. (method_type::class_type_): Move this into the pimpl idiom. (method_type::method_type): Take a new is_const flag. (method_type::get_class_type): Make this method out-of-line. (method_type::{s,g}et_is_const): Declare new member functions. (get_method_type_name): Declare this function as a friend of the method_type type. * src/abg-dwarf-reader.cc: Include the new abg-ir-priv.h and abg-corpus-priv.h. (typedef die_tu_map_type): Fix comment. (typedef die_istring_map_type): New typedef. (class read_context::die_source_dependant_container_set): New class template. (read_context::{die_qualified_name_maps_, die_pretty_repr_maps_, die_pretty_type_repr_maps_}): Define new data members. (read_context::{get_die_qualified_name, get_die_qualified_name, get_die_qualified_type_name, get_die_pretty_type_representation, get_die_pretty_representation, lookup_type_artifact_from_die, lookup_artifact_from_die, lookup_artifact_from_die_representation, associate_die_to_artifact_by_repr, associate_die_to_artifact_by_repr_internal, lookup_type_from_die}): Define new member functions. (read_context::lookup_type_from_die_offset): Fix comment. (get_parent_die, get_scope_die, die_is_decl) (die_is_namespace, die_is_unspecified, die_is_void_type) (die_is_pointer_type, die_is_reference_type) (die_is_pointer_or_reference_type, die_is_class_type) (die_has_object_pointer, die_this_pointer_from_object_pointer) (die_this_pointer_is_const, is_decl_tag) (die_object_pointer_is_for_const_method, die_is_at_class_scope) (die_name, die_qualified_type_name, die_qualified_decl_name) (die_qualified_name, die_qualified_type_name_empty) (die_return_and_parm_names_from_fn_type_die) (die_function_signature, die_peel_qual_ptr) (die_function_type_is_method_type, die_pretty_print_type) (die_pretty_print_decl, die_pretty_print) (build_subranges_from_array_type_die) (build_or_get_fn_decl_if_not_suppressed) (lookup_class_or_typedef_type) (lookup_class_typedef_or_enum_type_from_corpus) (is_function_for_die_a_member_of_class) (add_or_update_member_function): Define new static functions. (read_context::associate_die_to_decl): Call associate_die_to_artifact_by_repr. (read_context::{associate_die_to_type, schedule_type_for_late_canonicalization}): Take just one "die" parameter rather than taking a die offset and a die source; adjust accordingly. (maybe_canonicalize_type): Likewise. (finish_member_function_reading): Take a const reference to function_decl_sptr. (die_loc_and_name): Use the new die_name function. (die_is_type): Rename is_type_die into this. (build_type_decl): Take a new "where_offset" parameter. Adjust. If a type of the same name as the one for the current DIE is is already present, do not create a new type; just return the already-existing one. (build_enum_type): Take a new "where_offset" parameter. Adjust. (finish_member_function_reading): Pass two smart pointers by const reference. Assert that the type of the member function is a method_type. Some light cleanups. (add_or_update_class_type): Rename build_class_type_and_add_to_ir. If a DIE defining the same class has already been seen, then return that class; don't construct any other internal representation for the same class. Better handle the updating of member data and functions. Do not duplicate member types. (build_qualified_type, build_pointer_type_def) (build_reference_type): Support de-duplication here. (build_function_type): Likewise. Support detection and building of method type. This also supports *const* method type building. (build_array_type): Use the new build_subranges_from_array_type_die. (build_type_decl): Cleanup logic. (build_or_get_var_decl_if_not_suppressed): Renamed build_var_decl_if_not_suppressed into this. Perform de-duplication for data members. (build_function_decl): Don't set an empty source location. If the function type cannot be constructed, do not construct the function decl either. Adjust. (build_ir_node_from_die): Adjust. When building a function for a DW_TAG_subroutine_type DIE, use the new build_or_get_fn_decl_if_not_suppressed. * src/abg-ir.cc (translation_unit::bind_function_type_life_time): Fix comment. (strip_typedef): Adjust. (qualified_type_def::build_name): Set the prefix name of a the name of a noop qualifier to "noop-qual", just like what is done in the new die_qualified_name function. (struct method_type::priv): New priv type for the method_type class. (method_type::method_type): Take a new 'is_const' parameter. Adjust as the method_type is now pimpl'ed. (method_type::{get_class_type, set_is_const, get_is_const}): Define new member functions. (function_decl::get_pretty_representation_of_declarator): Better detecter of const-ness. (class_decl::insert_member_decl): Better setting of the const-ness. (class_decl::method_decl::method_decl): Adjust. Deduce the const-ness of the method_decl from the const-ness of its method_type. (copy_member_function): Adjust. (set_member_is_static): Do not assume a non-nil scope anymore because member_decl can now be scope-less, at least for a little while. * src/abg-reader.cc (push_decl_to_current_scope): Adjust. (build_function_decl): Style adjustment. Adjust for method_type const-ness changes. (build_function_type): Likewise. Also, support the new "method-class-id" property that flags a function type as being a method type. * src/abg-writer.cc (write_function_decl): Style fixes. (write_function_type): Likewise. Emit a new "method-class-id" property for function type that is actually a method type. That property's value is the id of the class of the method type. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Adjust. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. * tests/data/test-diff-filter/test0-report.txt: Adjust. * tests/data/test-diff-filter/test01-report.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Adjust. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Adjust. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt: Adjust. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Adjust. * tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt: Adjust. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Adjust. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Adjust. * tests/data/test-read-dwarf/libtest23.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2016-11-01 Dodji Seketeli Setup per-corpus type maps indexed by type names * include/abg-corpus.h (corpus::priv_): Make this public so that functions from outside of the class can access it. These functions are meant to be used only by code that is *inside* libabigail.so, though. * src/abg-corpus-priv.h: New file. * src/abg-corpus.cc: Include the new abg-corpus-priv.h file. (struct regex_t_deleter): Move this to abg-sptr-utils.h. (build_sptr): Move the declaration of this function template specialization to abg-sptr-utils.h and its definition to abg-sptr-utils.cc. (typedef regex_t_sptrs_type, typedef str_var_ptr_map_type) (struct corpus::exported_decls_builder::priv, struct corpus::priv): Move these declarations to the new abg-corpus-priv.h. (maybe_update_types_lookup_map): Define overloads of this (one per kind of type). (lookup_{basic, class, enum, typedef, class_or_typedef, class_typedef_or_enum, qualified, pointer, reference, array, function}_type): Define new functions. * include/abg-ir.h (typedef istring_type_base_wptr_map_type) (typedef istring_type_or_decl_base_sptr_map_type): Declare new typedefs. (class_decl::find_member_function_from_signature): Declare new member function. * src/abg-ir.cc: Include the new abg-corpus-priv.h file. (maybe_update_types_lookup_map): Remove this initial function. There are now new overloads in abg-corpus.cc for it. (scope_decl::{add_member_decl, insert_member_decl}): Adjust. (class_decl::{set_is_declaration_only, find_member_function, add_member_function}): Adjust. (class_decl::find_member_function_from_signature): Define new member function. * include/abg-sptr-utils.h (struct regex_t_deleter): Declare new type. (build_sptr): New build function template specializations. * src/abg-sptr-utils.cc: New file. * src/Makefile.am: Add src/abg-sptr-utils.cc and src/abg-corpus-priv.h to the build system. 2016-11-01 Dodji Seketeli Allow pretty printing function decls for internal purposes * include/abg-ir.h (function_decl::get_pretty_representation_of_declarator): Take an "internal" flag. * src/abg-ir.cc (function_decl::get_pretty_representation_of_declarator): Take an "internal" flag. (function_decl::get_pretty_representation): Pass the "internal" flag to the function function_decl::get_pretty_representation_of_declarator. (function_decl::parameter::get_type_name): Better handle variadic parameter type. (function_decl::parameter::get_type_pretty_representation): Likewise. 2016-11-26 Dodji Seketeli Make bash completion files non-executable * bash-completion/abicompat: Make this be non-executable. * bash-completion/abidiff: Likewise. * bash-completion/abidw: Likewise. * bash-completion/abilint: Likewise. * bash-completion/abinilint: Likewise. * bash-completion/abipkgdiff: Likewise. * bash-completion/abisym: Likewise. * bash-completion/fedabipkgdiff: Likewise. 2016-11-26 Dodji Seketeli A suppressed diff node implies suppressing all equivalent nodes too *class of equivalence* is visited once. This is not only a way to prevent infinite loops while visiting the graph, but also an optimization as it avoids walking two equivalent diff nodes. But then it can happen that we forget to categorize some diff nodes inside a given class of equivalence, even though we categorized some others. This patch makes it so that when a diff node inside a class of equivalence is categorized as SUPPRESSED, the canonical diff node of that class of equivalence is categorized as SUPPRESSED too. That way, to know if a diff node is suppressed, we just need to look at its canonical diff node. While doing this, I noticed that abidiff and abipkgdiff are not dropping private types from libabigail's internal representation, even though the Library now has that capability. The patch fixes that. But then the patch adds a --dont-drop-private-types option to abidiff to avoid dropping those private types from the IR, so that regression tests can make sure that a suppressed diff node implies suppression all equivalent nodes too. * doc/manuals/abidiff.rst b/doc/manuals/abidiff.rst: Document the new --dont-drop-private-types option. * src/abg-comparison.cc (diff::is_filtered_out): If the canonical type was suppressed then the current diff node is filtered out. (suppression_categorization_visitor::visit_{begin,end}): Categorized the canonical node as SUPPRESSED if the current node is suppressed. * tools/abidiff.cc (options::drop_private_types): New data member. (options::options): Initialize it. (display_usage): Add new help string for the new --dont-drop-private-types option. (parse_command_line): Parse the new --dont-drop-private-types option. (set_suppressions): Generate suppression specification from header directories given in parameter and stick them to the read context. * tools/abipkgdiff.cc (compare): Likewise. * tests/data/test-diff-suppr/libtest34-v0.so: New test input. * tests/data/test-diff-suppr/libtest34-v1.so: Likewise. * tests/data/test-diff-suppr/test34-report-0.txt: New reference report. * tests/data/test-diff-suppr/test34-v0.c: Source code for the new test input. * tests/data/test-diff-suppr/test34-v1.c: Likewise. * tests/data/test-diff-suppr/test34-priv-include-dir-v0/test34-priv-include-v0.h: Likewise. * tests/data/test-diff-suppr/test34-priv-include-dir-v1/test34-priv-include-v1.h: Likewise. * tests/data/test-diff-suppr/test34-pub-include-dir-v0/test34-pub-include-v0.h: Likewise. * tests/data/test-diff-suppr/test34-pub-include-dir-v1/test34-pub-include-v1.h: Likewise. * tests/data/Makefile.am: Add new test input material above to source distribution. * tests/test-diff-suppr.cc (in_out_spec): Compare the two new test library provided. Add --dont-drop-private-types to test30*. signed-off-by: Dodji Seketeli 2016-11-26 Dodji Seketeli Forgot to consider libtest33-v{0,1}.so in test-diff-suppr.cc * tests/data/test-diff-suppr/test33-report-0.txt: New refernce report. * tests/test-diff-suppr.cc (in_out_specs): Compare libtest33-v0.so and libtest33-v1.so. 2016-11-24 Dodji Seketeli Bump version number to 1.0.rc7 * configure.ac: 2016-11-24 Dodji Seketeli Update website for 1.0.rc6 * doc/website/mainpage.txt: Update for 1.0.rc6 release 2016-11-23 Dodji Seketeli Update NEWS and ChangeLog for 1.0.rc6 * ChangeLog: Update this automatically using "make update-changelog". * NEWS: update this by editing the output of 'git shortlog libabigail-1.0.rc5..HEAD'. 2016-11-24 Dodji Seketeli Avoid using size_t to get DWARF data * src/abg-dwarf-reader.cc (die_size_in_bits, die_location_expr): Take uint64_t rather than size_t and adjust. (expr_result::const_value_): Make this be int64_t rather than ssize_t. (expr_result::expr_result): Take int64_t rather than ssize_t. (expr_result::const_value): Return int64_t rather than ssize_t. (expr_result::{operator(), operator=, operator+=}): Make these operators return or take int64_t. too. (op_pushes_constant_value, op_manipulates_stack) (op_is_arith_logic, op_is_control_flow) (eval_last_constant_dwarf_sub_expr, die_member_offset) (die_virtual_function_index): Take uint64_t rather than size_t, or int64_t rather than ssize_t. (finish_member_function_reading, build_class_type_and_add_to_ir) (build_union_type_and_add_to_ir): Adjust. 2016-11-24 Dodji Seketeli Fix a compiler warning issued by GCC 6.2.1 * src/abg-dwarf-reader.cc (find_import_unit_point_between_dies): Parameter 5 of find_import_unit_point_between_dies is not of type Dwarf_Off. 2016-11-24 Dodji Seketeli Fix offset type mismatch * src/abg-dwarf-reader.cc (die_member_offset): The last two parameters of die_unsigned_constant_attribute must be of type uint64_t. 2016-11-24 Dodji Seketeli Fix indentation in abg-writer.cc * src/abg-writer.cc (write_union_decl_opening_tag): Fix indentation. 2016-11-23 Dodji Seketeli Support reading data member offset from DW_AT_bit_offset * src/abg-dwarf-reader.cc (die_member_offset): Better comments. Support reading the bit offset also from the DW_AT_bit_offset attribute when it's present. Make sure this always returns a value in bits. (build_class_type_and_add_to_ir): No need to multiply (by 8) the value returned by die_member_offset anymore because it's now in bits directly. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Adjust. * tests/data/test-read-dwarf/test1.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. 2016-11-23 Dodji Seketeli Lexicographically sort union data members in change reports * src/abg-comparison.cc (data_member_comp::operator()): Data members with the same offset are sorted lexicographically, by taking their name into account. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. 2016-11-23 Dodji Seketeli Better diagnostics when wget is missing * configure.ac: When wget is missing then make the disabling of the building of the fedabipkgdiff tool show up in the configuration summary and emit a notice. 2016-11-15 Dodji Seketeli Support union types * include/abg-fwd.h (class_or_union, union_decl): Forward-declare new types. (is_class_or_union_type, is_union_type): Declare new functions. * include/abg-ir.h (method_type::class_type_): Make this be of class_or_union_wptr type. (method_type::method_type): Make the class_type parameter be of class_or_union_wptr type. (method_type::{g,s}et_class_type): Take or return a class_or_union_sptr. (member_base, method_decl, member_function_template) (member_class_template, member_base::hash) (member_function_template::hash, member_class_template::hash): Take these class types out of the class_decl scope. (is_method_decl): Adjust. (operator==, opertor!=): Adjust overloads for member_function_template_sptr and member_class_template_sptr. (class class_or_union): Declare new type. (class class_decl): Make this class inherit class_or_union class. (class_decl::{add_member_decl, insert_member_decl, remove_member_decl, set_size_in_bits, get_size_in_bits, get_alignment_in_bits, set_alignment_in_bits, get_is_declaration_only, set_is_declaration_only, set_definition_of_declaration, get_definition_of_declaration, get_earlier_declaration, set_earlier_declaration, insert_member_type, add_member_type, remove_member_type, get_member_type, find_member_type, add_data_member, get_data_members, find_data_member, get_non_static_data_members, add_member_function, get_member_functions, find_member_function, add_member_function_template, get_member_function_templates, add_member_class_template, get_member_class_templates): Move these to the parent class class_or_union. (copy_member_function, equals): Add overloads for class_or_union. (struct class_or_union::hash): Declare new type. (class union_decl): Declare new type. (equals, copy_member_function): New overloads for class union_decl type. (ir_node_visitor::visit): Add new overloads for union_decl* and class_or_union*. * src/abg-ir.cc (get_member_function_is_ctor) (set_member_function_is_ctor, get_member_function_is_dtor) (set_member_function_is_dtor, get_member_function_is_const) (set_member_function_is_const, get_member_function_vtable_offset) (set_member_function_vtable_offset) (get_member_function_is_virtual, set_member_function_is_virtual) (maybe_update_types_lookup_map, get_location) (get_method_type_name, is_at_global_scope, is_at_class_scope): Adjust. (is_class_or_union_type, is_union_type): Define new functions. (type_base::get_canonical_type_for, maybe_adjust_canonical_type) (method_type::method_type, method_type::set_class_type) (function_decl::get_pretty_representation) (function_decl::get_first_non_implicit_parm) (function_decl::clone): Adjust. (equals): Adjust the overload for function_type. (struct class_or_union::priv): Define new type. (class::priv::{declaration_, definition_of_declaration_, member_types_, data_members_, non_static_data_members_, member_functions_, mem_fns_map_, member_function_templates_, member_class_templates_, is_declaration_only_}): Move these data member into class_or_union::priv. (class_priv::{mark_as_being_compared, unmark_as_being_compared, comparison_started}): Moved these member functions to class_or_union::priv. (class_or_union::{class_or_union, traverse, ~class_or_union, add_member_decl, remove_member_decl, insert_member_type, add_member_type, get_size_in_bits, remove_member_type, get_alignment_in_bits, set_alignment_in_bits, set_size_in_bits, get_is_declaration_only, set_is_declaration_only, set_definition_of_declaration, get_definition_of_declaration, get_earlier_declaration, set_earlier_declaration, get_member_types, find_member_type, add_data_member, get_data_member, find_data_member, add_member_function, get_member_functions, find_member_function, add_member_function_template, get_member_function_templates, add_member_class_template, get_member_class_templates, has_no_member, insert_member_decl, operator==}): Define new member functions. (class_decl::{add_member_decl, remove_member_decl, insert_member_type, add_member_type, get_size_in_bits, remove_member_type, get_alignment_in_bits, set_alignment_in_bits, set_size_in_bits, get_is_declaration_only, set_is_declaration_only, set_definition_of_declaration, get_earlier_declaration, set_earlier_declaration, get_member_types, find_member_type, add_data_member, get_data_member, find_data_member, add_member_function, get_member_functions, find_member_function, add_member_function_template, get_member_function_templates, add_member_class_template, get_member_class_templates): Move these member functions into class_or_union. (class_decl::{class_decl, get_definition_of_declaration, insert_member_decl, add_member_function, has_no_base_nor_member}): Adjust. (equals, copy_member_function): Define new overloads for class_or_union. (equals): Adjust the overload for class_decl. (method_decl::{method_decl, set_linkage_name, ~method_decl, get_type, set_scope}): Remove from the class_decl scope. (member_base::operator==, member_function_template::operator==): Likewise. (member_function_template::traverse) (member_class_template::operator==) (member_class_template::traverse): Likewise. (operator==, operator!=): Adjust the overlod for member_function_template_sptr. (is_method_decl, fixup_virtual_member_function) (set_member_is_static): Adjust. (virtual_member_function_less_than::operator()): Likewise. (union_decl::{union_decl, get_pretty_representation, operator==, traverse}): Define new member functions. (equals, copy_member_function): Define new overloads for union_decl. (hash_type_or_decl): Adjust. (ir_node_visitor::visit_{begin, end}): Adjust. Add new overloads for class_or_union* and union_decl*. * include/abg-comparison.h (changed_member_function_sptr) (string_member_function_sptr_map): Adjust these typedefs. (class class_or_union_diff): Declare new type. (class_diff): Adjust to make this inherit the new class_or_union_diff type. (class_diff::{get_priv, member_types_changes, data_members_changes, inserted_data_members, deleted_data_members, member_fn_tmpls_changes, member_fn_tmpls_changes, member_class_tmpls_changes}): These member functions got moved into -- and shared with -- class_or_union_diff class. (class union_diff): Declare new type. (typedef union_diff_sptr): New typedef. (compute_diff): New overload for union_diff (is_class_diff, is_union_diff): Declare new functions. * src/abg-comparison.cc (is_class_diff, is_union_diff): Define new functions. (compute_diff_for_types): Support union_decl. (represent): Adjust. (represent_data_member): Do not show offset information for data members of unions as all union data members are at offset 0. (struct class_or_union_diff::priv): New type. (class_or_union_diff::priv::{member_type_has_changed, subtype_changed_dm, member_class_tmpl_has_changed, get_deleted_non_static_data_members_number, get_inserted_non_static_data_members_number, count_filtered_subtype_changed_dm, count_filtered_changed_dm, count_filtered_changed_mem_fns, count_filtered_inserted_mem_fns, count_filtered_deleted_mem_fns}): Define new member functions. (class_or_union_diff::{class_or_union_diff, finish_diff_type, lookup_tables_empty, lookup_tables_empty, ensure_lookup_tables_populated, allocate_priv_data, get_priv, ~class_or_union_diff, first_class_or_union, second_class_or_union, member_types_changes, member_types_changes, data_members_changes, inserted_data_members, deleted_data_members, member_fns_changes, changed_member_fns, member_fns_changes, inserted_member_fns, member_fn_tmpls_changes, member_fn_tmpls_changes, member_class_tmpls_changes, member_class_tmpls_changes, has_changes, has_local_changes, report, chain_into_hierarchy}): Define new member functions. (class_diff::priv::{member_types_changes_, data_members_changes, member_fn_tmpls_changes_, member_class_tmpls_changes_, deleted_member_types_, inserted_member_types_, changed_member_types_, sorted_changed_member_types_, deleted_data_members_, deleted_dm_by_offset_, inserted_data_members_, inserted_dm_by_offset_, subtype_changed_dm_, sorted_subtype_changed_dm_, changed_dm_, sorted_changed_dm_, deleted_member_functions_, inserted_member_functions_, changed_member_functions_, sorted_changed_member_functions_, deleted_member_class_tmpls_, inserted_member_class_tmpls_, changed_member_class_tmpls_, sorted_changed_member_class_tmpls_}): Move these data members into class_or_union_diff::priv. (class_diff::{clear_lookup_tables, lookup_tables_empty, ensure_lookup_tables_populate}): Adjust. (class_diff::allocate_priv_data): Define new function. (class_diff::priv::{count_filtered_changed_mem_fns, count_filtered_inserted_mem_fns, count_filtered_deleted_mem_fns, chain_into_hierarchy, class_diff}): Likewise. (class_diff::{member_types_changes, data_members_changes, inserted_data_members, deleted_data_members, member_fn_tmpls_changes, member_fn_tmpls_changes, member_class_tmpls_changes}): These are deleted as they got moved to class_or_union_diff. (class_diff::report): Adjust. (union_diff::{clear_lookup_tables, lookup_tables_empty, ensure_lookup_tables_populated, allocate_priv_data, union_diff, finish_diff_type, first_union_decl, second_union_decl, get_pretty_representation, report}): Define new functions. (compute_diff): Define an overload for union_decl_sptr. (function_decl_diff::report): Adjust. (corpus_diff::priv::apply_suppressions_to_added_removed_fns_vars): Adjust. (corpus_diff::report): Adjust. * src/abg-hash.cc (member_base::hash::operator) (member_function_template::hash::operator) (member_class_template::hash::operator): Move these out of the class_decl scope. (class_or_union::hash::operator): Define new member function. (class_decl::hash::operator): Adjust. (type_base::dynamic_hash::operator): Support hashing of union_decl. Adjust. * src/abg-suppression.cc (type_suppression::suppresses_diff): Adjust. * src/abg-dwarf-reader.cc (typedef die_class_or_union_map_type): Define new typedef. (read_context::{die_wip_classes_map_, alternate_die_wip_classes_map_, type_unit_die_wip_classes_map_): Make these data member have type die_class_or_union_map_type. (read_context::{lookup_type_from_die_offset, die_wip_classes_map, is_wip_class_die_offset, resolve_declaration_only_classes}): Adjust. (finish_member_function_reading, build_class_type_and_add_to_ir) (build_function_type, build_function_decl, build_reference_type) (type_is_suppressed, build_function_decl) (maybe_canonicalize_type, maybe_set_member_type_access_specifier): Adjust. (build_union_type_and_add_to_ir): Define new static function. (build_ir_node_from_die): Support DW_TAG_union_type DIE tag. * src/abg-reader.cc (handle_element_node): Handle union_decl. (build_function_decl, build_function_decl_if_not_suppressed): Adjust. (build_union_decl_if_not_suppressed, build_union_decl) (handle_union_decl): Define new functions. (build_class_decl): Adjust. * src/abg-writer.cc (record_decl_only_type_as_emitted): Adjust. (write_decl): Adjust. Support writting union_decl type. p (write_class_decl_opening_tag, write_class_decl): Adjust. Call the new write_class_or_union_is_declaration_only. (write_union_decl_opening_tag, write_union_decl): Define new static functions. (write_member_tpe): Support writting union decl. * tests/test-diff-dwarf.cc (in_out_specs): Add new tests for this union type support. * tests/data/test-diff-dwarf/libtest37-union-v0.so: New test input. * tests/data/test-diff-dwarf/libtest37-union-v1.so: Likewise. * tests/data/test-diff-dwarf/libtest38-union-v0.so: Likewise. * tests/data/test-diff-dwarf/libtest38-union-v1.so: Likewise. * tests/data/test-diff-dwarf/libtest39-union-v0.so: Likewise. * tests/data/test-diff-dwarf/libtest39-union-v1.so: Likewise. * tests/data/test-diff-dwarf/test37-union-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test38-union-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test39-union-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test37-union-v0.cc: Source code for new test input. * tests/data/test-diff-dwarf/test37-union-v1.cc: Likewise. * tests/data/test-diff-dwarf/test38-union-v0.cc: Likewise. * tests/data/test-diff-dwarf/test38-union-v1.cc: Likewise. * tests/data/test-diff-dwarf/test39-union-v0.cc: Likewise. * tests/data/test-diff-dwarf/test39-union-v1.cc: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Update test reference. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-read-dwarf/libtest23.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2016-11-10 Dodji Seketeli Support empty properties in INI files * include/abg-ini.h (simple_property::simple_property): Add a new constructor for empty values. (simple_property::has_empty_value): Declare new member function. * src/abg-ini.cc (simple_property::{simple_property, has_empty_value}): Define new member functions. (read_context::read_property): Support reading a property with no value. (write_property_value, write_property): Support writting a property with empty value. 2016-11-10 Dodji Seketeli Rename config::property_vector into config::properties_type * include/abg-ini.h (config::properties_type): Rename the typedef config::property_vector into this. (config::section::{section, get_properties, set_properties}): Adjust. * src/abg-ini.cc (config::section::priv::properties_): Adjust the name of its type. (config::section::{section, get_properties, set_properties, find_property}): Adjust. (write_section): Adjust. * src/abg-suppression.cc (read_function_suppression): Adjust. 2016-11-09 Dodji Seketeli Apply harmless and harmful filters in one pass * include/abg-comp-filter.h (class harmless_harmful_filter): Decalre new class. (typedef harmless_harmful_filter_sptr): Declare new typedef. (class harmless_filter, class harmful_filter): Remove these class declarations. (typedef harmful_filter_sptr, harmless_filter_sptr): Remove these typedefs. * src/abg-comp-filter.cc (categorize_harmless_diff_node) (categorize_harmful_diff_node): Define new static functions. ({harmless, harmful}_filter::{visit, visit_end}): Remove these member functions. (harmless_harmful_filter::{visit, visit_end}): Define new member functions. * src/abg-comparison.cc (diff_context::diff_context): Register the new harmless_harmful_filter, and remove the premier harmless_filter and harmful_filter. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch kabidiff-dedup # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: include/abg-comp-filter.h # modified: src/abg-comp-filter.cc # modified: src/abg-comparison.cc # # Untracked files: # (use "git add ..." to include in what will be committed) # # diff.txt # prtests/ # tests/data/test-read-dwarf/libtest23.so.abi.conflict 2016-11-08 Dodji Seketeli Avoid stripping typedefs too much * src/abg-ir.cc (types_are_compatible) (is_compatible_with_class_type): Do not strip typedefs. Just get their leaf types. 2016-11-08 Dodji Seketeli Misc style cleanups in abg-ir.cc * src/abg-ir.cc (equals): In overloads for function_type and class_decl, avoid returning a constant when we can return a variable like in the rest of the code. 2016-11-01 Dodji Seketeli Factorize out string representation of array_type_def::subrange_type * src/abg-ir.cc (array_type_def::subrange_type::{as_string, vector_as_string}): Define methods. (array_type_def::get_subrange_representation): Use the new vector_as_string method. 2016-11-01 Dodji Seketeli Factorize out parsing of integral types * src/abg-ir-priv.h: New file. * src/Makefile.am: Add abg-ir-priv.h to the build system. * src/abg-ir.cc: Include the new abg-ir-priv.h header file. (class_integral_type): Move this type declaration to the new abg-ir-priv.h header. (integral_type::modifiers_type): Make this non-static. (parse_integral_type): This new overload is a factorized out of ... (integral_type::integral_type): ... here. 2016-10-31 Dodji Seketeli Misc style fixes in abg-ir.cc * src/abg-ir.cc (get_function_type_name, get_pretty_representation): Misc style fixes. 2016-10-31 Dodji Seketeli Consider a method_decl as always being a member decl * src/abg-ir.cc (is_member_decl): Consider a method decl as always being a member decl. (is_member_function): Use is_member_decl. 2016-10-31 Dodji Seketeli Cleanup void and variadic parameter type interfaces * include/abg-ir.h (environment::{get_void_type, get_variadic_parameter_type}): Renamed get_void_type_decl and get_variadic_parameter_type_decl to these. (environment::is_void_type): Remove the overload that takes a bare pointer. (environment::is_variadic_parameter_type): Declare new member function. * src/abg-ir.cc (environment::void_type_): Renamed the data member void_type_decl_ into this. (environment::variadic_marker_type_): Renamed the data member variadic_marker_type_decl_ into this. (environment::{get_void_type, get_variadic_parameter_type}): Renamed get_void_type_decl and get_variadic_parameter_type_decl to these. (environment::is_void_type): Take a smart pointer now. (environment::is_variadic_parameter_type): Define new member function. (synthesize_function_type_from_translation_unit): Adjust. (function_decl::parameter::get_pretty_representation): Likewise. * src/abg-comparison.cc (is_diff_of_variadic_parameter_type): Adjust. * src/abg-dwarf-reader.cc (build_function_type) (build_ir_node_for_void_type): Likewise. * src/abg-reader.cc (build_function_parameter) (build_function_decl, build_function_type): Likewise. 2016-10-31 Dodji Seketeli Cleanup some entry points in abg-fwd.h * include/abg-fwd.h (add_decl_to_scope): Pass the scope smart pointer by reference. (is_member_type): pass the type smart pointer by reference. (is_function_decl, is_pointer_type, is_reference_type) (is_qualified_type, is_function_type, is_method_type) (is_array_type): Take a type_or_decl base pointer, rather than either a decl_base or type_base pointer. * include/abg-ir.h (translation_unit::set_corpus): Take a pointer to non-const corpus. (translation_unit::get_corpus): Add a non-const overload. (type_or_decl_base::get_corpus): Likewise. (type_or_decl_base::set_translation_unit): Take a pointer to non-corpus translation_unit. (type_or_decl_base::get_translation_unit): Add a non-const overload. (scope_decl::{add_member_decl, insert_member_decl}): Pass the member smart pointer by reference. (scope_decl::remove_member_decl): Take a non-const smart pointer. (class_decl::add_member_decl): Pass the decl smart pointer by reference. (is_method_decl): Take pointer or reference to type_or_decl_base rather than function_decl. * src/abg-ir.cc (translation_unit::priv::corpus): Make this a pointer to non-const corpus. (translation_unit::set_corpus): Take a pointer to non-const corpus. (translation_unit::get_corpus): Add a non-const overload. (translation_unit::get_global_scope): Adjust. (translation_unit::bind_function_type_life_time): Adjust. (type_or_decl_base::translation_unit): Make this a pointer to non-const translation_unit. (type_or_decl_base::get_corpus): Likewise. (type_or_decl_base::set_translation_unit): Take a pointer to non-corpus translation_unit. (type_or_decl_base::get_translation_unit): Add a non-const overload. (is_member_type): pass the type smart pointer by reference. (scope_decl::{add_member_decl, insert_member_decl}): Take a reference to the member decl smart pointer. Adjust. (class_decl::add_member_decl): Likewise. (scope_decl::remove_member_decl): Take a non-const smart pointer. (add_decl_to_scope): Pass the scope smart pointer by reference. (is_decl, is_function_decl, is_pointer_type, is_reference_type) (is_qualified_type, is_function_type, is_method_type) (is_method_decl, is_array_type): Take a type_or_decl base pointer, rather than either a decl_base or type_base pointer. 2016-10-31 Dodji Seketeli Fix abigail::ir::get_type_scope() * src/abg-ir.cc (get_type_scope): Do not always return nil. 2016-10-27 Dodji Seketeli Bug 20740 Broken check for dwarf_getalt in configure.ac * configure.ac: Add missing spaces around the "=" of a conditional expression. 2016-10-11 Dodji Seketeli Canonicalize function types when reading from DWARF * src/abg-dwarf-reader.cc (build_function_decl): Canonicalize function types. 2016-10-11 Dodji Seketeli Misc cleanups here and there * src/abg-dwarf-reader.cc (canonicalize_types_scheduled): Fix identation. * src/abg-reader.cc (build_class_decl): Use class_decl_sptr rather than shared_ptr. * src/abg-writer.cc (write_class_is_declaration_only) (write_is_struct, write_decl, write_decl_in_scope) (write_type_decl, write_qualified_type_def) (write_pointer_type_def, write_reference_type_def) (write_array_type_def, write_enum_type_decl, write_typedef_decl) (write_elf_symbol, write_var_decl, write_function_decl) (write_member_type_opening_tag, write_member_type) (write_class_decl_opening_tag, write_class_decl): Cleanup parameters to use the right typedef, rather than the long shared_ptr<*> form. Pass the shared pointers by reference as well. 2016-10-10 Dodji Seketeli Cleanup namespace importing in abg-interned-str.h * include/abg-interned-str.h: Inject std::tr1::shared_ptr, std::string and std::ostream inside the abigail namespace. (interned_string::{interned_string, raw, operator==, operator!=, operator<): Adjust. (operator==, operator!=, operator<<, operator+): Adjust. 2016-10-07 Dodji Seketeli Cleanup functions to detect infinite comparison of class_decl * src/abg-ir.cc (class_decl::priv::unmark_as_being_compared): In the overload that takes a pointer to class_decl, re-use the overload that takes a reference. (class_decl::priv::comparison_started): Do not crash if the klass pointer is nil. (equals): In the overload for class_decl&, undef the RESULT macro when it's not used anymore. 2016-10-07 Dodji Seketeli Cleanup class_decl inifite comparison detection * src/abg-ir.cc (environment::priv::classes_being_compared_): Make this use the new interned_string_set_type type. (class_decl::priv::{mark_as_being_compared, comparison_started}): Adjust. 2016-10-10 Dodji Seketeli Apply ODR-based type comparison optimization to function types * src/abg-ir.cc (type_eligible_for_odr_based_comparison): Factorize this out of type_base::get_canonical_type_for. Also, add function types to the set of types to use the ODR-based comparison optimization on. (type_base::get_canonical_type_for): Use the new type_eligible_for_odr_based_comparison function. 2016-10-07 Dodji Seketeli Prevent infinite loops while comparing two function_type * include/abg-ir.h (class environment): Make class function_type be a friend of this class. (class function_type): Make the equality function for function_types be a friend of this class. * src/abg-ir.cc (environment::priv::fn_types_being_compared_): New data member. (function_type::priv::{mark_as_being_compared, unmark_as_being_compared, comparison_started}): Define new member functions. (equals): In the overload for function_types, if any of the the function_type being compared is already being compared, return early saying that the two function_types are equal. This avoids 2016-10-06 Dodji Seketeli Define a new interned_string_set_type typedef * include/abg-interned-str.h (interned_string_set_type): Define a new typedef for unordered_set. 2016-09-23 Dodji Seketeli Update reference output of runtestreaddwarf * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2016-09-21 Matthias Klose Fix typo in abipkgdiff * tools/abipkgdiff.cc (extract_deb): Fix typo. 2016-09-12 Dodji Seketeli Better handle fedabipkgdiff dependencies detection * configure.ac: It's only when --enable-fedabipkgdiff is provided that a missing dependency of the fedabipkgdiff program results in a fatal error. Otherwise, building fedabipkgdiff is just disabled. 2016-09-16 Dodji Seketeli Add default suppression specifications for C++ binaries * default.abignore: Add suppressions for non-libstdc++ and non-boost C++ libraries. 2016-09-20 Dodji Seketeli Add default suppression specification for webkitgtk * default.abignore: New suppression specifications for webkitgtk. 2016-09-19 Dodji Seketeli Drop suppressed ABI artifacts from the IR * doc/manuals/abidw.rst: Document the new --suppressions and --headers-dir options off the abidw tool. * doc/manuals/abilint.rst: Document the new --suppressions and --headers-dir options on the abilint tool. * doc/manuals/libabigail-concepts.rst: Document the new "drop" and "name_not_regexp" properties on suppression directives. * include/abg-corpus.h (corpus::corpus): Add a default argument to the path parameter. * src/abg-suppression-priv.h: New private header file. * src/Makefile.am: Add the new abg-suppression-priv.h file to source distribution. * include/abg-suppression.h ({suppression_base, type_suppression, function_suppression, variable_suppression}::priv): Make these public. (suppression_base::{g,s}et_drops_artifact_from_ir): Declare new member functions. (type_suppression::{suppressed_type}): Likewise. (suppression_base::{names,sonames}_of_binaries_match): Remove member functions. (function_suppression::{get_name, set_name, get_name_regex_str, set_name_regex_str}): Renamed get_function_name, set_function_name, get_function_name_regex_str, set_function_name_regex_str into these. ({variable,function}_suppression::{g,s}et_name_not_regex_str): Declare new member functions. * src/abg-suppression.cc: Include the new abg-suppression-priv.h private header. (class suppression_base::priv, class type_suppression::priv, class function_suppression::parameter_spec::priv, class function_suppression::priv, class variable_suppression::priv): Move these types to that new private header. (suppression_base::{g,s}et_drops_artifact_from_ir) (function_suppression::{g,s}et_name_not_regex_str) (variable_suppression::{g,s}et_name_not_regex_str): New member functions. (sonames_of_binaries_match): New static function, taken from suppression_base::sonames_of_binaries_match. (names_of_binaries_match): New static function, taken from suppression_base::names_of_binaries_match. (suppression_matches_type_no_name): New static function. (type_suppression::suppresses_type): Adjust (function_suppression::suppresses_function) (variable_suppression::suppresses_variable): Adjust. Evaluate the new "name_not_regexp" property. (suppression_matches_type_name) (suppression_matches_type_location) (suppression_matches_type_name_or_location) (suppression_matches_function_name) (suppression_matches_function_sym_name) (suppression_matches_variable_name) (suppression_matches_variable_sym_name, suppression_matches_type): New functions. (read_type_suppression): Support the new "drop_artifacts" and "drop" properties. (read_function_suppression, read_variable_suppression): Support the new "drop_artifacts", "drop", and "name_not_regexp" properties. (function_suppression::{g,s}et_name): Renamed {g,s}et_function_name into these. (function_suppression::set_name_not_regex_str): Renamed {g,s}et_name_regex_str into this. (function_suppression::suppresses_function_symbol): Adjust. * include/abg-dwarf-reader.h (add_read_context_suppressions): Declare new function. * src/abg-dwarf-reader.cc: Use the new private abg-suppression-priv.h header file. (read_context::supprs_): New data member. (read_context::get_suppressions): New member function. (read_context::get_die_source): Make this const. (read_context::tu_die_imported_unit_points_map): Add a const overload. (read_context::cur_transl_unit): Renamed current_translation_unit unit into this; (read_context::cur_tu): Remove or rename into cur_transl_unit. (get_scope_for_die, build_translation_unit_and_add_to_ir) (build_enum_type, build_pointer_type_def, build_reference_type) (build_function_type, build_array_type, build_function_decl): Adjust. (read_context::{suppression_can_match, suppression_matches_function_sym_name, suppression_matches_function_name, suppression_matches_variable_sym_name, suppression_matches_variable_name, suppression_matches_type_name_or_location, suppression_matches_type_name}): Add member functions. (die_signed_constant_attribute): Remove this as dead code. (die_location, die_loc_and_name) (find_import_unit_point_between_dies) (find_import_unit_point_before_die, get_parent_die): Make the read_context& parameter be const and adjust as required. (build_var_decl_if_not_suppressed, function_is_suppressed) (variable_is_suppressed, type_is_suppressed): Define new static functions. (add_read_context_suppressions): Define new function. (build_class_type_and_add_to_ir): Do not add suppressed static data members to the IR. (build_ir_node_from_die): Do not add suppressed enum types, class types, variables or functions to the IR. Adjust for the read_context::cur_tu -> read_context::cur_transl_unit rename. * include/abg-reader.h (read_context_sptr): Declare new type. (create_native_xml_read_context, read_corpus_from_input) (add_read_context_suppressions): Declare new functions. * src/abg-reader.cc: Include the new private abg-suppression-priv.h header file. (read_context::m_exported_decls_builder): Renamed m_exported_decls_builder_ into this. (read_context::get_exported_decls_builder): Adjust. (read_context::get_cur_scope): Make this const. (read_location): Take a const read_context and adjust. (read_corpus_from_input): Make this non-static. (build_namespace_decl): Don't abort if trying to add an artifact to the IR doesn't succeed. It might be suppressed now. (read_context::{m_path, m_supprs}): New data members. (read_context::{g,s}et_path): New member functions. (read_context::{get_suppressions, suppression_matches_function_name, suppression_can_match, suppression_matches_function_name, suppression_matches_function_sym_name, suppression_matches_variable_name, suppression_matches_variable_sym_name, suppression_matches_type_name_or_location}): Likewise. (add_read_context_suppressions, create_native_xml_read_context) (read_corpus_from_native_xml): New functions. (build_function_decl_if_not_suppressed, function_is_suppressed) (type_is_suppressed, build_var_decl_if_not_suppressed) (variable_is_suppressed, build_enum_type_decl_if_not_suppressed) (build_class_decl_if_not_suppressed): New static functions. (build_class_decl): Add member types that are being built early, so that their sub-types can be evaluated for suppression. Do not add suppressed static data members or suppressed member functions to the IR. (build_type): Do not add an enum type or a class type to the IR if they are suppressed. (handle_enum_type_decl): Do not add an enum type to the IR if its suppressed. (handle_var_decl): Likewise for a variable decl. (handle_function_decl): Likewise for a function decl. (handle_class_decl): Likewise for a class decl. * src/abg-tools-utils.cc (handle_fts_entry): Drop suppressed ABI from the IR. * tools/abidiff.cc (display_usage): Fix help strings for --headers-dirs{1,2}. (set_suppressions): New static function. (main): Adjust. Release the memory used by read_context early. * tools/abidw.cc (options::{headers_dir, suppression_paths}): (display_usage): New help strings for the new --header-dir and --suppressions options. (parse_command_line): Parse the new --header-dir and --suppressions options. (maybe_check_suppression_files, set_suppressions): New static functions. (main): Use the two new functions above. Free the memory used by the read context before working with the corpus. * tools/abilint.cc (options::suppression_paths): (display_usage): New help strings for the new --header-dir and --suppressions options. (parse_command_line): Parse the new --header-dir and --suppressions options. (maybe_check_suppression_files, set_suppressions): New static functions. (main): Use the two new functions above. Free the memory used by the read context before working with the corpus. * tests/data/test-diff-suppr/test24-soname-suppr-{2,3].txt: Adjust. * tests/data/test-diff-suppr/test29-suppr-6.txt: Likewise. * tests/data/test-diff-suppr/test29-suppr-8.txt: Likewise. * tests/data/test-diff-suppr/libtest31-v{0,1}.so: New test input. * tests/data/test-diff-suppr/libtest31.suppr: Likewise * tests/data/test-diff-suppr/libtest32-v{0,1}.so: Likewise. * tests/data/test-diff-suppr/libtest32-0.suppr: Likewise. * tests/data/test-diff-suppr/libtest33-v{0,1}.so: Likewise. * tests/data/test-diff-suppr/test31-report-{0,1}.txt: Likewise. * tests/data/test-diff-suppr/test31-v{0,1}.cc: Likewise. * tests/data/test-diff-suppr/test32-report-{0,1}.txt: Likewise. * tests/data/test-diff-suppr/test32-v{0,1}.c: Likewise. * tests/data/test-diff-suppr/test33-suppr-1.txt: Likewise. * tests/data/test-diff-suppr/test33-v{0,1}.cc: Likewise. * tests/data/test-diff-suppr/test33-v{0,1}.h: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so: Likewise. * tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise. * tests/data/test-read-dwarf/test24-drop-fns-0.suppr: Likewise. * tests/data/test-read-dwarf/test24-drop-fns.cc: Likewise. * tests/data/test-read-write/test28-drop-std-fns.abignore: Likewise. * tests/data/test-read-write/test28-drop-std-vars.abignore: Likewise. * tests/data/test-read-write/test28-without-std-fns-ref.xml: Likewise. * tests/data/test-read-write/test28-without-std-fns.xml: Likewise. * tests/data/test-read-write/test28-without-std-vars-ref.xml: Likewise. * tests/data/test-read-write/test28-without-std-vars.xml: Likewise. * tests/data/test-read-write/test28.xml: Likewise. * tests/data/Makefile.am: Add the new test artifacts to source distribution. * tests/test-diff-suppr.cc (in_out_spec): Take the new test inputs into account. * tests/test-read-dwarf.cc (Inoutspec::in_suppr_spec_path): New data member. (in_out_spec): Adjust. The new test inputs into account. (set_suppressions): New static function. (handle_in_out_spec): Adjust. * tests/test-read-write.cc (Inoutspec::{in_suppr_spec_path, ref_out_path}): New data members. (in_out_spec): Adjust. Take new test inputs into account. (main): Adjust. 2016-09-19 Dodji Seketeli Pimplify the abigail::ir::scope_decl type * include/abg-ir.h (scope_decl::{priv, priv_sptr}) Declare new types. (scope_decl::priv_): New pimpl data member. (scope_decl::{member_, member_scopes}): Move this as data member of the new scope_decl::priv type in the abg-ir.cc file. (scope_decl::{scope_decl, get_member_decls, get_member_scopes, is_empty}): Make these inline member functions be out-of-line. * src/abg-ir.cc (struct scope_decl::priv): Define new type. (scope_decl::{scope_decl, get_member_decls, get_member_scopes, is_empty}): Define these new member functions here. They were inline in the include/abg-ir.h header files before. (scope_decl::{add_member_decl, insert_member_decl, remove_member_decl}): Adjust. 2016-09-19 Dodji Seketeli Add new helper functions * include/abg-fwd.h (get_location, build_qualified_name): Declare new functions. * include/abg-ir.h (is_method_decl): Declare two new overloads of this function. * src/abg-ir.cc (get_location, build_qualified_name) (is_method_decl): Define these functions declared above. 2016-09-19 Dodji Seketeli Do not emit empty namespaces in abixml * include/abg-ir.h (namespace_decl::is_empty_or_has_empty_sub_namespaces): Declare new function ... * src/abg-ir.cc (namespace_decl::is_empty_or_has_empty_sub_namespaces): ... and define it. * src/abg-writer.cc (write_namespace_decl): Do not write empty namespaces or namespaces containing empty namespaces. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/libtest23.so.abi: Adjust. 2016-09-21 Dodji Seketeli Fix misleading indentation issues * tools/abipkgdiff.cc (compare): Likewise. * tools/abisym.cc (main): Fix misleading indentation. 2016-08-30 Dodji Seketeli Bug 20534 - abipkgdiff wrongly displays the name of added binary files * tools/abipkgdiff.cc (compare): Show the name of the added binary, rather than its address. 2016-08-24 Dodji Seketeli Bug 20420 - Wrong ODR-based type comparison optimization on qualified type * src/abg-ir.cc: 2016-08-23 Dodji Seketeli Don't walk diff trees indefinitely when applying suppressions * src/abg-comparison.cc: 2016-07-27 Dodji Seketeli Control symbols exported from libabigail.so * VISIBILITY: New documentation about this visiblity business. * CONTRIBUTING: Update the "contributing guide" to refer to symbol visibility issues. * configure.ac: Define a variable VISIBILITY_FLAGS that is set to the -fvisibility=hidden flag to pass to GCC, when its available. * src/Makefile.am: Add VISIBILITY to source distribution. Also add COMPILING and COMMIT-LOG-GUIDELINES that were missing. * src/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding the library. * tests/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tests. * tools/Makefile.am: Use the new $(VISIBILITY_FLAGS) when buiding tools. * src/abg-comp-filter.cc: Enclose inclusion of public headers in ABG_BEGIN_EXPORT_DECLARATIONS and ABG_END_EXPORT_DECLARATIONS to export the symbols of entities declared in there. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. 2016-07-26 Dodji Seketeli Support DW_TAG_type_unit * src/abg-dwarf-reader.cc (TYPE_UNIT_DIE_SOURCE): New enumerator in enum die_source. (read_context::{type_unit_die_decl_map_, type_unit_die_type_map_, type_unit_die_wip_classes_map_, type_unit_die_wip_function_types_map_, type_unit_types_to_canonicalize_, type_units_tu_die_imported_unit_points_map_, type_section_die_parent_map_}): New data members. (read_context::{get_die_source, associate_die_to_decl, lookup_decl_from_die_offset, die_type_map, clear_die_type_maps, die_wip_classes_map, die_wip_function_types_map, types_to_canonicalize, clear_types_to_canonicalize, tu_die_imported_unit_points_map, die_parent_map}): Support TYPE_UNIT_DIE_SOURCE. (get_parent_die, get_scope_for_die): Likewise. (read_context::{lookup_decl_from_type_unit_die_offset, type_section_die_parent_map}): Define new member functions. (read_context::build_die_parent_maps): Build a DIE -> parent map for DIEs coming from the .debug_types section. * tests/data/test-read-dwarf/libtest23.so: New test input. * tests/data/test-read-dwarf/libtest23.so.abi: New reference output. * tests/data/test-read-dwarf/test23-first-tu.cc: Source code of the new binary above. * tests/data/test-read-dwarf/test23-second-tu.cc: Likewise. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-read-dwarf.cc (in_out_specs): Make this test harness execute over the new test input and reference output. 2016-07-26 Dodji Seketeli Misc code cleanup * src/abg-dwarf-reader.cc (build_function_decl): Use the more readable is_class_type rather than a dynamic_cast. 2016-07-26 Dodji Seketeli Generalize DIE source concept in DWARF reader * src/abg-dwarf-reader.cc (enum die_source): Define new enum. (operator++): Define new prefix increment operator for the die_source enum. (imported_unit_point::imported_unit_from_alt_di): Remove this data member. (imported_unit_point::imported_unit_die_source): New data member of type die_source. (read_context::primary_die_parent_map_): Renamed die_parent_map_ data member into this. (read_context::clear_per_corpus_data): Use the new clear_die_type_maps function, not die_type_map. Also use the new clear_types_to_canonicalize overload that takes no parameter. (read_context::{get_die_source, clear_die_type_maps, clear_types_to_canonicalize}): New member functions. (build_ir_node_from_die, die_die_attribute, get_parent_die) (get_scope_for_die, build_namespace_decl_and_add_to_ir) (build_type_decl, build_enum_type) (build_class_type_and_add_to_ir, build_qualified_type) (build_pointer_type_def, build_reference_type) (build_function_type, build_array_type, build_typedef_type) (build_var_decl, build_function_decl): Remove the boolean parameter that was designating the source of the DIE. If necessary, get the source of the DIE from inside the function using the new read_context::get_die_source. (read_debug_info_into_corpus): Adjust. (maybe_canonicalize_type, find_import_unit_point_between_dies) (maybe_canonicalize_type, read_context::{associate_die_to_decl, lookup_decl_from_die_offset, die_type_map, associate_die_to_type, lookup_type_from_die_offset, die_wip_classes_map, die_wip_function_types_map, is_wip_class_die_offset, is_wip_function_type_die_offset, types_to_canonicalize, schedule_type_for_late_canonicalization, canonicalize_types_scheduled, add_late_canonicalized_types_stats, perform_late_type_canonicalizing}): Take a die_source as the source of the DIE, not a boolean. Adjust the code of the function accordingly. (read_context::{tu_die_imported_unit_points_map}): Modified this to make it take a die_source and return the appropriate map depending on the source. (read_context::build_die_parent_relations_under): Turn the non-member static function build_die_parent_relations_under into a member function. (read_context::build_die_parent_maps): Turn the non-member static function build_die_parent_maps into a member function. Make this function build a DIE -> parent map also for type DIEs that are in the .type_units section. 2016-07-25 Dodji Seketeli Cleanup is_class and is_compatible_with_class_type * include/abg-fwd.h (is_class): Remove the overloads that take a decl_base or a type_base. Add one that takes a type_or_decl_base. (is_compatible_with_class_type): Make this take a reference to smart pointer, not just the smart pointer. * src/abg-ir.cc (is_class): Do the same as in the header file. (is_compatible_with_class_type): Likewise. 2016-07-22 Dodji Seketeli Add ABG_ASSERT_NOT_REACHED macro * include/abg-tools-utils.h (ABG_ASSERT_NOT_REACHED): New macro. * src/abg-dwarf-reader.cc (stt_to_elf_symbol_type) (stb_to_elf_symbol_binding, get_elf_class_size_in_bytes) (build_ir_node_from_die): Use the new ABG_ASSERT_NOT_REACHED macro in lieu of just calling abort(). 2016-07-22 Dodji Seketeli Prepare support for symbol visibility control * configure.ac: Detect compiler support for __attribute__((visibility("hidden")) and define the HAS_GCC_VISIBILITY_ATTRIBUTE macro accordingly. Update the configuration report. * src/abg-internal.h: New internal header file that defines macros to be used in the source code to control declaration visibility. * src/Makefile.am: Add abg-internal.h to source distribution. Add src/ to the include search path. 2016-07-06 Chenxiong Qi Make fedabipkgdiff consistent with Libabigail's other tests * configure.ac: Do not require Python dependencies itertools, unittest and StringIO anymore as they are not used anymore. Require new module tempfile now. Generate new executable script tests/mockfedabipkgdiff from tests/mockfedabipkgdiff.in. * doc/manuals/abipkgdiff.rst: Add doc for new option --show-identical-binaries to abipkgdiff * doc/manuals/fedabipkgdiff.rst: Add doc for new options --show-identical-binaries to fedabipkgdiff. * tools/abipkgdiff.cc (options::show_identical_binaries): New data member. (options::options): Initialize new data member. (display_usage): Add a new help string for the new --show-identical-binaries option. (parse_command_line): Parse the newq --show-identical-binaries command line switch. (pthread_routine_compare): When the comparison of two binaries is empty, if --show-identical-binaries was provided, then emit some output saying the comparison did yield the empty set. * tools/fedabipkgdiff (DEFAULT_ABIPKGDIFF): Store the default path to abipkgdiff in this new global variable. Naming this default path is useful because it can then be cleanly overloaded when using mock.patch. (build_path_to_abipkgdiff): Return the new DEFAULT_ABIPKGDIFF global variable. (cmd): Parse the new --show-identical-binaries command line switch. * tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt: New reference output. * tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt: Likewise. * tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt: Likewise. * tests/mockfedabipkgdiff.in: New uninstalled script template. * tests/runtestfedabipkgdiff.py.in (counter) (temp_file_or_dir_prefix, UtilsTest, RPMTest, LocalRPMTest) (RunAbipkgdiffTest, GetPackageLatestBuildTest, DownloadRPMTest) (BrewListRPMsTest, AssertionHelper, MockGlobalConfig) (BUILT_ABIPKGDIFF, CompareABIFromCommandLineTest): Remove these classes, global variables and functions. (FEDABIPKGDIFF, TEST_SRC_DIR, TEST_BUILD_DIR, INPUT_DIR) (OUTPUT_DIR, FEDABIPKGDIFF_TEST_SPECS): New global variables. (ensure_output_dir_created, run_fedabipkgdiff_tests, main): New functions. * tests/test-diff-pkg.cc (in_out_specs): Add tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt to the set of reference outputs to consider. * tests/Makefile.am: Add non-installed script mockfedabipkgdiff to source distribution. Also added tests/data/test-diff-pkg/test-dbus-glib-0.80-3.fc12.x86_64-report-0.txt, tests/data/test-fedabipkgdiff/test0-from-fc20-to-fc23-dbus-glib-report-0.txt, tests/data/test-fedabipkgdiff/test1-from-fc20-to-dbus-glib-0.106-1.fc23.x86_64-report-0.txt, tests/data/test-fedabipkgdiff/test2-dbus-glib-0.100.2-2.fc20--dbus-glib-0.106-1.fc23-report-0.txt and tests/data/test-fedabipkgdiff/test3-dbus-glib-0.100.2-2.fc20.i686--dbus-glib-0.106-1.fc23.i686-report-0.txt to source distribution. 2016-07-13 Dodji Seketeli Fix spurious type size change report for distinct_diff * src/abg-comparison.cc (report_size_and_alignment_changes): Report size change only when the sizes are different. * tests/data/test-diff-filter/test33-report-0.txt: Adjust. 2016-07-13 Dodji Seketeli Bug 20199 - Consider integral type synonyms as being equal * src/abg-ir.cc (class integral_type): New class declaration and definition. (operator|, operator&, operator&=): New non-member bitwise operators for integral_type. (parse_integral_type_modifier, parse_base_integral_type) (parse_integral_type_modifier): New static function definitions. (type_decl::type_decl): Use the parse_integral_type to parse an integral type out of the current type_decl being built and transform the current type name into a canonical form. * tests/data/test-abidiff/test-PR18791-v0.so.abi: Adjust. * tests/data/test-abidiff/test-PR18791-v1.so.abi: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test33-report-0.txt: Likewise. * tests/data/test-diff-filter/test34-report-0.txt: Likewise. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2016-07-08 Dodji Seketeli Bug 20332 - too many ...'s counted as parameters * src/abg-dwarf-reader.cc (build_function_type): Create a variadic parameter just for the first DW_TAG_unspecified_parameters seen. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. 2016-07-06 Dodji Seketeli Better recognize qualified void type * include/abg-ir.h (environment::is_void_type): Declare new member function. * src/abg-ir.cc (environment::is_void_type): Define new member function. * src/abg-dwarf-reader.cc (maybe_strip_qualification): Strip const qualifier from const void. * tests/data/test-diff-filter/test34-libjemalloc.so.2-gcc-6.1.0: New test input. * tests/data/test-diff-filter/test34-libjemalloc.so.2-intel-16.0.3: Likewise. * tests/data/test-diff-filter/test34-report-0.txt: New reference output. * tests/data/Makefile.am: Add the new files above to the source distribution. * tests/test-diff-filter.cc (in_out_specs): Compare the two new binaries above. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Adjust. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Adjust. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: Adjust. * tests/data/test-read-dwarf/test1.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2016-07-05 Dodji Seketeli Bug 20194 - Fail to recognize void type represented by DW_TAG_base_type * src/abg-dwarf-reader.cc (build_type_decl): Recognize a DW_TAG_base_type of size zero and of name "void" as a void type. * tests/data/test-diff-filter/test33-libelf.so.0.8.13-gcc: New binary test input. * tests/data/test-diff-filter/test33-libelf.so.0.8.13-intel16.0.3: Likewise. * tests/data/test-diff-filter/test33-report-0.txt: New reference output. * tests/data/Makefile.am: Add the new files above to source distribution. * tests/test-diff-filter.cc (in_out_specs): Make this test harness run over the new test inputs above. 2016-07-04 Dodji Seketeli Add a new overload for is_type_decl * include/abg-fwd.h (is_type_decl): Declare a new overload * src/abg-ir.cc (is_type_decl): Define a new overload. (function_decl::parameter::get_pretty_representation): Adjust. 2016-06-29 Chenxiong Qi Add --abipkgdiff option in manual and bash completion * doc/manuals/fedabipkgdiff.rst: Add description of --abipkgdiff option. Reformat paragraph. * bash-completion/fedabipkgdiff: Add --abipkgdiff 2016-06-29 Chenxiong Qi Add fedabipkgdiff bash completion to dist * bash-completion/Makefile.am: Add fedabipkgdiff * bash-completion/fedabipkgdiff: Change mode to 775 2016-06-29 Chenxiong Qi Update bash completion for fedabipkgdiff * bash-completion/fedabipkgdiff: New bash completion file. 2016-06-29 Dodji Seketeli Bump version number to 1.0.rc6 * configure.ac: Bump version number to 1.0.rc6 2016-06-29 Dodji Seketeli Update web page for 1.0.rc5 * doc/website/mainpage.txt: Update web page. 2016-06-27 Dodji Seketeli Update ChangeLog for 1.0.rc5 * ChangeLog: Update by doing "make update-changelog" in the build directory. 2016-06-27 Dodji Seketeli Update NEWS file in preparation for 1.0.rc5 * NEWS: update with the edited content of the command: git shortlog libabigail-1.0.rc4..HEAD 2016-06-27 Dodji Seketeli Fix python interpreter path for el6 * tests/runtestdefaultsupprs.py.in: Use the python interpreter at /usr/bin/python, not the one at /bin/python. 2016-06-24 Dodji Seketeli Misc cleanup in abg-reader.cc * src/abg-reader.cc (read_context::push_decl_to_current_scope): Pass the decl smart pointer by value. 2016-06-22 Dodji Seketeli Use ODR-based optimization on C/C++ translation unit only * src/abg-ir.cc (strip_typedef): Set the translation unit of the new ABI artifact. (type_base::get_canonical_type_for): Perform the ODR-based optimization only for ABI artifact in C and C++ language translation units. * src/abg-dwarf-reader.cc (build_ir_node_from_die): Assert that the new ABI artifact has its translation unit set. * src/abg-reader.cc (read_context::{push_decl_to_current_scope, push_and_key_type_decl}): Set the translation unit of the current decl, irrespective of if it was added to the current scope or not. Assert that the decl that was newly pushed to the current scope is added to the current translation unit. 2016-06-10 Dodji Seketeli Misc white space and comment cleanups * include/abg-ir.h (typedef type_or_decl_base): Cleanup comment. * src/abg-ir.cc (struct type_or_decl_base::priv): Fix comment. 2016-06-10 Dodji Seketeli Cleanup function_decl::parameter::get_pretty_representation * src/abg-ir.cc (function_decl::parameter::get_pretty_representation): Assert that the environment is always non-nil. Then no needs to check for it being non-nil anymore. Use is_type_decl instead of dynamic_pointer_cast. 2016-06-07 Chenxiong Qi Fix package NVR comparison in fedabipkgdiff * configure.ac: Add new dependency. * tests/runtestfedabipkgdiff.py.in (builds): Add new builds for running tests to test selecting latest build from a package. (packages): Add new package gnutls. (GetPackageLatestBuildTest.{test_get_latest_one, test_cannot_find_a_latest_build_with_invalid_distro}): Use new builds of package gnutls to run tests. * tools/fedabipkgdiff (cmp_nvr): New function used to compare nvrs by Python built-in function sorted. (Brew.listBuilds): Use the new cmp_nvr function. 2016-06-06 Chenxiong Qi Bug 20135 - Make fedabipkgdiff compare ABIs using devel packages * doc/manuals/fedabipkgdiff.rst: Add documentation for the new --no-devel-pkg command line option, as well as for the new default behaviour of taking devel packages into account during ABI comparison. * tools/fedabipkgdiff (PkgInfo): Add new attribute devel_package. (RPM.is_devel): New property to determine if rpm is a development package. (LocalRPM._find_rpm): New method to find a specific rpm. (LocalRPM.find_debuginfo): Use new method _find_rpm to find debuginfo package. (LocalRPM.find_devel): New method to find an associated development package. (Brew.select_rpms_from_a_build): RPMs selector method is changed to select development package also. (abipkgdiff): Construct and run abipkgdiff with and without --devel-pkg[12] options. (magic_construct): Construct PkgInfo with development package. (run_abipkgdiff): Run abipkgdiff against rpms with development packages. (diff_local_rpm_with_latest_rpm_from_koji): Find development package, and call method abipkgdiff with development package. (build_commandline_args_parser): add new option --no-devel-pkg. * tests/runtestfedabipkgdiff.py.in (packages): Add new package nss-util. (builds): Add new builds of nss-utils, nss-util-3.12.6-1.fc14 and nss-util-3.24.0-2.0.fc25. (rpms): Add new associated rpms of the two new builds. (AssertionHelper.assert_functions_changes_summary): New method to match and assert functions changes summary. (AssertionHelper.assert_abi_comparison_result): Changed to support to help assert functions changes summary. (MockGlobalConfig.{no_devel_pkg, check_all_subpackages}): New fake options with default value for running tests. (RPMTest.setUp): add new development package for running test case. (RPMTest.test_is_devel): New test to test is_devel property. (RunAbipkgdiffTest.setUp): Add new development packages for running test case. (RunAbipkgdiffTest.{test_all_success, test_all_failure, test_partial_failure}): Mock global config. (RunAbipkgdiffWithDSOOnlyOptionTest): Removed. (CompareABIFromCommandLineTest.test_compare_with_no_devel_pkg): New test to test fedabipkgdiff with or without --no-devel-pkg option. * tests/data/Makefile.am: Add new rpms. * tests/data/test-fedabipkgdiff/packages/nss-util/3.12.6/1.fc14/ x86_64/nss-util-3.12.6-1.fc14.x86_64.rpm: New rpm for running tests. * tests/data/test-fedabipkgdiff/packages/nss-util/3.12.6/1.fc14/ x86_64/nss-util-debuginfo-3.12.6-1.fc14.x86_64.rpm: New rpm for running tests. * tests/data/test-fedabipkgdiff/packages/nss-util/3.12.6/1.fc14/ x86_64/nss-util-devel-3.12.6-1.fc14.x86_64.rpm: New rpm for running tests. * tests/data/test-fedabipkgdiff/packages/nss-util/3.24.0/2.0.fc25/ x86_64/nss-util-3.24.0-2.0.fc25.x86_64.rpm: New rpm for running tests. * tests/data/test-fedabipkgdiff/packages/nss-util/3.24.0/2.0.fc25/ x86_64/nss-util-debuginfo-3.24.0-2.0.fc25.x86_64.rpm: New rpm for running tests. * tests/data/test-fedabipkgdiff/packages/nss-util/3.24.0/2.0.fc25/ x86_64/nss-util-devel-3.24.0-2.0.fc25.x86_64.rpm: New rpm for running tests. 2016-06-03 Dodji Seketeli Improve python modules detection * configure.ac: Include autoconf-archive/ax_check_python_modules.m4 rather than autoconf-archive/ax_python_module.m4. Use AX_CHECK_PYTHON_MODULES rather than AX_PYTHON_MODULE. * Makefile.am: Add the new file autoconf-archive/ax_check_python_modules.m4 to source distribution and remove the older autoconf-archive/ax_python_module.m4 one. * autoconf-archive/ax_check_python_modules.m4: New file. * autoconf-archive/ax_python_module.m4: Remove. 2016-05-30 Chenxiong Qi Add integration tests for fedabipkgdiff * configure.ac: do not detect shutil module. * tests/runtestfedabipkgdiff.py.in: do not import shutil anymore. (BUILT_ABIPKGDIFF): new global variable to reference the abipkgdiff built from source code, as the new test case' tests require this command directly rather than mocking the global_config. (test_data_dir): convert variable name to uppercase, reference to the test data directory by absolute path instead of relative path. (TEST_TOPDIR): new global variable to use data directory as the topdir passed to fedabpkgdiff to download rpms. (TEST_DOWNLOAD_CACHE_DIR): new global variable referencing a fake download cache directory for tests only. (packages, builds, rpms): new global variables as a fake storage holding packages, builds and rpms. (AssertionHelper): new class helping to assert abipkgdiff result easily. (MockClientSession): new class to mock koji.ClientSession. (MockGlobalConfig.abipkgdiff): set this option to global variable BUILT_ABIPKGDIFF. (MockKojiClientSessin): removed. (mock_get_session): removed. (GetPackageLatestBuildTest.{test_get_latest_one, test_cannot_find_a_latest_build_with_invalid_distro, test_cannot_find_a_latest_build_with_invalid_distro}): mock koji.ClientSession with new class MockClientSession. Remove invalid documentation from docstring. Use new package rather than httpd. (DownloadRPMTest.setUp): remove self.download_dir and use global TEST_DOWNLOAD_CACHE_DIR. (DownloadRPMTest.tearDown): do not remove download cache directory. (DownloadRPMTest.make_remote_file_url): do not omit positional argument specifiers in string format. (DownloadRPMTest.{test_succeed_to_download_a_rpm, test_failed_to_download_a_rpm}): set fake download cache directory to mocked get_download_dir in mock.patch decorator. (BrewListRPMsTest.test_select_specific_rpms): use new MockClientSession to mock koji.ClientSession. Rewrite test by using the new package listed in global variable packages. (RunAbipkgdiffWithDSOOnlyOptionTest.{test_abipkgdiff_with_dso_only, test_abipkgdiff_without_dso_only}): set fake download cache directory to mocked get_download_dir in mock.patch decorator. (CompareABIFromCommandLineTest): new integration test case. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/ i686/dbus-glib-0.100.2-2.fc20.i686.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/ i686/dbus-glib-debuginfo-0.100.2-2.fc20.i686.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/ i686/dbus-glib-devel-0.100.2-2.fc20.i686.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/ x86_64/dbus-glib-0.100.2-2.fc20.x86_64.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/ x86_64/dbus-glib-debuginfo-0.100.2-2.fc20.x86_64.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.100.2/2.fc20/ x86_64/dbus-glib-devel-0.100.2-2.fc20.x86_64.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/ i686/dbus-glib-0.106-1.fc23.i686.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/ i686/dbus-glib-debuginfo-0.106-1.fc23.i686.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/ i686/dbus-glib-devel-0.106-1.fc23.i686.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/ x86_64/dbus-glib-0.106-1.fc23.x86_64.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/ x86_64/dbus-glib-debuginfo-0.106-1.fc23.x86_64.rpm: new rpm for running tests. * tests/data/test-fedabipkgdiff/packages/dbus-glib/0.106/1.fc23/ x86_64/dbus-glib-devel-0.106-1.fc23.x86_64.rpm: new rpm for running tests. * tests/data/Makefile.am: add new rpms. 2016-05-31 Dodji Seketeli Bug 19967 - System-level suppressions for glibc * default.abignore: Add initial suppression specifications for glibc. 2016-05-31 Dodji Seketeli Escape all characters when reading a string in ini files * src/abg-ini.cc (read_context::peek): Take an output parameter to tell the caller when this function escaped the returned character. Added an overload without this new parameter. (read_context::read_string): Accept all characters as part of the string. * tests/data/test-diff-suppr/test7-var-suppr-9.suppr: New test input. * tests/data/test-diff-suppr/test7-var-suppr-report-9.txt: New test reference output. * tests/data/Makefile.am: Add the files above to source distribution. * tests/test-diff-suppr.cc (in_out_spec): Run a new comparison of libtest7-var-suppr-v{0,1}.so this time using the new test7-var-suppr-9.suppr specification that exercices a string with the escaped characters that we were having difficulty with. 2016-05-31 Dodji Seketeli Don't require all version symbol sections to present * src/abg-dwarf-reader.cc (get_symbol_versionning_sections): Allow returning just some of the three version-related section, not necessarily all of them. Adjust comment. (get_version_for_symbol): Be ready to not necessarily having the three version-related sections available. 2016-05-30 Dodji Seketeli Bug 20180 - Support system-wide suppression specifications * doc/manuals/abidiff.rst: Document the default suppression scheme, its interaction with the --supprs option and the new --no-default option. * doc/manuals/abipkgdiff.rst: Likewise. * doc/manuals/fedabipkgdiff.rst: Likewise. * configure.ac: Generate the tests/runtestdefaultsupprs.py file from the new tests/runtestdefaultsupprs.py.in template. * default.abignore: New file. * Makefile.am: Add it to source distribution. * src/Makefile.am: Define the ABIGAIL_ROOT_SYSTEM_LIBDIR preprocessor macro that is set the value of the $libdir autotools macro. * include/abg-tools-utils.h: Update copyright years. (get_system_libdir, get_default_system_suppression_file_path) (get_default_user_suppression_file_path) (load_default_system_suppressions) (load_default_user_suppressions): Declare new functions * src/abg-tools-utils.cc (get_system_libdir) (get_default_system_suppression_file_path) (get_default_user_suppression_file_path) (load_default_system_suppressions) (load_default_user_suppressions): Define new functions. (is_regular_file): Amend this so that it return true for symlinks to regular files too. (is_dir): Amend this so that it returns true for symlinks to directories too. * tools/abidiff.cc (options::no_default_supprs): New data member. (options::options): Initialize the new data member. (display_usage): Display a new help string for the new --no-default-suppression command line option. (parse_command_line): Parse this new command line option. (set_diff_context_from_opts): Load the default suppression specifications, unless --no-default-suppression or --supprs was provided. * tools/abipkgdiff.cc (options::no_default_supprs): New data member. (options::options): Initialize the new data member. (parse_command_line): Parse the new --no-default-suppression command line option. (main): Load the default suppression specifications, unless --no-default-suppression or --supprs was provided. * tools/fedabipkgdiff (abipkgdiff): Add --no-default-suppression to the invocation of abipkgdiff if it was provided on the command line. (build_commandline_args_parser): Parse the new --no-default-suppression command line option. * tests/runtestdefaultsupprs.py.in: New test harness template. * tests/Makefile.am: Add the new runtestdefaultsupprs.py to the set of tests. * tests/data/test-default-supprs/test0-type-suppr-0.suppr: New test input. * tests/data/test-default-supprs/test0-type-suppr-report-0.txt: Likewise. * tests/data/test-default-supprs/test0-type-suppr-v0.o: Likewise. * tests/data/test-default-supprs/test0-type-suppr-v1.o: Likewise. * tests/data/test-default-supprs/dirpkg-1-dir-report-0.txt: Likewise. * tests/data/test-default-supprs/dirpkg-1-dir1: Likewise. * tests/data/test-default-supprs/dirpkg-1-dir2: Likewise. * tests/data/Makefile.am: Add new the new tests input above to Makefile.am. * tests/runtestcanonicalizetypes.sh.in: Pass --no-default-suppression to abidiff invocations. * tests/runtestdefaultsupprs.py.in: Likewise. * tests/test-abidiff-exit.cc: Likewise. * tests/test-diff-dwarf-abixml.cc: Likewise. * tests/test-diff-filter.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tools/abidiff.cc: Likewise. 2016-05-30 Dodji Seketeli Add --abipkgdiff option to fedabipkgdiff * tools/fedabipkgdiff (build_path_to_abipkgdiff): Define new function. (abipkgdiff): Invoke the new build_path_to_abipkgdiff() here. (build_commandline_args_parser): Parse the new --abipkgdiff option. 2016-05-28 Dodji Seketeli Better diagnostics when abipkgdiff has an extra argument * tools/abipkgdiff.cc (options::wrong_arg): New data member. (parse_command_line): Set options::wrong_arg to the wrong argument passed. (main): Tell wrong argument case apart, and report it. 2016-05-26 Dodji Seketeli Fix suppr spec wording in abipkgdiff manual * doc/manuals/abipkgdiff.rst: Fix the wording for the --suppr option. 2016-05-26 Dodji Seketeli Update reference to tools in libabigail-concepts manual * doc/manuals/libabigail-concepts.rst: Do not refer just to abidiff when talking about suppression specification. Also refer to abipkgdiff and other tools. 2016-05-30 Dodji Seketeli Fix some wording in the Libabigail overview manual page * doc/manuals/libabigail-overview.rst: Cleanup some confusion about Abigail-the-framework and libabigail-the-library. 2016-05-25 Dodji Seketeli Add test data for tests/runtestfedabipkgdiff.py * tests/data/test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm: New file. * tests/data/test-fedabipkgdiff/dbus-glib-0.80-3.fc12.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm: Likewise. * tests/data/test-fedabipkgdiff/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm: Likewise. 2016-05-25 Dodji Seketeli Add a 'check-valgrind' target to the top-most Makefile.am * Makefile.am (check-valgrind): Add this new target here. 2016-05-21 Chenxiong Qi Bug 20085 - Add --dso-only option to fedabipkgdiff * tools/fedabipkgdiff: Do not import shlex anymore. (ABIDIFF_OK, ABIDIFF_ERROR, ABIDIFF_USAGE_ERROR) (ABIDIFF_ABI_CHANGE): New global constant variables. (abipkgdiff): Pass the --dso-only option to the abipkgdiff command line tool, if that option was passed to fedabipkgdiff. Build this abipkgdiff command invocation from an array of strings, rather than from formatting a string. This makes us get rid of the shlex module. Fix typo in dry-run logged string. If there was an internal error reported by abipkgdiff, report it to stderr. (build_commandline_args_parser): Parse the --dso-only command line option. * tests/runtestfedabipkgdiff.py.in (fedabipkgdiff_mod): Fix a typo in initializing this global variable. (test_data_dir): New global variable, that is used to reference tests/data/test-fedabipkgdiff/. (RunAbipkgdiffTest.{test_all_success, test_partial_failure}): Fix typo. (Mockglobalconfig.{koji_topdir, dso_only}): New data members. (GetPackageLatestBuildTest.{test_get_latest_one, test_cannot_find_a_latest_build_with_invalid_distro, test_succeed_to_download_a_rpm, test_failed_to_download_a_rpm}): Fix typo. (BrewListRPMsTest.test_select_specific_rpms): Fix typo. (RunAbipkgdiffWithDSOOnlyOptionTest): New test case class. * doc/manuals/fedabipkgdiff.rst: update document for this new --dso-only option. * tests/data/test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm: New symbolic link to test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm. * tests/data/test-fedabipkgdiff/dbus-glib-0.80-3.fc12.x86_64.rpm: New symbolic link to test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm. * tests/data/test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm: New symbolic link to test-diff-pkg/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm. * tests/data/test-fedabipkgdiff/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm: New symbolic link to test-diff-pkg/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm. * tests/data/Makefile.am: add tests/data/test-fedabipkgdiff so that this data directory and all things within it can be included in tarball. 2016-05-24 Sinny Kumari Change parent directory for keeping extracted packages in abipkgdiff * tools/abipkgdiff.cc (extracted_packages_parent_dir): Change TMPDIR environment variable to XDG_CACHE_HOME and default temporary parent directory to $HOME/.cache/libabigail/ 2016-05-20 Dodji Seketeli Make abi{pkg}diff filter out changes about private types * include/abg-comp-filter.h: Update copyright year. * src/abg-comp-filter.cc (has_virtual_mem_fn_change): Make this static function become exported. (has_virtual_mem_fn_change): Declare new function. * include/abg-suppression.h (suppression_base::{get,set}_is_artificial): Declare new accessors. (type_suppression::get_source_locations_to_keep): Return an unordered set of strings, not a vector. Add a non-const overload. (type_suppression::set_source_locations_to_keep): Set an unordered set of strings, not a vector. * src/abg-suppression.cc (suppression_base::priv::is_artificial_): New data member. (suppression_base::priv::priv): Initialize the new data member. (suppression_base::{get,set}_is_artificial): Define new accessors. (type_suppression::priv::source_locations_to_keep_): Change the vector of strings representing source file names into unordered set of string. (type_suppression::get_source_locations_to_keep): Return an unordered set of strings, not a vector. Define a non-const overload. (type_suppression::set_source_locations_to_keep): Set an unordered set of strings, not a vector. (type_suppression::suppresses_diff): Make this suppress virtual member function diffs if the enclosing type of the changed virtual member is suppressed by the current type_suppression. (read_type_suppression): Adjust to use the fact that the source locations are not stored in an unordered set, not in a vector anymore. Otherwise, using a vector here make things too slow. (type_suppression::suppresses_type): Likewise. Also, If the type we are looking at has no location because it's a true opaque type and if the current suppression is an artificial suppression that is meant to suppress change reports about non-public types, then suppress the type. * include/abg-tools-utils.h (gen_suppr_spec_from_headers): Declare new public function. * src/abg-tools-utils.cc (PRIVATE_TYPES_SUPPR_SPEC_NAME): Define a new constant variable. (handle_fts_entry): Define new static function. (gen_suppr_spec_from_headers): Define new public function. * src/abg-comparison.cc (corpus_diff::priv::apply_suppressions_to_added_removed_fns_vars): If a type suppression suppresses a given class C, make it change added/removed virtual functions whose enclosing type is C. * tools/abidiff.cc (options::{headers_dir1, headers_dir2}): New data members. (display_usage): Add help strings for --headers-dir1 and --headers-dir2. (parse_command_line): Parse the new --headers-dir1 and --headers-dir2 options. (set_diff_context_from_opts): Generate suppression specifications to filter out changes on private types, if --headers-dir1 or --headers-dir2 is given. * tools/abipkgdiff.cc (options::{devel_package1, devel_package2}): New data members. (typedef package_sptr): New typedef. (enum package::kind): New enum. (package::kind_): New data member. This replaces ... (package::is_debug_info_): ... this data member. (package::{devel_package_, private_types_suppressions_}): New data members. (package::package): Adjust. (package::get_kind): Define new member function. This replaces ... (package::is_debug_info): ... this member function overload. (package::set_kind): Define new member functin. It replaces ... (package::is_debug_info): ... this member function overload. (package::{devel_package, private_types_suppressions}): Define new accessors. (package::erase_extraction_directies): Erase the sub-directory where development packages are extracted to. (compare_args::private_types_suppr{1,2}): New data members. (compare_args::compare_args): Adjust. (display_usage): Add help strings for --devel-pkg1/--devel-pkg2. (compare): Make the overload that compares elf files take private types suppressions. Add the private types suppressions to the diff context. (pthread_routine_compare): Adjust the call to compare. (maybe_create_private_types_suppressions): Define new static function. (pthread_routine_extract_pkg_and_map_its_content): If a devel package was specified for the main package then extract it in parallel with the other package extraction. When the extraction is done, create private types suppressions by visiting the directories that contain the header files. (compare): In the overload that compares packages by scheduling comparison of individual elf files that are in the packages, pass in the private type suppressions too. (parse_command_line): Parse the new --devel-pkg{1,2} command line options. (main): Associate the devel package to the main package, if the --devel-pkg{1,2}. * doc/manuals/abidiff.rst: Add documentation about the new --headers-dir1 and --headers-dir2 options. * doc/manuals/abipkgdiff.rst: Likewise, add documentation about the new --devel-pkg1 and --devel-pkg2 libraries. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt: New test reference output. * tests/data/test-diff-pkg/tbb-devel-4.1-9.20130314.fc22.x86_64.rpm: New test input package. * tests/data/test-diff-pkg/tbb-devel-4.3-3.20141204.fc23.x86_64.rpm: Likewise. * tests/test-diff-pkg.cc b/tests/test-diff-pkg.cc (InOutSpec::{first,second}_in_devel_package_path): New data members. (in_out_specs): Adjust. Also, add a new entry describing the new test inputs above. (test_task::perform): When the new test entry contains devel packages, pass them to abipkgdiff using the --devel1 and --devel2 options. * tests/data/test-diff-suppr/test30-include-dir-v0/test30-pub-lib-v0.h: A new test input source code. * tests/data/test-diff-suppr/test30-include-dir-v1/test30-pub-lib-v1.h: Likewise. * tests/data/test-diff-suppr/test30-priv-lib-v0.cc: Likewise. * tests/data/test-diff-suppr/test30-priv-lib-v0.h: Likewise. * tests/data/test-diff-suppr/test30-priv-lib-v1.cc: Likewise. * tests/data/test-diff-suppr/test30-priv-lib-v1.h: Likewise. * tests/data/test-diff-suppr/test30-pub-lib-v0.cc: Likewise. * tests/data/test-diff-suppr/test30-pub-lib-v0.so: Add new test binary input. * tests/data/test-diff-suppr/test30-pub-lib-v1.cc: Add new test input source code. * tests/data/test-diff-suppr/test30-pub-lib-v1.so: Add new test binary input. * tests/data/test-diff-suppr/test30-report-0.txt: Add new test reference output. * tests/data/test-diff-suppr/test30-report-1.txt: Add new test reference output. * tests/test-diff-suppr.cc (InOutSpec::headers_dir{1,2}): New data members. (InOutSpec::abidiff_options): Renamed the bidiff_options data member into this. (in_out_specs): Adjust. Also, added the new test input above to this. (main): Adjust to invoke abidiff with the new --hd1 and --hd2 options if the input specs for the tests has the new InOutSpec::headers_dir{1,2} data member set. Renamed bidiff into abidiff. * tests/data/Makefile.am: Add the new test inputs to the source distribution. 2016-05-24 Dodji Seketeli Fix the number of removed functions in change report * src/abg-suppression.cc (corpus_diff::report): Show the net number of removed functions, not the total number of the removed functions. 2016-05-23 Dodji Seketeli Document how to handle regression tests in CONTRIBUTING * CONTRIBUTING: Add a section about regression tests. * Makefile.am: Add a check-valgrind-recursive target. 2016-05-21 Dodji Seketeli Fix whitespaces in autotools files * configure.ac: Fix some white spaces. * tests/Makefile.am: Likewise. 2016-05-22 Dodji Seketeli Fix white space in abg-comparison.cc * src/abg-comparison.cc (struct diff_context::priv): Fix indentation. 2016-05-21 Dodji Seketeli Fix bash completion configure status * configure.ac: If bash completion is disabled, say so. 2016-05-22 Dodji Seketeli Enhance API doc for diff_context::add_diff * src/abg-comparison.cc (diff_context::add_diff): Enhance the API doc string. 2016-05-20 Dodji Seketeli Add missing API doc strings * src/abg-comparison.cc (diff::diff) (decl_diff_base::decl_diff_base, distinct_diff::distinct_diff) (base_diff::base_diff, scope_diff::scope_diff) (fn_parm_diff::fn_parm_diff) (function_type_diff::function_type_diff) (type_decl_diff::type_decl_diff, typedef_diff::typedef_diff) (translation_unit_diff::translation_unit_diff) (corpus_diff::corpus_diff): Add missing API doc strings. 2016-05-20 Dodji Seketeli Optimize out some shared_ptr use * include/abg-ir.h (pointer_type_def::get_naked_pointed_to_type): Declare new member function. * src/abg-ir.cc (pointer_type_def::priv::naked_pointed_to_type_): New data member. (pointer_type_def::priv::priv): Adjust to initialize the new data member. (pointer_type_def::pointer_type_def): Adjust to use the constructor pointer_type_def::priv::priv to initialize the pointed-to type (including its new naked pointer variant). So we do not have to initialize the priv_->pointed_to_type_ explicitely in the constructor anymore. (pointer_type_def::get_naked_pointed_to_type): Define new data member. (pointer_type_def::get_qualified_name): Use a naked pointer to the pointed-to type, rather than a smart pointer. 2016-05-20 Dodji Seketeli Light optimizations by passing reference to smart pointers around * include/abg-fwd.h (get_type_name): Take a reference to type_sptr. * src/abg-ir.cc (get_type_name): Take a reference to type_sptr. (suppression_base::priv::{get_file_name_regex, get_file_name_not_regex, get_soname_regex, get_soname_not_regex}): Return a reference to regex_t_sptr. 2016-05-20 Dodji Seketeli Minimize number of string::length calculation * src/abg-tools-utils.cc (string_ends_with): Call string::length just once on each instance of string that matters. 2016-05-20 Dodji Seketeli Avoid unnecessary computation of type name in suppression evaluation * src/abg-suppression.cc (type_suppression::suppresses_type): If neither the type suppression "name" or "name_regex" properties where provided in the suppression specification, then do not try to look at the type name. 2016-05-22 Dodji Seketeli Plug leak of diffs of member variables of class type * include/abg-comparison.h (diff_wptr, unordered_diff_sptr_set): New typedefs. (struct diff_sptr_hasher): Define new type. (diff_context::keep_diff_alive): Declare new member function. (diff::children_nodes): Return a vector of diff*, rather than a vector of diff_sptr. * src/abg-comparison.cc (diff_context::priv::live_diffs_): New data member. (diff_context::keep_diff_alive): Define new data member. (diff::priv::children_): Make this be a vector of diff*, rather than a vector of diff_sptr. (diff_less_than_functor::operator()): Add a new overload for diff*. Make the existing overload of diff_sptr use the new one. (diff::children_nodes): Adjust; (diff::append_child_node): Make sure the child node is kept alive. Only add the naked pointer to the child node to the vector of children. (diff::traverse): Adjust. (var_diff::priv::type_diff_): Make this be a weak pointer, rather than a shared pointer. (var_diff::type_diff): The var_diff::priv::type_diff_ data member is now a weak pointer, so make this accessor convert it to a shared pointer. (corpus_diff::priv::children_): Turn this into a vector of diff*, rather than a vector of diff_sptr. (corpus_diff::children_nodes): Adjust. (corpus_diff::append_child_node): Make sure the child node is kept alive. Only add the naked pointer to the child node to the vector of children. (category_propagation_visitor::visit_end): Adjust. (suppression_categorization_visitor::visit_end): Adjust. (redundancy_marking_visitor::{visit_begin, visit_end}): Adjust. 2016-05-20 Dodji Seketeli Speedup diff node child insertion * src/abg-comparison.cc (corpus_diff::append_child_node): Insert the new child at the right point in the vector of children, so that it remains sorted. 2016-05-21 Dodji Seketeli Fix invocation of delete operator in test-read-dwarf.cc * tests/test-read-dwarf.cc (main): Call delete[], not delete. 2016-05-22 Dodji Seketeli Plug leak of debug info handles * configure.ac: Check the presence of dwarf_getalt in libdw. If it's present, define the preprocessor macro LIBDW_HAS_DWARF_GETALT. Update the autoconf configuration summary. * src/abg-dwarf-reader.cc: Add config.h. (find_alt_debug_info_location): Factorize this out of ... (find_alt_debug_info): ... this function. Use dwarf_getalt if present, otherwise, keep using dwfl_standard_find_debuginfo. In the later case, return the file descriptor opened to access the alternate debug info, by parameter, so that the caller can fclose it. (read_context::alt_fd_): New data member. (read_context::read_context): Initialize the new alt_fd_ data member. (read_context::load_debug_info): Store the file descriptor used to access the alternate debug info into the new alt_fd_ data member. (read_context::~read_context): New desctructor. (get_soname_of_elf_file, get_type_of_elf_file): Free the elf handle. (read_context::load_debug_info): Be paranoid in making sure we never override alt_dwarf_. * tests/data/test-alt-dwarf-file/test0-report.txt: Adjust. 2016-05-22 Dodji Seketeli Plug leak of shared private data of class_diff type * include/abg-comparison.h (class_diff::get_priv): Declare new member function. (class_diff::get_priv): Define new member function. (class_diff::{chain_into_hierarchy, base_changes, deleted_bases, inserted_bases, changed_bases, base_changes, member_types_changes, member_types_changes, data_members_changes, inserted_data_members, deleted_data_members, member_fns_changes, changed_member_fns, member_fns_changes, deleted_member_fns, inserted_member_fns, member_fn_tmpls_changes, member_class_tmpls_changes, member_class_tmpls_changes, report}): Rather than accessing class_diff::priv directly, use the new class_diff::get_priv. 2016-05-21 Dodji Seketeli Remove circular ref from class_decl::priv::definition_of_declaration * include/abg-ir.cc (class_decl::get_definition_of_declaration): Return a shared pointer, rather than a reference to a shared pointer. * src/abg-ir.cc (class_decl::priv::definition_of_declaration_): Make this be a weak pointer. (class_decl::get_definition_of_declaration): Likewise. And return the shared pointer built out of the weak pointer we have in there now. 2016-05-21 Dodji Seketeli Plug leak of regex_t in suppression engine * include/abg-sptr-utils.h (build_sptr): Declare an overload that allocates a T* and wraps it into a shared_ptr. (build_sptr): Declare a specialization for regex_t. * src/abg-corpus.cc (build_sptr()): Define the specialization here. * src/abg-suppression.ccp (suppression_base::priv::{get_file_[not]_name_regex, get_soname_[not]_regex}): Use the new build_sptr(). (type_suppression::priv::{get_type_name_regex, get_source_location_to_keep_regex}): Likewise. (function_suppression::parameter_spec::priv::get_type_name_regex): Likewise. (function_suppression::priv::{get_name_regex, get_return_type_regex, get_symbol_name_regex, get_symbol_version_regex}): Likewise. (variable_suppression::priv::{get_name_regex, get_symbol_name_regex, get_symbol_version_regex, get_type_name_regex}): Likewise. 2016-05-18 Dodji Seketeli Plug leak of diff_context_sptr after calling compute_diff * src/abg-comparison.cc (diff::priv::ctxt_): Make this a weak_ptr. (diff::priv::get_context): Convert the weak pointer to the context into a shared_ptr and return it. (diff::priv::is_filtered_out): Adjust to use diff::priv::get_context() to access the context. (diff::context): Likewise. (corpus_diff::priv::ctxt_): Make this a weak_ptr. (corpus_diff::priv::priv): Add a new overload that takes two corpora and a diff context. (corpus_diff::priv::get_context): Convert the weak pointer to the context into a shared_ptr and return it. (corpus_diff::priv::ensure_lookup_tables_populated): Adjust to use the new corpus_diff::priv::get_context to get the context. (variable_is_suppressed): Likewise. (corpus_diff::priv::{apply_suppressions_to_added_removed_fns_vars, apply_filters_and_compute_diff_stats, emit_diff_stats, categorize_redundant_changed_sub_nodes, clear_redundancy_categorization}): Likewise. (corpus_diff::{corpus_diff, context, apply_filters_and_suppressions_before_reporting}): Adjust. * tools/abipkgdiff.cc (compare): Make the overload that compares elf binaries take a diff context output parameter. After the context is created by this function, it's return to the caller, so that it's life time is bound to the scope this function was called from. (pthread_routine_compare): Create a shared pointer to hold a reference on a diff context. Pass that shared pointer by reference to the compare function that compares elf binaries. Rather than storing corpora in the reports_map, (as those corpora would then out-live the diff context and thus create memory corruption issues), emit the report directly into an ostringstream and store that stream in reports_map. (compare): In the overoad that compares packages, rather than trying to get corpora from the report_map, just emit the content of the ostringstream that is now there. 2016-05-22 Dodji Seketeli Fix a read passed-the-end in abg-dwarf-reader.cc * src/abg-dwarf-reader.cc (lookup_symbol_from_gnu_hash_tab): Do not read passed the end of the array. 2016-05-21 Dodji Seketeli Support running "make check-valgrind" * autoconf-archive/ax_valgrind_check.m4: Add new file. Copied it from http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html. * configure.ac: Include the new ax_valgrind_check.m4 file. Initialize the valgrind checking on tests. Update the configure status. * tests/test-valgrind-suppressions.supp: New valgrind suppression file to silence memcheck leak errors from python. * tests/Makefile.am: Add test-valgrind-suppressions.supp to source distribution. Add check-valgrind-memcheck-recursive target. 2016-05-22 Dodji Seketeli Update the CONTRIBUTING file * CONTRIBUTING: Cleanup. 2016-05-22 Dodji Seketeli Update the COMMIT-LOG-GUIDELINES file * COMMIT-LOG-GUIDELINES: Various enhancements. 2016-05-16 Dodji Seketeli Do not run fedabipkgdiff tests if --enable-fedabipkgdiff is turned off * tests/Makefile.am: Make running runtestfedabipkgdiff be dependent on ENABLE_FEDABIPKGDIFF. 2016-05-13 Chenxiong Qi Fix pep8 error * tools/fedabipkgdiff (build_commandline_args_parser): Fix PEP8 error, line is too long. 2016-05-13 Chenxiong Qi Use consistent string format * tools/fedabipkgdiff (download_rpm): do not omit positional argument specifiers in string format. 2016-05-16 Dodji Seketeli Remove config.h.in from the repository * config.h.in: Remove from repository. 2016-02-09 Chenxiong Qi Bug 19428 - New fedabipkgdiff utility * autoconf-archive/ax_compare_version.m4: New file copied from the autoconf-archive project. * autoconf-archive/ax_prog_python_version.m4: Likewise. * autoconf-archive/ax_python_module.m4: Likewise. * Makefile.am: Add the new files above to the source distribution. * configure.ac: Include the new m4 macros from the autoconf archive. Add a new --enable-fedabipkgdiff option. Update the report at the end of the configure process to show the status of the fedabipkgdiff feature. Add check for prerequisite python modules argparse, glob, logging, os, re, shlex, subprocess, sys, itertools, urlparse, itertools, shutil, unittest, xdg, koji and mock. These are necessary for the unit test of fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the build directory, from the tests/runtestfedabipkgdiff.py.in input file. * tools/Makefile.am: Include the fedabipkgdiff to the source distribution and install it if the "fedabipkgdiff" feature is enabled. * tests/Makefile.am: Rename runtestfedabipkgdiff.sh into runtestfedabipkgdiff.py. Add the new runtestfedabipkgdiff.py.in autoconf template file in here. * tests/runtestfedabipkgdiff.py.in: New unit test file. * tools/fedabipkgdiff: New fedabipkgdiff tool. * doc/manuals/fedabipkgdiff.rst: New manual. 2016-05-07 Dodji Seketeli Implement a [suppress_file] suppression directive * doc/manuals/libabigail-concepts.rst: Document the new 'suppress_file' directive. * include/abg-suppression.h (file_suppression): Define new class. (file_suppression_sptr): Define new typedef. (is_file_suppression, file_is_suppressed): Declare new functions. * src/abg-suppression.cc (): (read_file_suppression, is_file_suppression, file_is_suppressed): Define new functions. (file_suppression::{file_suppression, suppresses_file, ~file_suppression}): Define new member functions. * tools/abidiff.cc (main): If a suppression specification suppresses one of the input files, then do not perform the comparison. * tools/abipkgdiff.cc (compare): If a suppression specification suppresses a file that is to be compared, then do not perform the comparison. * tools/abicompat.cc (create_diff_context): New static function. (perform_compat_check_in_normal_mode) (perform_compat_check_in_weak_mode): Adjust to take a context in parameter. Do not create a diff context here anymore, do not load suppression files here either. (main): Use the new create_diff_context to create a diff context and initialize it, including loading suppression specifications. If any suppression specification suppresses a file to load, then do not load perform any compatibility checking. Adjust invocations of perform_compat_check_in_weak_mode and perform_compat_check_in_normal_mode to pass the diff context. * tests/data/test-diff-suppr/test0-type-suppr-3.suppr: New test input. * tests/data/test-diff-suppr/test0-type-suppr-4.suppr: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-5.suppr: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-6.suppr: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-6.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-7.txt: Likewise. * tests/test-diff-suppr.cc (in_out_specs): Use the new test inputs. * tests/data/test-abicompat/test0-fn-changed-1.suppr: New test input. * tests/data/test-abicompat/test0-fn-changed-report-3.txt: Likewise. * tests/test-abicompat.cc (in_out_specs):: Use the new test inputs. * tests/data/Makefile.am: Add the new test material to source distribution. 2016-05-07 Dodji Seketeli Split suppression engine off of abg-comparison.{cc,h} * include/Makefile.am: Add abg-suppression.h to source distribution. * include/abg-comparison.h: Remove abg-ini.h include directive. (suppression_sptr, suppressions_type): Move these typedefs to abg-fwd.h. (class suppression_base, type_suppression) (type_suppression::insertion_range) (type_suppression::insertion_range::boundary) (type_suppression::insertion_range::integer_boundary) (type_suppression::insertion_range::fn_call_expr_boundary) (function_suppression, function_suppression::parameter_spec) (variable_suppression): Move these type definitions to the new abg-suppression.h. (read_suppressions, is_type_suppression, is_integer_boundary) (is_fn_call_expr_boundary, is_function_suppression) (is_variable_suppression, operator&) (operator|): Move these function declarations to the new abg-suppression.h. (type_suppression, type_suppression_sptr, type_suppression_type) (function_suppression, function_suppression_sptr) (function_suppressions_type, variable_suppression) (variable_suppression_sptr, variable_suppressions_type): Move these forward declaration and typedefs to the new abg-suppression.h. (diff_context::suppressions): Adjust return type to suppr::suppressions_type&. (diff_context::add_suppression): Adjust parameter type to suppr::suppressions_sptr. (diff_context::add_suppressions): Adjust parameter type suppr::suppressions_type&. (is_type_diff, is_decl_diff, is_var_diff, is_function_decl_diff) (is_pointer_diff, is_reference_diff, is_fn_parm_diff) (is_base_diff, is_child_node_of_function_parm_diff) (is_child_node_of_base_diff): Declare these new functions. They were previously static, local to abg-comparison.cc only. Now they need to be exported because they are used by the suppression engine's code that now lives in its one files. * include/abg-fwd.h (suppr::{suppression_base, suppression_sptr, suppressions_type}): Forward declare these here. * include/abg-suppression.h (class suppression_base) (type_suppression, type_suppression::insertion_range) (type_suppression::insertion_range::boundary) (type_suppression::insertion_range::integer_boundary) (type_suppression::insertion_range::fn_call_expr_boundary) (function_suppression, function_suppression::parameter_spec) (variable_suppression): Move these type definitions here, in the namespace suppr. (read_suppressions, is_type_suppression, is_integer_boundary) (is_fn_call_expr_boundary, is_function_suppression) (is_variable_suppression, operator&) (operator|): Move these function decalration here, in the namespace suppr. (type_suppression_sptr, type_suppressions_type) (function_suppression_sptr, function_suppressions_type) (variable_suppression_sptr, variable_suppressions_type): Move these typedefs here, in the namespace suppr. * src/Makefile.am: add src/abg-suppression.cc to source distribution. * src/abg-comparison.cc (is_type_diff, is_decl_diff, is_var_diff) (is_function_decl_diff, is_pointer_diff, is_reference_diff) (is_reference_or_pointer_diff, is_fn_parm_diff, is_base_diff) (is_child_node_of_function_parm_diff, is_child_node_of_base_diff): Export these functions. (*suppression*): Move all the suppression-related definitions to the new abg-suppression.cc. * src/abg-suppression.cc: New file. Contains all the *suppression* definitions from src/abg-comparison.cc, that are put in the suppr namespace. * tools/abicompat.cc: Adjust. * tools/abidiff.cc: Likewise. * tools/abipkgdiff.cc: Likewise. 2016-05-08 Dodji Seketeli Fix indentation for abidiff manual * doc/manuals/abidiff.rst: Fix indentation for the --suppression paragraph. 2016-05-08 Dodji Seketeli Add several shortcuts to options for abicompat * doc/manuals/abicompat.rst: Update documentation. * tools/abicompat.cc (display_usage): Update help strings. (parse_command_line): Add shortcuts --suppr, --appd, --libd1 and --libd2. 2016-05-08 Dodji Seketeli Update copyright year in tools/abicompat.cc * tools/abicompat.cc: Update copyright years to 2016. 2016-05-07 Dodji Seketeli Fix mention of tool's name in abidiff error message * src/abg-tools-utils.cc (emit_prefix): Try to emit the prefix only if the program name was provided. * abidiff.cc (maybe_check_suppression_files): Pass the name of the tool to the check_file function. 2016-05-07 Dodji Seketeli Update copyright year on abg-comparison.h * include/abg-comparison.h: Update copyright year. 2016-05-08 Dodji Seketeli Doc not show classes' inherited members in apidoc * doc/api/libabigail.doxy: Don't show inherited member functions or variables of a given class. 2016-05-08 Dodji Seketeli Fix typo in concept manual * doc/manuals/libabigail-concepts.rst: Do not refer to abidiff specifically for suppressions because several tools use suppressions. 2016-05-08 Dodji Seketeli Fix indentation in concepts manual * doc/manuals/libabigail-concepts.rst: Fix indentation. 2016-05-06 Dodji Seketeli Add some apidoc to dwarf_reader * include/abg-dwarf-reader.h (namespace dwarf_reader): Add apidoc. (enum elf_type): Add an apidoc for each enumerator. * src/abg-dwarf-reader.cc (get_type_of_elf_file): Add an apidoc for the 'type' parameter. 2016-04-28 Dodji Seketeli [abipkgdiff] Show SONAME of removed/added libraries * tools/abipkgdiff.cc (abi_diff::{added,removed}_binaries): Change the type of these data member from vector to vector. (compare): Adjust. Show the soname of added/removed binaries. 2016-04-27 Dodji Seketeli Bug 20015 - support file_name_not_regexp and soname_not_regexp in suppr specs * include/abg-comparison.h (suppression_base::{get,set}_file_name_not_regex_str): Declare new member functions. (suppression_base::{get,set}_soname_not_regex_str): Likewise. (suppression_base::{names,sonames}_of_binaries_match): Likewise. * src/abg-comparison.cc (suppression_base::priv::get_file_name_regex): Fix comment. (suppression_base::priv::get_file_name_not_regex): New member function. (suppression_base::priv::get_soname_regex): Fix comment. (suppression_base::priv::get_soname_not_regex): New member function. (suppression_base::{get,set}_file_name_not_regex_str): Define new member functions. (suppression_base::{get,set}_soname_not_regex_str): Likewise. (suppression_base::{names,sonames}_of_binaries_match): Likewise. These got factorized out of type_suppression::suppresses_type, function_suppression::suppresses_function, function_suppression::suppresses_function_symbol, variable_suppression::suppresses_variable, variable_suppression::suppresses_variable_symbol. (type_suppression::suppresses_type): Use the new suppression_base::{names,sonames}_of_binaries_match. (read_type_suppression): Read the new file_name_not_regexp and soname_not_regexp properties. (function_suppression::{suppresses_function, suppresses_function_symbol}): Use the new suppression_base::{names,sonames}_of_binaries_match. (read_function_suppression): Read the new file_name_not_regexp and soname_not_regexp properties. (variable_suppression::{suppresses_variable, variable_suppression::suppresses_variable_symbol}): Use the new suppression_base::{names,sonames}_of_binaries_match. (read_variable_suppression): Use the new suppression_base::{names,sonames}_of_binaries_match. * doc/manuals/libabigail-concepts.rst: Document the new file_name_not_regexp and soname_not_regexp suppression properties. * tests/data/test-diff-suppr/test24-soname-report-10.txt: New test reference output. * tests/data/test-diff-suppr/test24-soname-report-11.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-12.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-13.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-14.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-15.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-16.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-9.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-10.txt: New test input. * tests/data/test-diff-suppr/test24-soname-suppr-11.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-12.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-13.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-14.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-15.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-16.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-9.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-2.txt: New test reference output. * tests/data/test-diff-suppr/test29-soname-report-3.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-4.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-5.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-6.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-7.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-8.txt: Likewise. * tests/data/test-diff-suppr/test29-suppr-2.txt: New test input. * tests/data/test-diff-suppr/test29-suppr-3.txt: Likewise. * tests/data/test-diff-suppr/test29-suppr-4.txt: Likewise. * tests/data/test-diff-suppr/test29-suppr-5.txt: Likewise. * tests/data/test-diff-suppr/test29-suppr-6.txt: Likewise. * tests/data/test-diff-suppr/test29-suppr-7.txt: Likewise. * tests/data/test-diff-suppr/test29-suppr-8.txt: Likewise. * tests/data/Makefile.am: Add the new test material to source distribution. * tests/test-diff-suppr.cc (in_out_specs): Make this test harness run over the new test inputs. 2016-04-27 Dodji Seketeli Make API documentation of thread pools visible * include/abg-workers.h: Document the workers namespace, the task, queue and queue::task_done_notify types. * src/abg-workers.cc: Move the documentation of the thread_pool module inside the abigail::worker namespace, so that references to task and queue types (which are also in the abigail::worker namespace) can be resolved in the apidoc. 2016-04-27 Dodji Seketeli Update documentation to require doxygen and python-sphinx for building * COMPILING: Add python-sphinx to the set of required packages to build the documentation. * doc/website/mainpage.txt: Update the website to mention doxygen and python-sphinx for documentation. 2016-04-27 Dodji Seketeli Add doc, info, man and html-doc targets to generate documentation * Makefile.am: Add info, man and html-doc targets to generate documentation in info, man and html formats. If you want to generate them all, then the doc target is the one to be used. * COMPILING: Add documentation for the above. 2016-04-25 Dodji Seketeli Bug 19964 - Cannot load function aliases on ppc64 * src/abg-dwarf-reader.cc (read_context::load_symbol_maps): While filling the ppc64-specific "function-entry-address => symbol" map, if we stumble accross a function-entry-address that belongs to an alias of 'symbol', then assume the alias must have been registered as an alias already, by the platform-agnostic code. Do not try to register the alias again. * tests/data/Makefile.am: Add the new test input binaries to the source distribution. * tests/data/test-diff-dwarf/libtest36-ppc64-aliases-v0.so: New binary test input. * tests/data/test-diff-dwarf/libtest36-ppc64-aliases-v1.so: Likewise. * tests/data/test-diff-dwarf/test36-ppc64-aliases-report-0.txt: New test reference output. * tests/data/test-diff-dwarf/test36-ppc64-aliases-v0.cc: Source code for the new binary test input above. * tests/data/test-diff-dwarf/test36-ppc64-aliases-v1.cc: Likewise. * tests/test-diff-dwarf.cc: Add the new test input to the list of test inputs considered by this test harness. 2016-04-20 Sinny Kumari Bug 19961 - Distinguish between PI executable and shared library * include/abg-dwarf-reader.h (elf_type): Add new enumerator ELF_TYPE_PI_EXEC. * src/abg-dwarf-reader.cc (lookup_data_tag_from_dynamic_segment): New function for data tag lookup in dynamic segment of an elf (elf_file_type): Return ELF_TYPE_PI_EXEC file type for a PI executable. (get_elf_file_type): Change this to take an elf handle. (get_type_of_elf_file): New function that got factorized out of ... (load_dt_soname_and_needed): ... this one. * tools/abipkgdiff.cc (create_maps_of_package_content): Also consider ELF_TYPE_PI_EXEC file type. (compare): Likewise. * tests/test-diff-pkg.cc (in_out_specs): Test case additions * tests/data/Makefile.am: Include test files * tests/data/test-diff-pkg/tarpkg-1-dir1.tar.gz: New test data * tests/data/test-diff-pkg/tarpkg-1-dir2.tar.gz: New test data * tests/data/test-diff-pkg/tarpkg-1-report-0.txt: New test result 2016-04-17 Dodji Seketeli Update website to 1.0.rc4 * doc/website/mainpage.txt: Update tarball reference to 1.0.rc4 2016-04-17 Dodji Seketeli Bump current version number to 1.0.rc5 * configure.ac: Bump current version number to 1.0.rc5 2016-04-17 Dodji Seketeli Add a 'release' target to main Makefile * Makefile.am: Add tarball, upload-release-only, upload-release and release targets. 2016-04-11 Dodji Seketeli Update ChangeLog for 1.0.rc4 * ChangeLog: Update automatically by running "make update-changelog" 2016-04-11 Dodji Seketeli Update NEWS for 1.0.rc4 * NEWS: Update for 1.0.rc4 2016-04-16 Dodji Seketeli Fix typos in the suppression specifications manual * doc/manuals/libabigail-concepts.rst: Fix typos. 2016-04-16 Dodji Seketeli Ease use of soname_regexp/file_name_regexp in suppr specs * doc/manuals/libabigail-concepts.rst: Update the manual to reflect the changes in the suppression_type, suppress_function and suppress_variable directives. * src/abg-comparison.cc (read_type_suppression): Accept that the suppress_type directive contains only file_name_regexp or the soname_regexp property. (read_function_suppression): Likewise for the suppress_function directive. (read_variable_suppression): Likewise for the suppress_variable directive. * tests/data/test-diff-suppr/libtest29-soname-v0.so: New binary test input. * tests/data/test-diff-suppr/libtest29-soname-v1.so: Likewise. * tests/data/test-diff-suppr/test24-soname-report-5.txt: New reference test output. * tests/data/test-diff-suppr/test24-soname-report-6.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-7.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-report-8.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-5.txt: New test suppression file. * tests/data/test-diff-suppr/test24-soname-suppr-6.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-7.txt: Likewise. * tests/data/test-diff-suppr/test24-soname-suppr-8.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-report-0.txt: New reference test output. * tests/data/test-diff-suppr/test29-soname-report-1.txt: Likewise. * tests/data/test-diff-suppr/test29-soname-v0.cc: Source code for the new binary output above. * tests/data/test-diff-suppr/test29-soname-v1.cc: Likewise. * tests/data/test-diff-suppr/test29-suppr-0.txt: New test suppression file. * tests/data/test-diff-suppr/test29-suppr-1.txt: Likewise. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-suppr.cc (in_out_specs): Make this test harness run over the new test input above. 2016-03-31 Dodji Seketeli Fix comments in tests/test-diff-pkg.cc * tests/test-diff-pkg.cc: Fix the wording of the introductory comments. 2016-03-30 Dodji Seketeli Bug 19885 - Cannot associates a function DIE to a symbol on powerpc64 *from* the address of its entry point. More precisely, on ppc64, the address of a function is the address of a function descriptor. The function descriptor is a set of three 64 bits addresses. The first element of the triplet is the function entry pointer address. So to get the symbol a given function entry point address belongs to, one must get to the function descriptor which contains said function entry point address. And function descriptors are in the ".opd" special section. Unfortunately, Libabigail's ELF/DWARF reader has no knowledge of all this. So it cannot get the symbol of a given function DWARF description. So it considers all functions as having no ELF symbols. So it shows no ABI change pertaining to function sub-types on ppc64. This patch makes Libabigail support function descriptors on ppc64 so it can detect changes on function sub-types there. * src/abg-dwarf-reader.cc (read_context::{opd_section_, fun_entry_addr_sym_map_}): New data members. (read_context::read_context): Initialize the new opd_section_ data member. (read_context::{find_opd_section, lookup_ppc64_elf_fn_entry_pointer_address, fun_entry_addr_sym_map_sptr, fun_entry_addr_sym_map, elf_architecture_is_ppc64, elf_architecture_is_big_endian}): New member functions. (read_context::lookup_elf_fn_symbol_from_address): Adjust to use the new read_context::fun_entry_addr_sym_map() function. (read_context::load_symbol_maps): Populate the function entry addresses -> symbol map, for ppc64 ELFv1. (read_context::load_elf_properties): Renamed read_context::load_remaining_elf_data into this. (read_corpus_from_elf): Load elf properties before trying to load elf symbols information. * tests/data/test-diff-filter/libtest32-struct-change-v0.so: New binary test input, compiled for ppc64le. * tests/data/test-diff-filter/libtest32-struct-change-v1.so: Likewise. * tests/data/test-diff-filter/test32-ppc64le-struct-change-report0.txt: New test reference output. * tests/data/test-diff-filter/test32-ppc64le-struct-change-v0.c: Source code of the new binary test input above. * tests/data/test-diff-filter/test32-ppc64le-struct-change-v1.c: Likewise. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-filter.cc (in_out_spec): Make this test harness run over the new test input binaries above. 2016-03-25 Dodji Seketeli Fix logs in abipkgdiff and add some more * tools/abipkgdiff.cc (compare): Fix logs to make them more readable in a multithreaded context. (create_maps_of_package_content): Likewise. Add logs about the number of elf files found in a given directory. Add logs about skipping files. 2016-03-25 Dodji Seketeli Bug 19867 - abipkgdiff skips symbolic links * include/abg-tools-utils.h (maybe_get_symlink_target_file_path): Declare new function. * src/abg-tools-utils.cc (get_stat): Use lstat here, not stat. Update comment. * tools/abipkgdiff.cc (first_package_tree_walker_callback_fn) (second_package_tree_walker_callback_fn): Follow symbolic links to elf files to get their target paths, and only work with that target path. (maybe_get_symlink_target_file_path): Define new function. * test-diff-pkg/symlink-dir-test1-report0.txt New test material. * test-diff-pkg/symlink-dir-test1/dir1/symlinks/foo.o: Likewise. * test-diff-pkg/symlink-dir-test1/dir1/symlinks/libfoo.so: Likewise. * test-diff-pkg/symlink-dir-test1/dir1/targets/foo.c: Likewise. * test-diff-pkg/symlink-dir-test1/dir1/targets/foo.o: Likewise. * test-diff-pkg/symlink-dir-test1/dir1/targets/libfoo.so: Likewise. * test-diff-pkg/symlink-dir-test1/dir2/symlinks/foo.o: Likewise. * test-diff-pkg/symlink-dir-test1/dir2/symlinks/libfoo.so: Likewise. * test-diff-pkg/symlink-dir-test1/dir2/targets/foo.c: Likewise. * test-diff-pkg/symlink-dir-test1/dir2/targets/foo.o: Likewise. * test-diff-pkg/symlink-dir-test1/dir2/targets/libfoo.so: Likewise. * tests/data/Makefile.am: Add the new test material to source distribution. * tests/test-diff-pkg.cc (in_out_spec): Run this test harness over the new test material above. 2016-03-21 Dodji Seketeli Fix typo on the web page * doc/website/mainpage.txt: Fix typo. 2016-03-18 Roland McGrath Fix typo in configure --enable-deb help text * configure.ac: Fix typo in --enable-deb usage text. 2016-03-18 Dodji Seketeli Bug 19846 - variable decl associated with the wrong debug info section * src/abg-dwarf-reader.cc (build_ir_node_from_die): Associate the decl of the variable to the same debug info file (alternate or not) as the DIE, not as its specification DIE. 2016-03-18 Dodji Seketeli Fix typo in the manual of abidiff * doc/manuals/abidiff.rst: Fix typo. 2016-03-18 Dodji Seketeli Fix typos in comments in src/abg-dwarf-reader.cc * src/abg-dwarf-reader.cc (read_context::{die_type_map, is_wip_class_die_offset, is_wip_function_type_die_offset}): Fix typo in comments. 2016-03-18 Dodji Seketeli Bug 19844 - Cannot try to canonicalize a type that is being constructed * src/abg-dwarf-reader.cc (read_context::{alternate_die_wip_classes_map_, alternate_die_wip_function_types_map_}): New data members. (read_context::lookup_type_from_die_offset): Lookup WIP class and function types too. (read_context::{die_wip_classes_map, die_wip_function_types_map}): Take a flag saying if we should get the map for the alternate debug info section or not. (read_context::{is_wip_class_die_offset, is_wip_function_type_die_offset}): Take a flagy saying if the DIE is in the alternate debug info section or not. (build_class_type_and_add_to_ir, build_function_type) (maybe_canonicalize_type): Adjust. (build_ir_node_from_die): Do not call maybe_canonicalize_type on type DIEs which no type has been constructed for. * tests/data/test-diff-pkg/gtk2-debuginfo-2.24.22-5.el7.i686.rpm: New test input. * tests/data/test-diff-pkg/gtk2-debuginfo-2.24.28-8.el7.i686.rpm: Likewise. * tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.22-5.el7.i686.rpm: Likewise. * tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.28-8.el7.i686.rpm: Likewise. * tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.22-5.el7.i686--gtk2-immodule-xim-2.24.28-8.el7.i686-report-0.txt: New test reference output. * tests/data/Makefile.am: Add the new test material to the source distribution. * tests/test-diff-pkg.cc (in_out_spec): Make this test harness run on the new test input above. 2016-03-16 Dodji Seketeli Fix a typo in include/abg-tools-utils.h * include/abg-tools-utils.h (enum abidiff_status): Fix typo in comment. 2016-03-16 Dodji Seketeli Update copyright dates for the manuals * doc/manuals/conf.py: Update copyright years. 2016-03-16 Dodji Seketeli More docs about ABIDIFF_ABI_INCOMPATIBLE_CHANGE * doc/manuals/abidiff.rst: Explain the kind of changes that flip the ABIDIFF_ABI_INCOMPATIBLE_CHANGE flag. 2016-03-09 Dodji Seketeli Fix typos on the web page * doc/website/mainpage.txt: Fix typos. 2016-03-08 Dodji Seketeli Bump version number to 1.0.rc4 * configure.ac: Bump version number to 1.0.rc4 2016-03-08 Dodji Seketeli Fix potential race condition in test-diff-pkg.cc * tests/test-diff-pkg.cc (in_out_spec): Make the tar format tests output have different names. 2016-03-08 Dodji Seketeli Updated website to point to 1.0.rc3 tarball * doc/website/mainpage.txt: Updated website to point to 1.0.rc3 tarball. 2016-03-08 Dodji Seketeli Update ChangeLog before 1.0.rc3 * ChangeLog: Update for 1.0.rc3 2016-03-08 Dodji Seketeli Update NEWS file for 1.0.rc3 * NEWS: update for 1.0.rc3 2016-03-07 Dodji Seketeli Walk function_type_diff tree in a deterministic way * src/abg-comparison.cc (function_type_diff::priv::{sorted_subtype_changed_parms_, sorted_changed_parms_by_id_}): Add two data members. (function_type_diff::ensure_lookup_tables_populated): Sort the changed parameters here ... (function_type_diff::report): ... not here. (function_type_diff::chain_into_hierarchy): Chain the *sorted* changed parameters. 2016-03-07 Dodji Seketeli Fix reference to test file in Makefile.am * tests/data/Makefile.am: Fix bogus reference to libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt. 2016-03-07 Dodji Seketeli Bug 19780 - abipkgdiff doesn't support parallel execution * tools/abipkgdiff.cc: Update copyright notice. (package::extracted_packages_parent_dir): Use mkdtemp to generate the unique root directory under which packages are extracted. * tests/test-diff-pkg.cc (struct test_task): New type. (main): Use worker threads to run abipkgdiff in parallel, depending on the number of CPUs advertised by the underlying machine. 2016-03-07 Dodji Seketeli Bug 19778 - diff_has_ancestor_filtered_out() loops forever * src/abg-comparison.cc (diff_has_ancestor_filtered_out): Add an overload that takes an additional map of pointer values. Make the older overload call the new one. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm: New test material. * tests/data/test-diff-pkg/libICE-1.0.6-1.el6.x86_64.rpm--libICE-1.0.9-2.el7.x86_64.rpm-report-0.txt: New reference output. * tests/data/test-diff-pkg/libICE-1.0.9-2.el7.x86_64.rpm: New test material. * tests/data/test-diff-pkg/libICE-debuginfo-1.0.6-1.el6.x86_64.rpm: New test material. * tests/data/test-diff-pkg/libICE-debuginfo-1.0.9-2.el7.x86_64.rpm: New test material. * tests/data/Makefile.am: Add the new test material to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Run this test harness over the new tests material above. 2016-03-07 Dodji Seketeli Forgot to add test2-filtered-removed-fns-v{0,1}.o * test2-filtered-removed-fns-v{0,1}.o: Add these test input files. 2016-03-03 Dodji Seketeli Bug 19596 - Suppressed removed symbol changes still considered incompatible * src/abg-comparison.cc (corpus_diff::has_incompatible_changes): Consider the *net* number of removed function and variable symbols. Also, if all function sub-type changes have been suppressed, then no virtual offset change should be considered incompatible. * tests/data/test-abidiff-exit/test1-voffset-change-report1.txt * tests/data/test-abidiff-exit/test1-voffset-change.abignore * tests/data/test-abidiff-exit/test2-filtered-removed-fns-report0.txt * tests/data/test-abidiff-exit/test2-filtered-removed-fns-report1.txt * tests/data/test-abidiff-exit/test2-filtered-removed-fns-v0.c * tests/data/test-abidiff-exit/test2-filtered-removed-fns-v1.c * tests/data/test-abidiff-exit/test2-filtered-removed-fns.abignore * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-abidiff-exit.cc (InOutSpec::in_suppr_path): New data member. (in_out_specs): Adjust. Add new test inputs. (main): Adjust. 2016-02-25 Dodji Seketeli Fixup virtual member functions with linkage and no underlying symbol * src/abg-dwarf-reader.cc (die_function_decl_map_type): New typedef. (read_context::die_function_with_no_symbol_map_): New data member. (read_context::die_function_decl_with_no_symbol_map): New accessor. (read_context::fixup_functions_with_no_symbols): New member function. (finish_member_function_reading): Take a read_context. Schedule virtual member functions with linkage and no underlying symbol to be fixed up after all the debug info is read. (build_function_decl): After a virtual member function_decl has been updated, if it has its underlying symbol and was scheduled for fixup, then de-schedule it. (build_class_type_and_add_to_ir, build_ir_node_from_die): Adjust call to finish_member_function_reading. (read_corpus_from_elf): Move the pure ELF (symbol and other mundane information) information reading ... (read_debug_info_into_corpus): ... here. Make it happen *before* actual reading of DWARF information. We need symbol information to be present and fully set before we start reading debug info. This is so that we can know when a virtual member function doesn't need to be fixed up. Also, perform the fixup after the debug information was read. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. 2016-02-25 Dodji Seketeli Add --verbose to abidw * 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. 2016-02-25 Dodji Seketeli Update copyright information * tools/abidiff.cc: Update copyright info for 2016. * tools/abidw.cc: Likewise. 2016-02-24 Dodji Seketeli Make libabigail link with pthread * src/Makefile.am: Add -pthread to libabigail_la_LDFLAGS. * tools/Makefile.am: Do not use abinilint_LDFLAGS when it should be abinilint_LDADD. This one was fixed by Michi Henning. 2016-02-24 Dodji Seketeli Update mentions to the build dependencies in the doc * COMPILING: Mention elfutils, libtool, autoconf, automake and libtool. * doc/website/mainpage.txt: Mention automake and libtool. Fix a typo. 2016-02-24 Dodji Seketeli Bug 19706 - Core dump from abidiff with suppression * src/abg-comparison.cc (function_suppression::suppresses_function): Make sure a function has a symbol before (de)referencing it. 2016-02-24 Dodji Seketeli Some small speed optimizations * include/abg-ir.h (var_decl::get_naked_type): Declare new member function. * src/abg-ir.cc (var_decl::get_naked_type): Define it. (equals): For the var_decl overload, avoid copying symbol smart pointers. Likewise for variable type smart pointers. (hash_type_or_decl): Avoid accessing canonical type smart pointer. 2016-02-24 Dodji Seketeli Mist style cleanups * include/abg-ir.h: Add missing comments. Space cleanups. Use shorter typedefs rather than long template instantiation names. Use string rather than the longer std::string. * src/abg-ir.cc: Space cleanups. Add missing comments. User shorter typedefs. * src/abg-reader.cc: Likewise. * src/abg-writer.cc: Likewise. 2016-02-24 Dodji Seketeli Implement string interning for Libabigail * include/Makefile.am: Add the new abg-interned-str.h file to source distribution. * include/abg-corpus.h (corpus::corpus): Re-arrange the order of * src/abg-corpus.cc (corpus::exported_decls_builder::priv::get_id): Return interned_string rather than std::string. (corpus::corpus): Re-arrange the order of parameters: take an environment as first parameter. parameters: take an environment as first parameter. * include/abg-dwarf-reader.h (lookup_symbol_from_elf) (lookup_public_function_symbol_from_elf): Likewise. * src/abg-dwarf-reader.cc (lookup_symbol_from_sysv_hash_tab) (lookup_symbol_from_gnu_hash_tab) (lookup_symbol_from_elf_hash_tab, lookup_symbol_from_symtab) (lookup_symbol_from_elf, lookup_public_function_symbol_from_elf) (lookup_public_variable_symbol_from_elf, lookup_symbol_from_elf) (lookup_public_function_symbol_from_elf): Take an environment as first parameter and adjust. (build_translation_unit_and_add_to_ir) (build_namespace_decl_and_add_to_ir, build_type_decl) (build_enum_type, finish_member_function_reading) (build_class_type_and_add_to_ir, build_function_type) (read_debug_info_into_corpus, read_corpus_from_elf): Adjust. * include/abg-fwd.h: Include abg-interned-str.h (get_type_name, get_function_type_name, get_method_type_name): Return a interned_string, rather than a std::string. * include/abg-interned-str.h: New declarations for interned strings and their pool. * include/abg-ir.h (environment::intern): Declare new method. (elf_symbol::{g,s}et_environment): Likewise. (type_or_decl_base::type_or_decl_base): Make the default constructor private. ({translation, type_or_decl_base}::set_environment) (set_environment_for_artifact): Take a const environment*. (elf_symbol::elf_symbol) (elf_symbol::create) (type_or_decl_base::type_or_decl_base) (translation::translation, decl_base::decl_base) (scope_decl::scope_decl, type_base::type_base) (type_decl::type_decl, scope_type_decl::scope_type_decl) (namespace_decl::namespace_decl) (enum_type_decl::enumerator::enumerator) (function_type::function_type, method_type::method_type) (template_decl::template_decl, function_tdecl::function_tdecl) (class_tdecl::class_tdecl, class_decl::class_decl): Take an environment. (type_or_decl_base::operator=) (enum_type_decl::enumerator::get_environment): Declare new method. (decl_base::{peek_qualified_name, peek_temporary_qualified_name, get_qualified_name, get_name, get_qualified_parent_name, get_linkage_name}, qualified_type_def::get_qualified_name) (reference_type_def::get_qualified_name) (array_type_def::get_qualified_name) (enum_type_decl::enumerator::{get_name, get_qualified_name}) ({var,function}_decl::get_id) (function_decl::parameter::{get_type_name, get_name_id}): Return an interned_string, rather than a std::string. (decl_base::{set_qualified_name, set_temporary_qualified_name, get_qualified_name, set_linkage_name}) (qualified_type_def::get_qualified_name) (reference_type_def::get_qualified_name) (array_type_def::get_qualified_name) (function_decl::parameter::get_qualified_name): Take an interned_string, rather than a std::string. (class_decl::member_{class,function}_template::member_{class,function}_template): Adjust. * src/abg-ir.cc (environment_setter::env_): Make this be a pointer to const environment. (environment_setter::visit_begin): Adjust. (interned_string_pool::priv): Define new type. (interned_string_pool::*): Define the method declared in abg-interned-str. h. (operator==, operator!=, operator+): Define operator for interned_string and std::string (operator<<): Define for interned_string. (translation_unit::priv::env_): Make this be a pointer to const environment. (translation_unit::priv::priv): Take a pointer to const environment. (elf_symbol::priv::env_): New data member. (elf_symbol::priv::priv): Adjust. Make an overoad take an environment. (translation_unit::{g,s}et_environment): Adjust. (interned_string_bool_map_type): New typedef. (environment::priv::classes_being_compared_): Make this hastable of string be a hashtable of interned_string. (environment::priv::string_pool_): New data member. (environment::{get_void_type_decl, get_variadic_parameter_type_decl}): Adjust. (type_or_decl_base::priv::env_): Make this be a pointer to const environment. (type_or_decl::base::priv::priv): Adjust. (type_or_decl_base::set_environment) (set_environment_for_artifact): Take a pointer to const environment. (elf_symbol::{g,s}et_environment, environment::intern) (type_or_decl_base::operator=): Define new methods. (decl_base::priv::{name_, qualified_parent_name_, temporary_qualified_name_, qualified_name_, linkage_name_}): Make these data member be of tpe interned_string. (decl_base::priv::priv): Make this take an environment. Adjust. (decl_base::{peek_qualified_name, peek_temporary_qualified_name, get_linkage_name, get_qualified_parent_name, get_name, get_qualified_name}, get_type_name, get_function_type_name) (get_method_type_name, get_node_name) (qualified_type_def::get_qualified_name) (pointer_type_def::get_qualified_name) (array_type_def::get_qualified_name) (enum_type_decl::enumerator::get_qualified_name) (var_decl::get_id, function_decl::get_id) (function_decl::parameter::get_{name_id, type_name}): Return an interned_string. (decl_base::{set_qualified_name, set_temporary_qualified_name}) (qualified_type_def::get_qualified_name) (pointer_type_def::get_qualified_name) (reference_type_def::get_qualified_name) (array_type_def::get_qualified_name) (function_decl::parameter::get_qualified_name): Take an interned_string. (decl_base::{set_name, set_linkage_name}): Intern the std::string passed in parameter. (equals): In the overload for decl_base, adjust for a little speed optimization that is justified by profiling. (pointer_type_def::priv::{internal_qualified_name_, temp_internal_qualified_name_}): Make these data member be interned_string. (enum_type_decl::enumerator::priv::env_): New data member. (enum_type_decl::enumerator::priv::{name_, qualified_name}): Make these data member be of type interned_string. (enum_type_decl::enumerator::get_environment): New method. (enum_type_decl::enumerator::priv::priv) Adjust. (typedef_decl::operator==): Implement a little speed optimization. (var_decl::priv::nake_type_): New data member. (var_decl::priv::id_): Make this data member be of type interned_string. (equals): In the overload for var_decl, function_type, function_decl, adjust for the use of interned_string. (function_decl::priv::id_): Make this be of type interned_string. (scope_decl::{add_member_decl, insert_member_decl}) (lookup_function_type_in_translation_unit) (synthesize_type_from_translation_unit, lookup_node_in_scope) (lookup_type_in_scope, scope_decl::scope_decl) (qualified_type_def::qualified_type_def) (qualified_type_def::get_qualified_name) (pointer_type_def::pointer_type_def) (reference_type_def::reference_type_def) (array_type_def::array_type_def, array_type_def::append_subrange) (array_type_def::get_qualified_name) (enum_type_decl::enum_type_decl) (enum_type_decl::enumerator::get_qualified_name) (enum_type_decl::enumerator::set_name) (typedef_decl::typedef_decl, var_decl::var_decl) (function_type::function_type, method_type::method_type) (function_decl::function_decl) (function_decl::parameter::parameter) (class_decl::priv::comparison_started) (class_decl::add_base_specifier) (class_decl::base_spec::base_spec) (class_decl::method_decl::method_decl) (type_tparameter::type_tparameter) (non_type_tparameter::non_type_tparameter) (template_tparameter::template_tparameter) (type_composition::type_composition) (function_tdecl::function_tdecl, class_tdecl::class_tdecl) (qualified_name_setter::do_update): Adjust. (translation_unit::translation_unit, elf_symbol::elf_symbol) (elf_symbol::create, type_or_decl_base::type_or_decl_base) (decl_base::decl_base, type_base::type_base) (type_decl::type_decl, scope_type_decl::scope_type_decl) (namespace_decl::namespace_decl) (enum_type_decl::enumerator::enumerator, class_decl::class_decl) (template_decl::template_decl, function_tdecl::function_tdecl) (class_tdecl::class_tdecl): Take an environment. * src/abg-comparison.cc (function_suppression::suppresses_function): Adjust. * src/abg-reader.cc (read_translation_unit) (read_corpus_from_input, build_namespace_decl, build_elf_symbol) (build_function_parameter, build_function_decl, build_type_decl) (build_function_type, build_enum_type_decl, build_enum_type_decl) (build_class_decl, build_function_tdecl, build_class_tdecl) (read_corpus_from_native_xml): Likewise. * src/abg-writer.cc (id_manager::m_cur_id): Make this mutable. (id_manager::m_env): New data member. (id_manager::id_manager): Adjust. (id_manager::get_environment): New method. (id_manager::{get_id, get_id_with_prefix}): Return an interned_string. (type_ptr_map): Make this be a hash map of type_base* -> interned_string, rather a type_base* -> string. (write_context::m_env): New data member. (write_context::m_type_id_map): Make this data member be mutable. (write_context::m_emitted_type_id_map): Make this be a hash map of interned_string -> bool, rather than string -> bool. (write_context::write_context): Take an environment and adjust. (write_context::get_environment): New method. (write_context::get_id_manager): New const overload. (write_context::get_id_for_type): Return an interned_string; adjust. (write_context::{record_type_id_as_emitted, record_type_as_referenced}): Adjust. (write_context::type_id_is_emitted): Take an interned_string. (write_context::{type_is_emitted, record_decl_only_type_as_emitted}): Adjust. (write_translation_unit, write_corpus_to_native_xml, dump): Adjust. * tools/abisym.cc (main): Adjust. * tests/data/test-read-write/test22.xml: Adjust. * tests/data/test-read-write/test23.xml: Adjust. * tests/data/test-read-write/test26.xml: Adjust. 2016-02-24 Dodji Seketeli Update copyright notice * include/abg-corpus.h: Update copyright notice. * include/abg-dwarf-reader.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-ir.cc: Likewise. 2016-02-23 Dodji Seketeli Fix crash when handling templates with empty patterns * src/abg-ir.cc (function_tdecl::traverse): Do not crash when traversing a template with empty pattern. (class_tdecl::operator==): Do not crash when comparing templates with empty patterns. 2016-02-23 Dodji Seketeli Add missing inequality operators for ABI artifacts * include/abg-ir.h ({translation_unit, elf_symbol::version, context_rel, decl_base, type_base, type_decl, array_type_def::subrange_type, enum_type_def::enumerator, dm_context_rel, template_parameter}::operator!=): Declare. (operator==): Make the overload form translation_unit_sptr, scope_decl_sptr, class_decl::base_spec_sptr, class_decl::member_function_template_sptr, class_decl::member_class_template_sptr take const references. (operator!=): Declare an an overload for the non-member operator != of translation_unit_sptr, elf_symbol_sptr, type_or_decl_base_sptr, type_base_sptr, scope_decl_sptr, type_decl, qualified_type_def_sptr, pointer_type_def_sptr, reference_type_def_sptr, enum_type_decl_sptr, class_decl_sptr, class_decl::base_spec_sptr, class_decl::member_function_template_sptr, class_decl::member_class_template_sptr. * src/abg-ir.cc ({translation_unit, elf_symbol::version, context_rel, decl_base, type_base, type_decl, array_type_def::subrange_type, enum_type_def::enumerator, dm_context_rel, template_parameter}::operator!=): Define. (operator==): Make the overload for translation_unit_sptr, scope_decl_sptr, class_decl::base_spec_sptr, class_decl::member_function_template_sptr, class_decl::member_class_template_sptr take const references. (operator!=): Define an an overload for the non-member operator != of translation_unit_sptr, elf_symbol_sptr, type_or_decl_base_sptr, type_base_sptr, scope_decl_sptr, type_decl, qualified_type_def_sptr, pointer_type_def_sptr, reference_type_def_sptr, enum_type_decl_sptr, class_decl_sptr, class_decl::base_spec_sptr, class_decl::member_function_template_sptr, class_decl::member_class_template_sptr. 2016-02-20 Dodji Seketeli Make the tree pass distcheck again. * tests/data/Makefile.am: Add file test-diff-suppr/test28-add-aliased-function-report-0.txt to source distribution. 2016-02-18 Dodji Seketeli Bug 19658 - Type canonicalization slow for the 2nd binary loaded * include/abg-corpus.h (corpus::{record_canonical_type, lookup_canonical_type}): Declare new member functions. * src/abg-corpus.cc (corpus::priv::canonical_types_): New data member. (corpus::{record_canonical_type, lookup_canonical_type}): Define new member functions. * src/abg-ir.cc (type_base::get_canonical_type_for): Cache the canonical type inside the corpus of the type being canonicalized. Then later when canonicalizing another type, lookup in the cache inside its corpus to see if there is a type with the same name. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Adjust. 2016-02-18 Dodji Seketeli Add --verbose option to abidiff * 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. 2016-02-18 Dodji Seketeli Fix indentation * tools/abipkgdiff.cc (parse_command_line): Fix a wrong indentation. 2016-02-17 Dodji Seketeli Bug 19638 - DWARF reader fails to link clone function to its declaration * include/abg-ir.h (decl_base::set_linkage_name): Make this member function virtual. (class_decl::string_mem_fn_ptr_map_type): Define new member type. (class_decl::find_member_function): Declare new member function. (copy_member_function): Declare new function. Declare it as friend of class_decl. (method_decl::set_linkage_name): Declare an overload for this virtual function. * src/abg-dwarf-reader.cc (build_function_decl): Allow updating of linkage_name even if the linkage_name was already defined. (build_ir_node_from_die): In the case DW_TAG_subprogram, make the lookup of scope of the DIE work even if it has both an abstract origin and a specification (DW_AT_abstract_origin and DW_AT_specification). * src/abg-ir.cc (maybe_adjust_canonical_type): Define new function. (canonicalize): Use it. (function_decl::get_id): Return the linkage name first, if it exist. (class_decl::priv::mem_fns_map_): New data member. (class_decl::find_member_function): Define new member function. (class_decl::method_decl::set_linkage_name): Likewise. (class_decl::add_member_function): Update the new data member class_decl::priv::mem_fns_map_. (copy_member_function): Define new static function. * tests/data/test-abidiff/test-PR18791-report0.txt: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2016-02-17 Dodji Seketeli Add function lookup by linkage name to libabigail::corpus * include/abg-corpus.h (corpus::lookup_functions): Declare new member function. * src/abg-corpus.cc (class corpus::exported_decls_builder::priv): Make class corpus be a friend of this type. (corpus::exported_decls_builder::priv::add_fn_to_id_fns_map): Fix a thinko that was preventing the fn_id -> functions map from ever being filled. Fix this function to make it associate each aliases of a given function to the function, in the hash table. (corpus::lookup_functions): Define new member function. 2016-02-17 Dodji Seketeli Fix style cleanups * include/abg-ir.h (method_type::{method_type, set_class_type, get_type, set_type}): Use type_base_sptr and class_decl_sptr instead of the full non-typedefed name. (method_type):Do some cleanups in the definition of the convenience typedefs. * src/abg-ir.cc (method_type::{method_type, set_class_type, get_type, set_type}): Use type_base_sptr and class_decl_sptr instead of the full non-typedefed name. * src/abg-writer.cc (write_class_decl): Add a comment. 2016-02-13 Dodji Seketeli Bug 19619 - failing to suppress added aliased function reports for C++ * src/abg-comparison.cc (function_suppression::suppresses_function): Make the evaluation of the "name" and "name_regexp" consider the cases of languages in which the function name is the same as the symbol name and the case of languages in which it is not. In the former case, all symbol alias names must be matched. In the latter case, if "name" and "name_regexp" match the function name, the suppression specification is considered to match the report about the function change. Also, use the elf_symbol::is_main_symbol() predicate to test for the symbol being a main symbol, rather than using error-prone pointer equality. * tests/data/test-diff-suppr/test27-add-aliased-function-0.suppr: New test input. * tests/data/test-diff-suppr/test27-add-aliased-function-1.suppr: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-2.suppr: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-3.suppr: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-4.suppr: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-0.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-1.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-2.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-3.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-4.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-report-5.txt: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-v0.cc: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-v0.o: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-v1.cc: Likewise. * tests/data/test-diff-suppr/test27-add-aliased-function-v1.o: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-0.suppr: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-1.suppr: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-2.suppr: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-3.suppr: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-4.suppr: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-5.suppr: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-0.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-1.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-2.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-3.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-4.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-5.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-report-6.txt: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-v0.c: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-v0.o: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-v1.c: Likewise. * tests/data/test-diff-suppr/test28-add-aliased-function-v1.o: Likewise. * tests/data/Makefile.am: Add the new test material above to the source distribution. * tests/test-diff-suppr.cc: Add the new test inputs above to this test harness. 2016-02-12 Dodji Seketeli Emit more informational messages on unrecognized options * tools/abicompat.cc (options::prog_name): New data member. (display_help, perform_compat_check_in_normal_mode) (perform_compat_check_in_weak_mode, main): Prefix error messages with the name of the program. * tools/abidw.cc (options::wrong_option): New data member. (display_help): Prefix error messages with the name of the program.n (parse_command_line): Record the name of the unrecognized option. (main): Tell the name of the unrecognized option. Prefix error messages with the name of the program. * tools/abilint.cc (optionqs::wrong_option): New data member (display_usage): Prefix error messages with the name of the program. (parse_command_line): Record the name of the unrecognized option. (main): Tell the name of the unrecognized option. Prefix error messages with the name of the program. * tools/abipkgdiff.cc (options::{wrong_option, prog_name}): New data members. (package::erase_extraction_directory, display_usage, extract_rpm) (extract_deb, extract_tar) (erase_created_temporary_directories_parent, extract_package) (compare, create_maps_of_package_content): Prefix error messages with the name of the program. (maybe_check_suppression_files): Adjust. (parse_command_line): Record the name of the unrecognized option, and the name of option which lacks an operand. (main): Give the name of the unrecognized option. Prefix error messages with the name of the program. 2016-02-12 Dodji Seketeli Prefix abidiff error message with the 'abidiff' program name * include/abg-tools-utils.h (emit_prefix): Declare new function. (check_file): Add a new parameter with a default value, so that existing code keeps compiling. * src/abg-tools-utils.cc (emit_prefix): Define new function. (check_file): Use the emit_prefix function and give it the program name passed as a new parameter. * tools/abidiff.cc (display_usage, main): Use the new emit_prefix to prefix error messages. 2016-02-11 Dodji Seketeli Bug 19606 - Need better error message for invalid options * tools/abidiff.cc (options::wrong_option): New data member. (parse_command_line): Record the name of the unknown option and of the option which value is missing. 2016-02-11 Dodji Seketeli Add a comment about libabigail needing elfutils 0.159 at least. * configure.ac: Add a comment saying that we require at least elfutils 0.159. 2016-02-11 Dodji Seketeli Talk about mandatory properties in suppress_* directives * doc/manuals/libabigail-concepts.rst: Talk about the mandatory properties for suppress_type, suppress_function and suppress_variable directives. 2016-02-11 Dodji Seketeli Make abipkgdiff check for the presence of suppression spec files * tools/abipkgdiff.cc (maybe_check_suppression_files): Define new static function. (main): Use it. 2016-02-11 Dodji Seketeli Make abipkgdiff return correct exit code on usage error * tools/abipkgdiff.cc (main): Return the correct error code on usage error. 2016-02-11 Dodji Seketeli Bug 19604 - abidiff --suppressions doesn't complain about invalid file name * tools/abidiff.cc (maybe_check_suppression_files): Define new static function. (main): Use it. 2016-02-10 Dodji Seketeli Use proper WIFEXITED and WEXITSTATUS macros to get exit code * tests/test-diff-dwarf-abixml.cc (main): Use WIFEXITED and WEXITSTATUS macros to get the return code of the abidiff program. * tests/test-diff-filter.cc (test_task::perform): Likewise. * tests/test-diff-pkg.cc (main): Likewise. * tests/test-diff-suppr.cc (main): Likewise. 2016-02-10 Dodji Seketeli Bug 19596 - Incorrect exit status for incompatible ABI change * include/abg-comparison.h (enum diff_category): Adjust the comment for enumerator VIRTUAL_MEMBER_CHANGE_CATEGORY; changes of this category are incompatible ABI changes. (corpus_diff::diff_stats::num_func_with_virtual_offset_changes): Declare new accessors. * src/abg-comparison.cc (corpus_diff::diff_stats::priv::num_func_with_virt_offset_changes): New data member. (corpus_diff::diff_stats::priv::priv): Initialize the new data member. (corpus_diff::diff_stats::num_func_with_virtual_offset_changes): Define new accessors. (corpus_diff::priv::apply_filters_and_compute_diff_stats): Use the new accessor to set the number of functions with virtual offset changes onto the stats data structure. (corpus_diff::has_incompatible_changes): Take functions with virtual offset changes into account. * tests/test-abidiff-exit.cc: New test harness to test for exit codes of abidiff. * tests/Makefile.am: Build the new test harness runtestabidiff from the test-abidiff-exit.cc source file. * tests/data/test-abidiff-exit/test1-voffset-change-report0.txt: New reference test output. * tests/data/test-abidiff-exit/test1-voffset-change-v0.cc: New test input source code. * tests/data/test-abidiff-exit/test1-voffset-change-v0.o: New test input. * tests/data/test-abidiff-exit/test1-voffset-change-v1.cc: New test input source code. * tests/data/test-abidiff-exit/test1-voffset-change-v1.o: New test input. * tests/data/Makefile.am: tests/data/Makefile.am: Add the new test inputs above to the source distribution. 2016-02-04 Dodji Seketeli Fix synthesizing of reference type * src/abg-ir.cc (synthesize_type_from_translation_unit): Support synthesizing reference types. * tests/data/test-abicompat/libtest9-fn-changed-v0.so: Add new test input. * tests/data/test-abicompat/libtest9-fn-changed-v1.so: Likewise. * tests/data/test-abicompat/test9-fn-changed-app: Likewise. * tests/data/test-abicompat/test9-fn-changed-app.cc: : Likewise. * tests/data/test-abicompat/test9-fn-changed-report-0.txt: Likewise. * tests/data/test-abicompat/test9-fn-changed-v0.cc: Likewise. * tests/data/test-abicompat/test9-fn-changed-v0.h: Likewise. * tests/data/test-abicompat/test9-fn-changed-v1.cc: Likewise. * tests/data/test-abicompat/test9-fn-changed-v1.h: Likewise. * tests/data/Makefile.am: Add the new material to source distribution. * tests/test-abicompat.cc (in_out_specs): Add the new test inputs to the test harness. 2016-02-03 Dodji Seketeli Fix synthesizing of pointer type * include/abg-ir.h: Update copyright. * src/abg-ir.cc (synthesize_type_from_translation_unit): Support synthesizing pointer types. * tests/data/test-abicompat/libtest8-fn-changed-libapp-v0.so: New test input. * tests/data/test-abicompat/libtest8-fn-changed-libapp-v1.so: Likewise. * tests/data/test-abicompat/test8-fn-changed-app: Likewise. * tests/data/test-abicompat/test8-fn-changed-app.c: Likewise. * tests/data/test-abicompat/test8-fn-changed-libapp-v0.c: Likewise. * tests/data/test-abicompat/test8-fn-changed-libapp-v0.h: Likewise. * tests/data/test-abicompat/test8-fn-changed-libapp-v1.c: Likewise. * tests/data/test-abicompat/test8-fn-changed-libapp-v1.h: Likewise. * tests/data/test-abicompat/test8-fn-changed-report-0.txt: Likewise. * tests/data/Makefile.am: Add the new test input files to source distribution. * tests/test-abicompat.cc (in_out_specs): Add the new test inputs above to the test harness. 2016-01-26 Mark Wielaard Remove defined but not used functions pointed out by GCC6. * src/abg-ir.cc (convert_node_to_decl(decl_base_sptr)): Remove definition. (get_node_name(decl_base_sptr)): Likewise. 2016-01-26 Mark Wielaard Make make more silent. * Makefile.am (AM_MAKEFLAGS): Set --no-print-directory. 2016-01-26 Mark Wielaard Fix GCC6 -Wmisleading-indentation warnings. * src/abg-dwarf-reader.cc (find_import_unit_point_before_die): Properly indent code after if clause. * src/abg-ini.cc (write_property_value): Properly indent return statement after else clause. 2016-01-27 Dodji Seketeli Fix abicompat's handling of library types not used by the application * tools/abicompat.cc (perform_compat_check_in_weak_mode): If the application doesn't use a given type defined and exported by the library, then skip it. 2016-01-27 Dodji Seketeli Do not crash when looking up a type from global scope * src/abg-ir.cc (lookup_type_in_scope): Gently Handle empty access path. 2016-01-25 Dodji Seketeli Comparing aliases of the same symbol must be done by pointer * src/abg-ir.cc (elf_symbol::operator==): Fix thinko and indentation. What was I thinking ... (elf_symbol::add_alias) (compute_aliases_for_elf_symbol): Do not compare aliases using the equality operator, because it considers all aliases of a given symbol as equal. Rather, use elf_symbol::is_main_symbol() to test if an alias is the main symbol alias. * src/abg-comp-filter.cc (function_name_changed_but_not_symbol): Likewise. * src/abg-corpus.cc (corpus::priv::build_unreferenced_symbols_tables): Likewise. * src/abg-writer.cc (write_elf_symbol_aliases): Likewise. 2016-01-21 Dodji Seketeli Bug 19204 - libabigail aborts on DWARF referencing non-existing DIE * src/abg-dwarf-reader.cc (get_parent_die): If we couldn't find the parent of a given DIE, return false, do not abort. Also, assert that if we don't find the parent of a DIE in the main debug info, we don't find it in the alternate debug info either (and vice versa). This is because I'd like to abort on cases where we look for a DIE in the wrong debug info; those cases are likely to be hint that the DWARF reader is doing something wrong which ought to be investigated and fixed. (get_scope_for_die): If we couldn't get the parent of the DIE, then return a nil scope. * tests/data/test-types-stability/pr19204-libtcmalloc.so.4.2.6-xlc: New test binary input. * tests/data/Makefile.am: Add the new binary test input to the source distribution. * tests/test-types-stability.cc (elf_paths): Account for the new binary input. 2016-01-20 Dodji Seketeli Pass parm of elf_symbol::add_alias by reference * include/abg-ir.h (elf_symbol::add_alias): Pass parameter by reference. * src/abg-ir.cc (elf_symbol::add_alias): Likewise. 2016-01-20 Dodji Seketeli Bug 19141 - Libabigail doesn't support common ELF symbols * include/abg-ir.h (elf_symbol::elf_symbol): Take a new flag to say if the symbol is common. (elf_symbol::{is_common_symbol, has_other_common_instances, get_next_common_instance, add_common_instance}): New member functions. * src/abg-ir.cc (elf_symbol::priv::{is_common_, next_common_instance_): New data members. (elf_symbol::priv::priv): Adjust. (elf_symbol::{elf_symbol, create}): Take a new flag to say if the symbol is common. (textually_equals): Adjust to account for symbol common-ness. (elf_symbol::{is_common_symbol, has_other_common_instances, get_next_common_instance, add_common_instance}): Define new member functions. (elf_symbol::add_alias): Drive-by fix; compare symbols using pointer value. Value comparison is not necessary. * src/abg-dwarf-reader.cc (lookup_symbol_from_sysv_hash_tab) (lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_symtab) (read_context::lookup_elf_symbol_from_index): Adjust the creation of the symbol to account for common-ness. (read_context::load_symbol_maps): Recognize instances of a given common symbol and represent them as such. Do not mistake this with symbol aliases. * src/abg-reader.cc (build_elf_symbol): Adjust the creation of the symbol to account for common-ness. * src/abg-writer.cc (write_elf_symbol): Adjust symbol serialization to account common-ness. * tests/data/test-types-stability/pr19141-get5d.o: Add new test binary input. * tests/data/test-types-stability/pr19142-topo.o: Likewise. * tests/data/Makefile.am: Add the new test inputs to source distribution. * tests/test-types-stability.cc (elf_paths): The the new test inputs into account. 2016-01-13 Dodji Seketeli Bug 19434 - invalid character in attribute value * include/abg-tools-utils.h (string_is_ascii_identifier): Declare new function. * src/abg-tools-utils.cc (string_is_ascii_identifier): Define new function. * src/abg-dwarf-reader.cc (build_function_type): Discard parameter name if it's made of non-identifier ascii characters. * tests/data/test-types-stability/pr19434-elf0: New test binary input file. * tests/data/Makefile.am: Add the new test input to source distribution. * tests/test-types-stability.cc: Test the new test input into account. 2016-01-18 Dodji Seketeli Sort the tests run in tests/ by running the slowest ones first * tests/Makefile.am: Sort the tests by running the slowest ones first. 2016-01-15 Dodji Seketeli Use worker threads pattern to speed up some tests * include/Makefile.am: Add the new abg-workers.h to source distribution. * include/abg-workers.h: New file. * src/Makefile.am: Add the new abg-worker.cc to source distribution. * src/abg-workers.cc: New file. * tests/test-utils.cc: Update copyright. Make get_src_dir() and get_build_dir() return a const char*, as opposed to returning a string. Make that const char reside in thread local storage, so that two concurrent threads can safely call these functions in parallel, without any race. * tests/test-utils.h: Make get_src_dir() and get_build_dir() return a const char*, as opposed to returning a string. * tests/test-abicompat.cc: Update copyright. Adjust for get_src_dir() and get_build_dir() change. * tests/test-abidiff.cc: Likewise. * tests/test-alt-dwarf-file.cc: Likewise. * tests/test-core-diff.cc: Likewise. * tests/test-diff-dwarf-abixml.cc: Likewise. * tests/test-diff-dwarf.cc: Likewise. * tests/test-diff-pkg.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tests/test-lookup-syms.cc: Likewise. * tests/test-read-dwarf.cc: Likewise. * tests/test-read-write.cc: Likewise. * tests/test-types-stability.cc: Likewise. Use the new task queue type to run these tests in parallel. * tests/test-diff-filter.cc: Likewise. 2016-01-18 Ondrej Oprala Escape the value of the filepath attribute. * src/abg-writer.cc (write_location): Sanitize the filepath with xml::escape_xml_string(). (write_translation_unit): Likewise. (write_corpus_to_native_xml): Likewise. * tests/data/test-types-stability/pr19433-custom0: Add a new test file. * tests/test-types-stability.cc: Add the test file to the test harness. * tests/data/Makefile.am: Add the new test file to the list. 2016-01-09 Dodji Seketeli Make enum values take 64 bits on all platforms * include/abg-ir.h: Include stdint.h for int64_t. (enumerator::enumerator): Take an int64_t value for the value of the enumerator. (enumerator::{s,g}et_value): Take/return an int64_t value. * src/abg-ir.cc (enum_type_decl::enumerator::priv): Store the value in an int64_t. (enumerator::priv::priv): Take a int64_t for the value. (enum_type_decl::enumerator::enumerator): Likewise. (enum_type_decl::enumerator::{s,g}et_value): Take/returnan int64_t value. * src/abg-dwarf-reader.cc (die_unsigned_constant_attribute): Take an uint64_t value. (die_signed_constant_attribute): Take an int64_t value. (die_location, die_size_in_bits, die_access_specifier) (die_virtuality, die_is_virtual, die_is_declared_inline) (build_translation_unit_and_add_to_ir, build_type_decl) (build_enum_type, build_pointer_type_def, build_array_type): Adjust. * src/abg-reader.cc (build_enum_type_decl): Adjust. * src/abg-writer.cc (write_enum_type_decl): Do not cast the result of enumerator::get_value() anymore, it's value is now a int64_t. 2016-01-08 Dodji Seketeli Include missing to abg-dwarf-reader.cc * src/abg-dwarf-reader.cc: Add missing include file. 2016-01-08 Dodji Seketeli Bug 19138 - Failure to relate variables address from DWARF and ELF * include/abg-dwarf-reader.h (elf_type::ELF_TYPE_RELOCATABLE): New enumerator. * src/abg-dwarf-reader.cc (find_section): Factorize this from ... (find_text_section, find_bss_section): ... these. (find_rodata_section, find_data_section, find_data1_section): Define new static functions. (elf_file_type): Move this static function definition up. (read_context::{get_elf_file_type, address_is_in_section, get_data_section_for_variable_address}): New member functions. (read_context::maybe_adjust_fn_sym_address): Adjust comment. Adjust to use the new read_context::get_data_section_for_variable_address(). * tests/data/test-types-stability/pr19138-elf0: New test input binary. * tests/data/Makefile.am: Add the new test input binary to the test suite. * tests/test-types-stability.cc (elf_paths): Take it into account. 2016-01-08 Dodji Seketeli Bump version revision to 1.0.rc3 * configure.ac: Change version_revision to rc3 2016-01-08 Dodji Seketeli Add a release announcement text pattern * release-text-template.txt: New file. 2016-01-08 Dodji Seketeli Upate build instructions on the website * doc/website/mainpage.txt: Add instruction about how to build tarballs. 2016-01-07 Dodji Seketeli Update website link for 1.0.rc2 * doc/website/mainpage.txt: Update tarball link for 1.0.rc2 2016-01-07 Dodji Seketeli Update ChangeLog before 1.0.rc2 * ChangeLog: Update with make update-changelog 2016-01-07 Dodji Seketeli Update NEWS for 1.0.rc2 * NEWS: Update. 2016-01-07 Dodji Seketeli Fix tests/data/Makefile.am glitch * tests/data/Makefile.am: Fix a faulty file path. 2016-01-07 Dodji Seketeli Lexicographically sort added/removed base classes in change report * src/abg-comparison.cc (sort_string_base_diff_sptr_map): Define new static function. (struct base_spec_comp): Define new type. (class_diff::priv::sorted_{deleted,inserted}_bases_): New data members. (class_diff::ensure_lookup_tables_populated): Sort the deleted and inserted base classes. (class_diff::report): Use the sorted set of deleted/inserted base classes in the report. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Adjust. 2016-01-06 Dodji Seketeli Fix regression on the support for alternate debug info files * src/abg-dwarf-reader.cc (imported_unit_point::imported_unit_from_alt_di): New data member. (imported_unit_point::imported_unit_point): Adjust. (read_context::alt_tu_die_imported_unit_points_map_): New data member. (read_context::alt_tu_die_imported_unit_points_map): New accessor. (die_die_attribute): Remove the overload which doesn't say if the resulting DIE comes from alternate debug info. (build_die_parent_relations_under): Take a new flag which says if we are building the relations about DIEs in the alternate debug info section or not. Use that flag to know if the imported unit trace we are building is for an alternate debug info file or not. (build_die_parent_maps): Build two different imported unit point trace vectors: one for the main debug info file, and another one for the alternate debug info file. (find_import_unit_point_between_dies): Take a flag that says if the beginning of the search is a DIE in the alternate debug info file or not. Use it to know if we should use the import point trace vectors from alternate debug info or from the main debug info file. When the import point trace vector is empty, return immediatly. (get_parent_die): If the parent DIE is a DW_TAG_partial_unit which hasn't been imported into this TU, then assume the logical parent is the DIE for the current translation unit. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt: Reference test output. * tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64.rpm: New input test rpm. * tests/data/test-diff-pkg/tbb-4.3-3.20141204.fc23.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/tbb-debuginfo-4.1-9.20130314.fc22.x86_64.rpm: Likewise. * tests/data/test-diff-pkg/tbb-debuginfo-4.3-3.20141204.fc23.x86_64.rpm: Likewise. * tests/data/Makefile.am: Add the new test materials to the source distribution. * tests/test-diff-pkg.cc (int_out_specs): Add the new rpms to the list of rpms to test against. 2016-01-06 Dodji Seketeli Bump revision number to 1.0.rc2 * configure.ac: Bump revision number to 1.0.rc2 2016-01-05 Dodji Seketeli Update link to the 1.0.rc1 tarball * doc/website/mainpage.txt: Update the "Getting source code" section. 2016-01-05 Dodji Seketeli Update ChangeLog before 1.0.rc1 * ChangeLog: Update automatically with make update-changelog 2016-01-05 Dodji Seketeli Fix abidw -v * tools/abidw.cc (parse_command_line): Simplify logic. (main): Fix logic. 2016-01-05 Dodji Seketeli Add a NEWS file * NEWS: New file. * Makefile.am: Add NEWS file to source distribution. 2016-01-04 Dodji Seketeli Bug 19355 - Libabigail slow on r300_dri.so * src/abg-dwarf-reader.cc (struct imported_unit_point): Define new type. (operator<(const imported_unit_point&, const imported_unit_point&)): Define less-than operator for new imported_unit_point& type. (imported_unit_points_type, tu_die_imported_unit_points_map_type): New typedefs. (find_lower_bound_in_imported_unit_points): Define new static function. (read_context::tu_die_imported_unit_points_map_): New data member. (read_context::tu_die_imported_unit_points_map): New getter. (die_die_attribute): Define new overload. (build_die_parent_relations_under): Take imported_unit_points_type output parameter and populate it along the way. Remove the overload that takes a read_context as a parameter. (build_primary_die_parent_relations_under) (build_alternate_die_parent_relations_under): Remove. (build_die_parent_maps): Pass an instance of imported_unit_points_type to build_die_parent_relations_under. (find_import_unit_point_between_dies): Rename one overload of find_last_import_unit_point_before_die into this. Adjust to make it find the import point between two offsets. (find_import_unit_point_before_die): Rename the other overload of find_last_import_unit_point_before_die into this. Adjust to use find_import_unit_point_between_dies. (get_parent_die): Adjust to use find_import_unit_point_before_die. 2016-01-04 Dodji Seketeli Support two different variables having the same underlying symbol * src/abg-ir.cc (var_decl::get_id()): Include the name of the variable in the ID. 2016-01-04 Dodji Seketeli Avoid adding the same base class twice * src/abg-dwarf-reader.cc: * src/abg-reader.cc: 2016-01-04 Dodji Seketeli Speed up class_decl::find_base_class * src/abg-ir.cc (class_decl::priv::bases_map_): New data member. (class_decl::add_base_specifier): Add the new base specifier to the new class_decl::priv::bases_map_ data member. (class_decl::find_base_class): Use the new class_decl::priv::bases_map_ data member to speed up finding the base class. 2016-01-04 Dodji Seketeli Make class_decl::base_spec class follow the pimpl pattern * include/abg-ir.h (class_decl::base_spec::priv): Declare new private data type. (class_decl::base_spec::priv_): Declare new pimpl data member. (class_decl::base_spec::{base_class_, offset_in_bits_, is_virtual_}): Remove. (class_decl::base_spec::{get_base_class, get_is_virtual, get_offset_in_bits}): Make these member functions out of line. * src/abg-ir.cc (struct class_decl::base_spec::priv): New type. (class_decl::base_spec::{get_base_class, get_is_virtual, get_offset_in_bits}): Define these functions here. (class_decl::base_spec::base_spec): Adjust because now there is only one pimpl data member to initialize. 2015-11-16 Ondrej Oprala Add the option of printing the file, line and column information about a type being reported. * 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. 2015-11-16 Ondrej Oprala Fix a function doc * src/abg-ir.cc: (location_manager::expand_location): Fix a factual error in the function documentation. 2015-12-11 Dodji Seketeli [PERF] Speedup comparing declaration-only class_decls * src/abg-ir.cc (equals): In the overload for class_decl, avoid calling class_decl::get_is_declaration_only() several times. Avoid copying the qualified name of the class_decl. Also, use the == operator to compare strings, rather than the != one. 2015-12-11 Dodji Seketeli [PERF] Access naked pointers for canonical types and function types * include/abg-ir.h (type_base::get_naked_canonical_type): Declare new accessor. (function_decl::get_naked_canonical_type): Likewise. (function_decl::set_type): Pass a reference to the shared_ptr. * src/abg-ir.cc (type_base::priv::naked_canonical_type): New data member. (type_base::priv::priv): Initialize it. (canonicalize): Set the naked canonicalize type when we set its shared pointer. (type_base::get_naked_canonical_type): Define new accessor. ({pointer_type_def,reference_type_def,function_type,class_decl}::operator==): Use naked canonical pointers rather than the slower shared_ptr to canonical pointers. (function_decl::priv::naked_type_): New data member. (function_decl::priv::priv): Initialize it. (function_decl::get_naked_type): Define new accessor. (function_decl::set_type): Pass a reference to the shared_ptr . (equals): In the overload for function_decl, use the faster naked pointers to the type of the function. 2015-12-11 Dodji Seketeli [PERF] Turn some pimpl pointers into naked pointers * include/abg-ir.h ({decl_base, type_base, function_decl}::priv_) Make this a naked pointer to priv, rather than a shared_ptr. * src/abg-ir.cc (decl_base::~decl_base): Destroy the private data pointer, aka pimpl pointer. (type_base::~type_base): Likewise. (function_decl::~function_decl): Likewise. (class_decl::~class_decl): Likewise. 2015-12-11 Dodji Seketeli [PERF] Pass a bunch of perf-sensitive smart pointers by reference * include/abg-fwd.h (lookup_type_in_corpus, lookup_type_in_scope) (lookup_var_decl_in_scope): Pass the decls smart pointers by reference. * src/abg-ir.cc (lookup_type_in_corpus, lookup_type_in_scope) (lookup_var_decl_in_scope): Pass the decls smart pointers by reference, for performance reasons. 2015-12-10 Dodji Seketeli Bug 19126 - abidw segv on a dwz compressed version of r300_dri.so * include/abg-ir.h (class location_manager): Forward declare it before class location. (location::loc_manager_): New data member. (location::location): Take the location manager in one overload and initialize the new loc_managers_ in all the overloads. (location::get_location_manager): New getter. (location::expand): New member function. (location::*): Add API doc to all entry points. (location_manager::expand_location): Take a const location. (type_or_decl_base::set_corpus): Remove. (type_or_decl_base::{get,set}_translation): New accessors. (decl_base::{decl_base,get_location}): Take or return a reference on location. (scope_decl::scope_decl): Likewise. (type_decl::type_decl): Likewise. (namespace_decl::namespace_decl): Likewise. (qualified_type_def::qualified_type_def): Likewise. (pointer_type_def::pointer_type_def): Likewise. (reference_type_def::reference_type_def): Likewise. (array_type_def::subrange_type::{subrange_type, get_location}): Likewise. (enum_type_decl::enum_type_decl): Likewise. (typedef_decl::typedef_decl): Likewise. (var_decl::var_decl): Likewise. (function_decl::function_decl): Likewise. (function_decl::parameter::parameter): Likewise. (template_decl::template_decl): Likewise. (type_tparameter::type_tparameter): Likewise. (non_type_tparameter::non_type_tparameter): Likewise. (function_tdecl::function_tdecl): Likewise. (class_tdecl::class_tdecl): Likewise. (class_decl::class_decl): Likewise. (class_decl::method_decl::method_decl): Likewise. * src/abg-ir.cc (location::expand_location): Define new member function. (type_or_decl_base::priv::corpus_): Remove. (type_or_decl_base::priv::translation_unit_): New data member. (type_or_decl_base::priv::priv): Adjust. (type_or_decl_base::set_corpus): Remove. (type_or_decl_base::get_corpus): Adjust. (type_or_decl_base::{get,set}_translation_unit): New member functions. (decl_base::priv::priv): Take a reference to location. (decl_base::decl_base): Likewise. (decl_base::get_location): Return a reference to location. (location_manager::create_new_location): Adjust. (location_manager::expand_location): Take a reference to location. (translation_unit::get_global_scope()): Adjust. (translation_unit::bind_function_type_life_time): Likewise. (scope_decl::{add,insert}_member_decl): Adjust. (get_translation_unit): Likewise. (type_decl::type_decl): Take a reference to location. (namespace_decl::namespace_decl): Likewise. (qualified_type_def::qualified_type_def): Likewise. (pointer_type_def::pointer_type_def): Likewise. (reference_type_def::reference_type_def): Likewise. (array_type_def::subrange_type::priv::priv): Likewise. (array_type_def::subrange_type::{subrange_type, get_location}): Likewise. (enum_type_decl::enum_type_decl): Likewise. (typedef_decl::typedef_decl): Likewise. (var_decl::var_decl): Likewise. (function_decl::function_decl): Likewise. (function_decl::parameter::parameter): Likewise. (template_decl::template_decl): Likewise. (type_tparameter::type_tparameter): Likewise. (non_type_tparameter::non_type_tparameter): Likewise. (function_tdecl::function_tdecl): Likewise. (class_tdecl::class_tdecl): Likewise. (class_decl::class_decl): Likewise. (class_decl::method_decl::method_decl): Likewise. * src/abg-writer.cc (write_location): Take a reference to location and adjust. (write_array_type_def, write_function_decl, dump_decl_location): Adjust. 2015-12-08 Dodji Seketeli Fix some white space nits * src/abg-comparison.cc (class_diff::report): Remove a useless horizontal white space. * src/abg-ir.cc (operator==): Add a vertical space. 2015-12-08 Dodji Seketeli Filter out harmless diagnostics glitches due to some ODR violation * src/abg-comp-filter.cc (class_diff_has_harmless_odr_violation_change): New static function. (harmless_filter::visit): Call it. 2015-12-08 Dodji Seketeli Fix internal name for pointers, typedefs and arrays * include/abg-ir.h (pointer_type_def::priv_): New data structure. The type is now pimpled. (typedef_decl::priv_): Likewise. * src/abg-ir.cc (struct pointer_type_def::priv): New struct. (pointer_type_def::pointer_type_def): Adjust. (pointer_type_def::get_pointed_to_type): Likewise. (pointer_type_def::get_qualified_name): Store temporary/internal names into different caches. (array_type_def::priv::{temp_internal_qualified_name_, internal_qualified_name_}): New data members. (get_type_representation): In the overload for array_type_def, take requests for internal names into account. (array_type_def::get_qualified_name): Take requests for internal names into account. Store temporary/internal names into different caches. (typedef_decl::priv): New struct. (typedef_decl::typedef_decl): Adjust. (typedef_decl::get_underlying_type): Likewise. 2015-12-08 Dodji Seketeli Avoid try/catch code paths when that is possible * src/abg-ir.cc (is_type, equals): Do not use try/catch based dynamic_cast. 2015-12-08 Dodji Seketeli Fix comparison in qualified_type_diff::has_changes * src/abg-comparison.cc (qualified_type_diff::has_changes): Make this stupid and simple, now that we have (fast) canonical type based comparison. * include/abg-ir.h (qualified_type_diff::operator==): Add an overload for qualified_type_diff here. (operator==): Likewise. * src/abg-ir.cc (qualified_type_diff::operator==): Define it. (operator==): Likewise. 2015-12-06 Dodji Seketeli Bug 19336 - Better handle redundantly qualified reference types * src/abg-dwarf-reader.cc (maybe_strip_qualification): Do not nuke the qualified type. Rather, just turn the redundant const qualifier into a no-op one. * src/abg-comparison.cc (compute_diff_for_types): Look through no-op qualified types. * include/abg-ir.h (decl_base::{peek,set}_temporary_qualified_name): Declare new accessors. * src/abg-ir.cc (decl_base::priv::temporary_qualified_name_): New data member. (decl_base::{peek,set}_temporary_qualified_name): Define new accessors. (qualified_type_def::priv::{temporary_internal_name_, internal_name}): New data members. (qualified_type_def::build_name): For a no-op qualified type, the internal name (which contains the 'none' qualifier) is different from the non-internal name. (qualified_type_def::get_qualified_name): Handle temporary names and non-temporary names in two different caches. Also handle internal and non-internal names in two different caches. This makes four different caches. (qualified_name_setter::do_update): Do not touch the non-internal, non-temporary qualified name cache if the qualified parent name is empty. * tools/abidw.cc (main): change --check-alternate-debug-info to make it *not* display the name/path to the alternate debug info, when it's found. Rather, only --check-alternate-debug-info-base-name keeps displaying the base name of the alternate debug info. * tests/data/test-alt-dwarf-file/test1-libgromacs-debug-dir/*: New test material. * tests/data/Makefile.am: Add the new test material to the build system. * tests/test-alt-dwarf-file.cc (in_out_specs): Take the new test input into account. * tests/data/test-read-dwarf/test1.abi: Adjust. * tests/data/test-read-dwarf/test7.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. 2015-12-06 Dodji Seketeli Do not forget to peel qualified type off when peeling types * include/abg-fwd.h (peel_qualified_type): Declare new function ... * src/abg-ir.cc (peel_qualified_type): ... and define it. (peel_typedef_pointer_or_reference_type): Peel qualified types here too. 2015-12-06 Dodji Seketeli Find more spots where to discriminate internal and non-internal names * src/abg-ir.cc (get_type_name, get_method_type_name) ({typedef_decl,var_decl,function_decl,class_decl}::get_pretty_representation): Propagate the internal-ness to the call to get_qualified_name(). 2015-12-06 Dodji Seketeli Constify is_qualified_type() * include/abg-fwd.h (is_qualified_type): Make this take a const parameter. * src/abg-ir.cc (is_qualified_type): Likewise. 2015-11-28 Dodji Seketeli Add missing new line to abidiff help message * tools/abidiff.cc (display_usage): Add missing new line. 2015-11-26 Dodji Seketeli Do not abort when there is no binary to compare in a package * tests/data/test-diff-pkg/empty-pkg-libvirt-0.9.11.3-1.el7.ppc64.rpm: New input test package. * tests/data/test-diff-pkg/empty-pkg-libvirt-1.2.17-13.el7_2.2.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/empty-pkg-report-0.txt: New test reference output. * data/Makefile.am: Add the new test material above to the build system. * tests/test-diff-pkg.cc (int_out_specs): Add the new test inputs to the set of tests. * tools/abipkgdiff.cc (compare): Do not abort if there is no binary to compare. 2015-11-14 Ondrej Oprala Abidiff: Remove doubled line in help. * tools/abidiff.cc (display_usage): Remove a doubled help message. 2015-11-14 Ondrej Oprala Add bash-completion scripts for the libabigail tools * Makefile.am: include bash-completion/Makefile.am * bash-completion/Makefile.am: New makefile for the bash-completion directory. * bash-completion/abicompat: New completion script. * bash-completion/abidiff: Likewise. * bash-completion/abidw: Likewise. * bash-completion/abilint: Likewise. * bash-completion/abinilint: Likewise. * bash-completion/abipkgdiff: Likewise. * bash-completion/abisym: Likewise. * configure.ac: Check for the bash-completion package. Handle the new --enable-bash-completion[=WHEN] configure option. * manuals/libabigail-tools.rst: Mention the scripts. 2015-11-17 Dodji Seketeli Read enum values in the size_t and write them in ssize_t * include/abg-ir.h (enum_type_def::enumerator::get_value): Return a size_t. * src/abg-ir.cc (enum_type_decl::enumerator::get_value): Likewise. * src/abg-dwarf-reader.cc (die_signed_constant_attribute): #if-out this static function that is not used anymore. (build_enum_type): Read the value of the enumerator using a size_t value. * src/abg-reader.cc (build_enum_type_decl): Read the enum value using a long long int. * src/abg-writer.cc (write_enum_type_decl): Write using a ssize_t. 2015-11-17 Dodji Seketeli Bump version to release candidate 1.0.rc1 * configure.ac: Bump version to release candidate 1.0.rc1 2015-11-17 Dodji Seketeli Do not use designated initializers in abipkgdiff.cc * tools/abipkgdiff.cc (prepare_packages): Do not use designated initializers syntax. 2015-11-16 Dodji Seketeli Update ChangeLog for 1.0.rc0 * ChangeLog: Udpate using make update-changelog 2015-11-16 Dodji Seketeli Fix doxygen configuration file paths in doc/Makefile.am * doc/Makefile.am: There was an extra "/doc" in the path. 2015-11-16 Dodji Seketeli Update ChangeLog file in preparation of 1.0.rc0 release * ChangeLog: Update using make update-changelog. 2015-11-16 Dodji Seketeli Add --version option to several libabigail tools * 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. 2015-11-12 Dodji Seketeli Correctly handle fn DIE with abstract_origin in alt debug info * src/abg-dwarf-reader.cc (build_ir_node_from_die): Consider that the function decl is for a DIE in the alternate debug info file only if the DIE itself comes from the alternate debug info file, not if the specification or the origin of the function comes from the alternate debug info file. * tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm: New test input rpm. * tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-report-0.txt: New test reference output. * tests/data/Makefile.am: Add the new test material to the source distribution. * tests/test-diff-pkg.cc (in_out_specs): Use the new test rpm inputs. 2015-11-09 Ondrej Oprala Bug 19081 - abipkgdiff parallelization * 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. 2015-11-10 Dodji Seketeli Fix typo in test-diff-dwarf-abixml.cc * tests/test-diff-dwarf-abixml.cc (main): Fix typo. 2015-10-14 Ondrej Oprala Document abipkgdiff's option --no-abignore * doc/manuals/abipkgdiff.rst: Mention the new option. * tools/abipkgdiff.cc: Likewise. 2015-11-09 Dodji Seketeli Avoid canonicalizing function types too early * src/abg-dwarf-reader.cc (die_function_type_map_type): New typedef. * (): (read_context::die_wip_function_types_map_): New data member. (read_context::{die_wip_function_types_map, is_wip_function_type_die_offset}): New methods. (build_function_type): Mark the function being built as "work in progress". (maybe_canonicalize_type): Do not early-canonicalize WIP function types. * src/abg-reader.cc (build_function_type): Mark the function being built as "work in progress". * tests/test-diff-dwarf-abixml.cc: New test harness. * tests/Makefile.am: Add new test harness runtestdiffdwarfabixml to the build system. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1: New test binary input. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: New test input. * tests/data/Makefile.am: Add new test inputs to source distribution. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. 2015-11-09 Dodji Seketeli Propagate environment property to base specifiers * src/abg-comparison.cc (compute_diff): In the overload for class_decl::base_spec_sptr, assert that the environment of the base classes are equal and that the environment the base class is the same as the environment of the base specifier. * src/abg-ir.cc (add_base_specifier): Propagate the environment of the class to its base specifiers. * tests/data/test-types-stability/pr19026-libvtkIOSQL-6.1.so.1: New test binary input. * tests/data/Makefile.am: Add the new test input to the build system. * tests/test-types-stability.cc (elf_paths): Add new binary to the test harness. 2015-11-09 Dodji Seketeli Misc style fixes * src/abg-comparison.cc (diff_context::mark_diff_as_visited): Add missing space. (corpus_diff::priv::ensure_lookup_tables_populated): Likewise. * src/abg-dwarf-reader.cc (lookup_symbol_from_elf): Likewise. (get_soname_of_elf_file, get_type_of_elf_file): Likewise. * src/abg-ir.cc (var_decl::get_pretty_representation): Likewise. 2015-11-07 Dodji Seketeli Support DW_AT_count DWARF attribute * src/abg-dwarf-reader.cc (get_default_array_lower_bound): Define new static function. (build_array_type): Support the DW_AT_count attribute. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang.so: New test binary input. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang2.so: Likewise. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-clang-report-0.txt: New test reference output. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc.so: New test binary input. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc2.so: New test binary input. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long-gcc-report-0.txt: New test reference output. * tests/data/test-diff-dwarf/test35-pr19173-libfoo-long.c: Source code for the binaries above. * tests/data/Makefile.am: Add the new test material to the build system. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test inputs to the harness. 2015-11-07 Dodji Seketeli Bug 19173 - Abidiff doesn't detect symbol size change in library * include/abg-ir.h (elf_symbol::{elf_symbol, create}): Take a size parameter. (elf_symbol::{get,set}_size): New accessors. * src/abg-ir.cc (elf_symbol::priv::size_): New data member. (elf_symbol::priv::priv): Initialize it. (elf_symbol::{elf_symbol, create}) Take a size parameter. (textually_equals): Compare the size of variable symbols. (elf_symbol::{get, set}_size): New accessors. * src/abg-comparison.cc (maybe_report_diff_for_symbol): New static function. ({function_decl_diff,var_diff}::report): Use it. * src/abg-dwarf-reader.cc (lookup_symbol_from_sysv_hash_tab) (lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_symtab) (read_context::lookup_elf_symbol_from_index): Set the size of the elf symbols' internal representation. * src/abg-reader.cc (build_elf_symbol): Read the size attribute if present. * src/abg-writer.cc (write_elf_symbol): Write the size attribute for variable symbols, if it's not zero. * tests/data/test-diff-dwarf/test34-pr19173-libfoo.so: New test input binary. * tests/data/test-diff-dwarf/test34-pr19173-libfoo2.so: Likewise. * tests/data/test-diff-dwarf/test34-pr19173-libfoo-report-0.txt: New reference test output. * tests/data/Makefile.am: Add the new test input binaries to the build system. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test input above to the test harness. * tests/data/test-diff-dwarf/test9-report.txt: Adjust. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-read-dwarf/test0.abi: Likewise. * tests/data/test-read-dwarf/test1.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test6.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2015-11-07 Dodji Seketeli Add some needed vertical space * src/abg-dwarf-reader.cc (build_array_type): Add a new line after this function. 2015-11-07 Dodji Seketeli Pass a bunch of parameters by reference as they ought to be * include/abg-ir.h (operator==): In the overload for elf_symbol_sptr, pass the parameters by reference. * src/abg-ir.cc (operator==): Do the same at definition site. * src/abg-comparison.cc (maybe_report_diff_for_member): Pass parameters by reference. 2015-11-05 Dodji Seketeli Bug 19139 - DWARF reader doesn't handle garbage in function names * include/abg-tools-utils.h (string_is_ascii): Declare new function ... * src/abg-tools-utils.cc (string_is_ascii): ... and define it. * src/abg-writer.cc (write_function_type): Escape forbidden XML characters in function type names. * src/abg-dwarf-reader.cc (build_function_type): If a parameter name is not ascii, drop it on the floor. * tests/data/test-types-stability/pr19139-DomainNeighborMapInst.o: New test input binary. * tests/data/test-types-stability/pr19202-libmpi_gpfs.so.5.0: Likewise. * tests/data/Makefile.am: Add the new binaries above to the build system. * tests/test-types-stability.cc: New test harness. * tests/Makefile.am: Add the new test harness to the build system. 2015-11-05 Dodji Seketeli Introduce the name abixml in some comments * src/abg-reader.cc: Mention abixml in the comment at the top of the file. * src/abg-writer.cc: Likewise. 2015-10-17 Dodji Seketeli Bug 19026 - Types with same name and different size considered equivalent * src/abg-ir.cc (type_base::get_canonical_type_for): Really compare the size of the type to be canonicalized against the size of the *current* potential canonical type of the same name. 2015-10-17 Dodji Seketeli Add a script to update the reference output of runtestreaddwarf * tests/update-test-read-dwarf-output.py: New helper python program. 2015-10-17 Dodji Seketeli Style fixes in the abixml writer. * src/abg-writer.cc (write_var_decl): Use the var_decl_sptr typedef. (write_class_decl): Indent. 2015-10-17 Dodji Seketeli Fix typo in test-read-dwarf.cc * tests/test-read-dwarf.cc (for test test21-pr19092.so.abi): Fix typo in the output path of that test. 2015-10-17 Dodji Seketeli Adjust regression tests reference output for the current patch set * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so: New test input binary. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: New test reference output. * tests/data/Makefile.am: Add the new test files above to the source distribution. * tests/test-read-dwarf.cc (in_out_specs): Add the two new test files above to the set of test input files. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Adjust. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Adjust. * tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2015-10-17 Dodji Seketeli Use abidw --abidiff in test-read-dwarf.cc * tests/test-read-dwarf.cc (handle_in_out_spec): Rather than calling abilint on the abixml and abidiff-ing the .so file against its .so.abi, call abidw --abidiff on the .so file and voila. Ok, it does one extra save of abixml, but then that won't hurt. And things are faster now than what they were anyway :-) 2015-10-17 Dodji Seketeli Fix emitting of referenced type in abixml writer * Use of canonical pointers in the hash map of referenced types The abixml writer was using canonical types pointer values to hash referenced types in a map. It was doing so "by hand"; and it was thus messing things up for types without canonical types (like some class declarations) etc. This patch changes that by using the generic solution of abigail::ir::hash_type_or_decl(), which also uses the same canonical pointer type values. For types with no canonical types, that functions knows has to gracefully fallback. At worst, it will just make things slower, not wrong. * Sorting of referenced types The patch also changes the sorting function used for the hash map of referenced types. The previous solution was sorting the pretty representation of types; but then when two types have the same pretty representation (think, typedefs, for instance) then their relative position in the sorted result was random. This causes some stability issues, in that emitting the abixml for the same binary several times can lead to the some types being sorted differently -- they have the same name, but not necessarily the same type *IDs*, as they are different types. The new sorting code handles this better; it also uses the pretty representations of types, when they are equal, it uses the type IDs to tell the types apart. At least this brings stability in the abixml output, for a given binary. * Avoiding duplicating declaration-only types when emitting the context of referenced member types. We don't keep track of declaration-only classes that are emitted. This is because we allow a given class declaration (that carries no definition) to appear several times in a given ABI corpus. So when a referenced type is a class declaration, it always appears as if that referenced type has not been emitted. So when we specifically emit the not-emitted referenced types, it can happen that declaration-only classes can appear a lot of times. This is unnecessary duplication, aka bloat. This patch thus introduces a new hash map that tracks emitted declaration-only classes, so that we can allow duplication of class declarations when they follow what's done in the IR read from DWARF, and disallow that duplication when it's totally artificial and useless. * Better tracking of referenced types We were blatantly forgetting to mark some referenced types as such. So those were missing in some abixml output. This patch fixes the spots where we were forgetting that important information. * Better representation of the scopes of the referenced types that were specifically emitted. The previous code was failing at properly representing the class scope of some referenced types that were specifically emitted, or sometimes, for member types, representing the scope would be so screwed that the (referenced) member type itself wouldn't be emitted at all. This is because I thought that to emit a given member type, just emitting its parent scope would be enough. I thought that would automatically trigger emitting the member type itself. First, that would emit too much information at times; the other members of the scope are not necessarily needed. And second the "duplication detection code" would sometime refuse to emit the scope class, because it has already been emitted earlier! But the incarnation that got emitted didn't have this member type as member, then. Yes, in DWARF, the same class A can be declared several times with different member types in it. The complete representation of A would be a union of all those declarations of A that are seen. This patch addresses this issue by carefully emitting just the information that is needed from the scope of the referenced type. Basically the scope is declared just to declare/define the type we are interested in; period. The abixml reader is now properly geared to re-construct the scope by merging its different parts that are now scattered around, in the ABI corpus. That support is part of this patch set. instance, a member typedef would be emitted with the information of its parent class badly formatted. * src/abg-writer.cc (struct type_ptr_comp_functor): Remove this. (sort_type_ptr_map): Likewise. (write_context::record_type_as_referenced): Do not add the canonical type of the type to record as referenced directly. (write_context::type_is_referenced): Adjust accordingly. (struct write_context::type_ptr_cmp): New comparison functor. (write_context::sort_types): New sorting function. (write_context::{record_decl_only_type_as_emitted, decl_only_type_is_emitted}): New member functions. (write_member_type_opening_tag): Factorize out of ... (write_member_type): ... here. (write_class_decl_opening_tag): Factorize out of ... (write_class_decl): ... here. Now, keep track also of declaration-only classes that are emitted. (write_decl_in_scope): Use the new write_member_type_opening_tag and write_class_decl_opening_tag. Now write class scopes ourselves; they only contain the type declarations that we are emitting. (write_translation_unit): Use the new sorting code to sort the referenced types to emit. Do not emit referenced types that are declaration-only classes that have already been emitted. Handle the fact that emitting the referenced types might make those emitted type *reference* other types too! So handle those new referenced types as such, and emit them too. (write_qualified_type_def, write_typedef_decl, write_var_decl): Do not forget to mark referenced types as such. 2015-10-17 Dodji Seketeli Support updating a class in the abixml reader * include/abg-ir.h (class_decl::{find_base_class, find_member_type, find_data_member}): Declare new member functions .. * src/abg-ir.cc (class_decl::{find_base_class, find_member_type, find_data_member}): ... and define them. * src/abg-reader.cc (build_class_decl): Add the ability to update a class to add new data members, member types and base classes to it, if necessary. 2015-10-17 Dodji Seketeli Don't canonicalize types not added to their context in abixml reader * src/abg-reader.cc (read_context::maybe_canonicalize_type): Assert that a class type that is scheduled for canonicalization must be in a scope. We do this only for classes, for now. The assert here helped to spot (and fix) a lot of places where we were canonicalizing types without scope. (read_context::build_or_get_type_decl): Canonicalize types here, when they are built and (hopefully) added to their scope. There might be cases here where we try to canonicalize types that are not added to their scope. That should bomb in the assert above, at least for class types, for now. We'll then fix the places where the types are created, to make them properly scoped. (build_type_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_array_type_def, build_enum_type_decl, build_typedef_decl): Do not try to canonicalize the types early, right when they are created. Canonicalization should happen at the point where (or after) they are added to their scope. (build_class_decl): Likewise. Also, schedule member types for canonicalization once they've been added to their scope. (build_class_tdecl): Schedule the pattern of the class template for canonicalization once it has been added to its scope. I am not sure I should do this, as the pattern is not yet a real type, but I am taking my bet. (build_type_composition): Schedule the composed type for canonicalization once it's been added to its scope. (handle_type_decl, handle_qualified_type_decl) (handle_pointer_type_def, handle_reference_type_def) (handle_function_type, handle_array_type_def) (handle_enum_type_decl, handle_typedef_decl, handle_class_decl): At this point, we should know if the type is to be added to a scope or not. If it's in a scope, then schedule for canonicalization. 2015-10-15 Dodji Seketeli Bug 19092 - abidw aborts on types that violate the ODR * src/abg-ir.cc (type_base::get_canonical_type_for): Look at the size of types with the same name which could be considered ODR-equal, to spot possible violations that would induce a type canonicalization error. * tests/data/test-read-dwarf/test21-pr19092.so: New test input binary. * tests/data/test-read-dwarf/test21-pr19092.so.abi: New reference abixml for the binary above. * tests/data/Makefile.am: Add the new test input above to source distribution. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/test-read-dwarf.cc (int_out_specs): Add the two test input above. 2015-10-15 Dodji Seketeli Fix activation of Debian package support * configure.ac: If we cannot activate Debian package support, then report it clearly. 2015-10-15 Dodji Seketeli Misc style cleanup * include/abg-fwd.h: Remove unnecessary declaration of class parameter. * src/abg-ir.cc: Remove trailing space in a comment. * src/abg-reader.cc: Fix a comment. 2015-10-15 Dodji Seketeli Emit statistics about resolved class declarations * src/abg-dwarf-reader.cc (read_context::resolve_declaration_only_classes): Emit statistics about resolved classes and the missed ones. 2015-10-15 Dodji Seketeli Add a missing xml text reader call * src/abg-reader.cc (read_corpus_from_input): Add the necessary call to xmlTextReaderNext call after the xmlTextReaderExpand call. 2015-10-15 Dodji Seketeli Pass some more parameters in reference * include/abg-ir.h (operator==): For the type_base_sptr and decl_base_sptr overloads, pass the parameters by reference. ({var,function}_decl::{set,get}_symbol): Pass the elf_symbol_ptr by reference. * src/abg-ir.cc (operator==): For the type_base_sptr and decl_base_sptr overloads, pass the parameters by reference, now in the definition. ({var,function}_decl::{set,get}_symbol): Pass the elf_symbol_ptr by reference, now in the definition. 2015-10-15 Dodji Seketeli Adjust tests for the patchset * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. 2015-10-15 Dodji Seketeli Make abidw --abidiff not show definitely harmless changes * tools/abidw.cc (set_diff_context): New function. (main): Use that new function. Do not show any output for --abidiff if only compatible changes were detected. Also, do not abort if no input binary was giving. 2015-10-15 Dodji Seketeli Allow only one definition of a given type per corpus in abixml * src/abg-writer.cc (write_translation_unit): Do not clear some important per-translation unit maps here. There are needed to keep track of the emitted and referenced types through the entire corpus. Avoid (wrongly) recording function types twice. (write_array_type_def, write_function_decl, write_function_type): Record referenced types. (write_class_decl): Record referenced types, and, allow only declarations to be duplicated in a corpus. 2015-10-15 Dodji Seketeli A series of small speed optimizations here and there * src/abg-comparison.cc (var_diff::has_changes): Just compare the two var_decl. It's (way) faster now than using recursive hashing for that. * src/abg-ir.cc (elf_symbol::does_alias): Get out early if the two main symbols are equal. (equals): In the overload for function_decl, start by comparing types. This can be very fast for functions with different types, as it amounts to a pointer comparison. In the overload for class_decl, avoid a map lookup when it's not necessary. 2015-10-15 Dodji Seketeli Accelerate a slow path in hash_type_or_decl() * include/abg-ir.h (is_function_parameter, is_class_base_spec): Declare new functions. * src/abg-ir.cc (is_function_parameter, is_class_base_spec): Define them. (hash_type_or_decl): Handle hashing of function parameters are class base specifications with the fast path of type hashing. 2015-10-15 Dodji Seketeli Implement fast type lookup in a corpus * include/abg-fwd.h (components_to_type_name): Declare new function. * include/abg-ir.h (string_type_base_wptr_map_type): New typedef. (translation_unit::{get,set}_types): Declare new member functions. * src/abg-ir.cc (translation_unit::priv::types_): New data member. (translation_unit::{get,set}_types): Define these member functions. (maybe_update_types_lookup_map): Define new static function. (components_to_type_name): Define new function. (scope_decl::{add_member_decl, insert_member_decl}): Call the new maybe_update_types_lookup_map. (scope_decl::find_iterator_for_member): Fix logic. (class_decl::set_is_declaration_only): When a class declaration becomes a definition, update the name -> type map maintained in the scope of the class. (lookup_type_in_translation_unit): Use the hash map of qualified name -> types that is now maintained in the translation unit. This is way faster than the previous walking algorithm. * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): When fixing up global variable declarations that need to be re-added to the translation unit, use the new fast type lookup function. 2015-10-15 Dodji Seketeli Set the corpus of all ABI artifact reads from abixml * src/abg-reader.cc (read_translation_unit): Set the current corpus to the current translation unit being built. 2015-10-14 Dodji Seketeli Make canonicalization non sensitive to struct-ness of subtypes * include/abg-fwd.h (get_type_name, get_function_type_name) (get_method_type_name, get_pretty_representation): Add an "internal" flag to all overoads. * include/abg-ir.h ({type_or_decl_base, decl_base, type_decl, scope_type_decl, qualified_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, function_decl::parameter, function_type, method_type, class_decl}::get_pretty_representation): Add an 'internal' flag. ({decl_base, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl::enumerator, function_decl::parameter}::get_qualified_name): Likewise. (qualified_type_def::build_name): Likewise. * src/abg-ir.cc ({decl_base, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, enum_type_decl::enumerator, function_decl::parameter}::get_qualified_name): Take an "internal" flag. (qualified_type_def::build_name): Likewise. ({decl_base, type_decl, namespace_decl, array_type_def, enum_type_decl, typedef_decl, var_decl, function_type, method_type, function_decl, class_decl}::get_pretty_representation): Likewise. (get_type_name, get_function_type_name, get_method_type_name) (get_pretty_representation): Likewise. (type_base::get_canonical_type_for): Call get_pretty_representation() with the "internal" flag set to "true", to get a pretty representation that is independant from the struct-ness of the subtypes of the type being canonicalized. 2015-10-14 Dodji Seketeli Handle aliased function decls when comparing decls in general * include/abg-ir.h (is_function_decl): Add a const to the reference parameter, making it comply with the definition. * src/abg-ir.cc (equals): In the overload for decl_base, when the two linkage names are different, consider the case of the decls being aliased functions. 2015-10-14 Dodji Seketeli Fix const-ness of a function parameter * include/abg-fwd.h (is_function_decl): Add a const to the parameter to make it comply with the definition in abg-ir.cc. Woops. 2015-10-14 Dodji Seketeli Fix "is-anonymous" abixml property impact on some tests * tests/data/test-abidiff/test-PR18166-libtirpc.so: New file. * tests/data/test-abidiff/test-PR18166-libtirpc.so.abi: Likewise. * tests/data/test-abidiff/test-corpus0-report0.txt: Renamed into tests/data/test-abidiff/test-PR18166-libtirpc.so.report.txt. * tests/data/test-abidiff/test-corpus0-v{0,1}.so.abi: Removed. * tests/data/Makefile.am: Renamed test-corpus0-* files into test-PR18166-libtirpc.so-* files. * tests/test-abidiff.cc (specs): Adjust. 2015-10-14 Dodji Seketeli Do not compare access specs for member types & functions * include/abg-fwd.h (is_function_decl): Declare a new overload. * src/abg-ir.cc (is_function_decl): Define a new overload. (equals): In the overload for decl_base, do not compare access specifiers when comparing member functions and types. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. * tests/data/test-diff-filter/test0-report.txt: Likewise. * tests/data/test-diff-filter/test01-report.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise. * tests/data/test-diff-filter/test4-report.txt: Likewise. 2015-10-14 Dodji Seketeli Fix strip_typedef issues * src/abg-ir.cc (strip_typedef): Do not canonicalize the return type of the method type to typedef-strip. Acknowledge that the return type can be nil. 2015-10-14 Dodji Seketeli Force late canonicalizing of function types read from abixml * src/abg-reader.cc (build_function_type): Late-canonicalize function types. 2015-10-13 Ondrej Oprala Bug 19082 - Recognize suppression spec files * tests/data/Makefile.am: Add new test material to the build system. * tests/data/test-diff-pkg/dirpkg-{0-dir1,{1,2}-dir2}/dir.abignore: A test suppression specification. * tests/data/test-diff-pkg/dirpkg-{2,3}-dir2/.abignore: Likewise. * tests/data/test-diff-pkg/dirpkg-3.suppr: Likewise. * tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/libobj-v0.so: New binary test inputs. * tests/data/test-diff-pkg/dirpkg-{1,2,3}-dir{1,2}/obj-v0.cc: New test source files * tests/data/test-diff-pkg/dirpkg-{1,2,3}-report-{0,1}.txt: New reference outputs * tests/test-diff-pkg.cc: Adjust to run the new tests. * tools/abipkgdiff.cc (prog_options): New static pointer to struct opts. (file_tree_walker_callback_fn): Rename to first_package_tree_walker_callback_fn. (second_package_tree_walker_callback_fn): Check for ELF files just like the previous function but additionally check for files ending with ".abignore", unless disabled from the command line. ({create_maps_of_package,extract_package_and_map_its}_content): Add a callback as a new argument. (main) handle the new "--no-abignore" option, which turns off the search for suppression files within the new package. 2015-10-08 Dodji Seketeli Bug 19024 - Failing to flag underlying type of enums as anonymous * src/abg-dwarf-raeder.cc (build_enum_type): Set the is-anonymous flag on the underlying type of the enum. * tests/data/test-read-dwarf/test0.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise. 2015-10-08 Dodji Seketeli Bug 19025 - abixml writer forgets to emit some member types * include/abg-fwd.h (is_namespace): Fix prototype. * src/abg-writer.cc (struct type_ptr_comp_functor): New internal type. (sort_type_ptr_map): New static function. (write_context::m_referenced_types_map): Renamed m_referenced_fntypes_map data member into this. (write_context::get_referenced_types): New member function. (write_context::record_type_as_referenced): Renamed record_fntype_as_referenced member function into this. Adjust. (write_context::type_is_referenced): Renamed fntype_is_referenced into this. (write_context::clear_referenced_types_map): Renamed clear_referenced_fntypes_map member function into this. Adjust. (write_decl_in_scope): New static function. (write_translation_unit): Use it here to emit types that are referenced by other types in the TU, but that are not emitted. Adjust. (write_pointer_type_def, write_reference_type_def) (write_typedef_decl): Record the underlying types referenced by the emitted types as being, well, referenced. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so: New test binary input. * tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi: New reference output of the binary input above. * tests/data/Makefile.am: Add the new test material above to the source distribution. * tests/test-read-dwarf.cc (in_out_spec): Add the new test inputs. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise. 2015-10-06 Ondrej Oprala Parallelize test read-dwarf. * tests/Makefile.am: Link runtestreaddwarf with libpthread. * tests/test-read-dwarf.cc (main) Create worker threads corresponding to the number of CPUs online, add a "--no-parallel" option and move the main loop... (handleInOutSpec) ...here. 2015-10-07 Dodji Seketeli Bug 19023 - Type canonicalization is sensitive to struct-ness * include/abg-ir.h (class_decl::is_struct): Declare a setter for the "is-struct" property. * src/abg-ir.cc (class_decl::is_struct): And define that setter here. (type_base::get_canonical_type_for): Temporarily set the 'is-struct' flag of the class type to 'false' before building its pretty representation. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so: New test input binary. * tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: New test reference output. * tests/data/Makefile.am: Add the new test material above to the source distribution. * tests/test-read-dwarf.cc (in_out_specs): Add the two new test inputs to the list of test inputs to consider. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust. 2015-10-06 Dodji Seketeli Style adjustment in abg-corpus.cc * src/abg-corpus.cc (corpus::exported_decls_builder::id_var_map_): Renamed data member vars_map_ into this. (corpus::exported_decls_builder::id_var_map): Renamed vars_map into this. (corpus::exported_decls_builder::var_id_is_in_id_var_map): Renamed var_is_in_map into this. (corpus::exported_decls_builder::{add_var_to_map, add_var_to_exported, maybe_add_var_to_exported_vars}): Adjust. 2015-10-06 Dodji Seketeli Bug 19037 - Make ABI corpus support several functions with same symbol * include/abg-corpus.h (corpus::exported_decls_builder::str_{fn,var}_ptr_map_type): Remove these typedefs from here as they only used internally in abg-corpus.cc. So we move them there instead. * src/abg-corpus.cc (str_fn_ptrs_map_type): New typedef. (str_var_ptr_map_type): Moved the typedef that was in corpus::exported_decls_builder here. (corpus::exported_decls_builder::id_fns_map_): Rename the fns_ data member into this. Make it have a str_fn_ptrs_map_type as a type. (corpus::exported_decls_builder::id_fns_map): Renamed the fns_map() accessor into this one. (corpus::exported_decls_builder::{fn_id_is_in_id_fns_map, fn_is_in_fns}): New member functions. (corpus::exported_decls_builder::fn_is_in_id_fns_map): Rename fn_is_in_map into this. (corpus::exported_decls_builder::add_fn_to_id_fns_map): Rename add_fn_to_map into this. (corpus::exported_decls_builder::add_fn_to_exported): Adjust. (corpus::exported_decls_builder::maybe_add_fn_to_exported_fns): Adjust. * src/abg-comparison.cc (function_decl_diff::report): Emit reports about function name changes (for a given function ID) only if there are sub-type changes to be reported for the function. In that case, do not forget to emit the sub-type changes after the name changes have been reported. (corpus_diff::priv::ensure_lookup_tables_populated): Several functions of the same ID can be removed or added from/to the corpus. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so: New test input binary. * tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: New test output reference. * tests/data/Makefile.am: Add the new test materials to the source distribution. * tests/test-read-dwarf.cc (in_out_specs): Adjust to add the new test inputs above. 2015-10-05 Ondrej Oprala Do not imply private access when building a struct from ABIXML. * src/abg-reader.cc (read_context): Abort if we run into an unsupported access specifier. (build_class_decl) Default to public access for the children of a struct. 2015-10-05 Ondrej Oprala Fix minor warnings when building documentation. * manuals/abilint.rst: Fix the "Literal block expected" warning. * manuals/abipkgdiff.rst: Fix the "Title underline too short" warning. 2015-10-05 Ondrej Oprala Fix an "Unknown target name" error during make info. * doc/manuals/libabigail-overview.rst: Fix the reference to "ELF symbols". 2015-10-05 Ondrej Oprala Fix a path in doc/Makefile.am * 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. 2015-10-04 Dodji Seketeli Misc style cleanups * src/abg-reader.cc (read_is_struct): Fix comment. (build_type_decl): Use type_decl_sptr rather than shared_ptr. (build_type_decl): Use typedef_decl_sptr rather than shared_ptr. 2015-10-04 Dodji Seketeli Use the ODR to speed up type canonicalization * include/abg-fwd.h (class corpus): Forward-declare this. (is_anonymous_type): Declare this new function. * include/abg-ir.h (corpus_sptr, corpus_wptr): Declare these typedefs here too. (translation_unit::{g,s}et_corpus): Declare new member functions. (type_or_decl_base::{g,s}et_corpus): Likewise. * src/abg-ir.cc (translation_unit::priv::corpus): New data member. (translation_unit::priv::priv): Initialize it. (translation_unit::{g,s}et_corpus): Define new accessors. (translation_unit::get_global_scope): Propagate the corpus of the translation unit to its newly created global scope. (translation_unit::bind_function_type_life_time): Propagate the corpus of the translation_unit to the added function type. (type_or_decl_base::priv::corpus_): Add new data member. (type_or_decl_base::priv::priv): Initialize it. (type_or_decl_base::{g,s}et_corpus): Define new accessors. (scope_decl::{add,insert}_member_decl): Propagate the context's corpus to the member added to the context. (decl_base::priv::is_anonymous_): Add new data member. (decl_base::priv::priv): Initialize it. (decl_base::{s,g}et_is_anonymous): Define accessors. (is_anonymous_type): Define a new test function. (decl_base::set_name): Update the "is_anonymous" property. (type_base::get_canonical_type_for): Implement the ODR-based optimization to type canonicalization. * src/abg-corpus.cc (corpus::add): When a translation unit is added to a corpus, set the corpus of the translation unit. * src/abg-dwarf-reader.cc (build_enum_type) (build_class_type_and_add_to_ir): Set the "is_anonymous" flag on anonymous enums and classes. * src/abg-reader.cc (read_is_anonymous): Define new static function. (build_type_decl, build_enum_type, build_class_decl): Call the new read_is_anonymous function and set the "is_anonymous" property on the built type declaration. * src/abg-writer.cc (write_is_anonymous): Define new static function. (write_type_decl, write_enum_type_decl, write_class_decl): Write the "is_anonymous" property. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. 2015-10-04 Dodji Seketeli Late canonicalize all types that reference classes when reading DWARF * include/abg-fwd.h (peel_array_type): Declare new function. * src/abg-ir.cc (peel_array_type): Define it. (peel_typedef_pointer_or_reference_type): Peel arrays too, to get the type of its element. * src/abg-dwarf-reader.cc (maybe_canonicalize_type): If a pointer, reference, array or typedef references a class, then do late-canonicalize this type. 2015-10-04 Dodji Seketeli Fix infinite loop in peel_typedef_pointer_or_reference_type * src/abg-ir.cc (peel_typedef_pointer_or_reference_type): Make sure the variable tested in the condition is the one updated by the loop. 2015-10-02 Dodji Seketeli Try harder to hash_type_or_decl avoid the slow path * src/abg-ir.cc (hash_type_or_decl): When a declaration-only class has a definition, then use the canonical type of that definition as a hash value. If the class no definition, only then, use the slow patfh of computing the recursive progressive hash value of the type. 2015-10-02 Dodji Seketeli Do not use recursive type hashing when writing out function types * src/abg-writer.cc (typedef fn_shared_ptr_map): Remove. (write_context::m_referenced_fntypes_map): Change the type of this into type_ptr_map. (write_context::{record_fntype_as_referenced, fntype_is_referenced}): Use the pointer value of the canonical type of the referenced type as key for the map. 2015-10-02 Dodji Seketeli Prevent build_function_type from not canonicalizing certain types * src/abg-dwarf-reader.cc (build_function_type): Associate the type being built with its DIE, before starting to build the sub-types. The current type is then amended with the sub-types that are built later. (build_ir_node_from_die): In the case for DW_TAG_subroutine_type, do not associate the type to the DIE here, as it's been done in build_function_type. * src/abg-ir.cc (function_type::set_parameters): Adjust the index of the parameters being set to the function: they start at 1, unless the first parameter is artificial, in which case its index starts at zero. This is just like what is done when the function type is constructed directly with the parameters passed as an argument to the constructor. 2015-10-02 Dodji Seketeli Fix detection of changes in pointer diff in the comparison engine * src/abg-comparison.cc (pointer_diff::has_changes): Just comparing the underlying type might not be enough. Let's just compare the pointer itself. Now that we have canonical types, comparing the pointer itself is not slower. 2015-10-02 Dodji Seketeli Do not overly canonicalize types during typedef stripping * src/abg-ir.cc (strip_typedef): Do not canonicalize the stripped type if the input one is not canonicalized. 2015-10-02 Dodji Seketeli Cleanup some IR type comparison operators * include/abg-ir.h (operator==): In the overloads for type_decl, enum and class_decl, turn the shared_ptr parameter into a const reference to the shared_ptr. * src/abg-ir.cc (operator==): Do the same in the definitions. 2015-10-02 Dodji Seketeli Add missing deep equality operator for pointer and reference types * include/abg-ir.h (pointer_type_def::operator==): Add an overload for pointer_type_def. (reference_type_def::operator==) Add an overload for reference_type_def. (operator==): Add an overload for pointer_type_def_sptr and reference_type_def_sptr. * src/abg-ir.cc (pointer_type_def::operator==): Make the overload for type_base& use the overload for decl_base&. Add a new overload for pointer_type_def& and make is use the overload for decl_base& too. (operator==): Add free form overloads for pointer_type_def& and reference_type_def&. (reference_type_def::operator==): Add comments. Add an overload for reference_type_def&. 2015-10-02 Dodji Seketeli constify is_class_type() * include/abg-fwd.h (is_class_type): Take a pointer to const. * src/abg-ir.cc (is_class_type): Adjust. 2015-10-01 Ondrej Oprala Bug 19027 - ABI asymmetry with enums over INT_MAX * src/abg-reader.cc (build_enum_type_decl): Use strtol instead of atoi to parse the values and check for overflow. * tests/data/Makefile.am: Add the new test material to the build system. * tests/data/test-read-dwarf/test17-pr19027.so: New test file. * tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise. * tests/test-read-dwarf.cc: Adjust to launch the new test. 2015-10-01 Dodji Seketeli Encourage people to use autoreconf -i * COMPILING: Mention autoreconf -i, rather than just autoreconf. 2015-09-23 Ondrej Oprala Bug 17340 - Support pointers and references to functions * include/abg-comparison.h (compute_diff_for_distinct_kinds): Take the first two arguments of type const type_or_decl_base_sptr instead. * include/abg-ir.h (translation_unit::get_function_types): Declare new method. (function_types): Declare new typedef. * src/abg-comparison.cc (compute_diff_for_types): Take the first two arguments of type const type_or_decl_base_sptr instead of a const decl_base_sptr. (try_to_diff): Likewise. (try_to_diff): Likewise. (try_to_diff_distinct_kinds): Likewise. (compute_diff_for_distinct_kinds): Likewise. Also remove a variant accepting arguments of type const type_base_sptr. * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Skip building a pointer if it points to the beginning of a vptr. (build_pointer_type_def): Declare utype_decl of type type_or_decl_base_sptr and adjust assignments to it accordingly. (build_function_type): New function definition. (build_function_decl): Call build_function_type instead of building an ftype manually. (build_ir_node_from_die): Amend case DW_TAG_subroutine_type with appropriate calls to build a function type. * src/abg-ir.cc (translation_unit::get_function_types): New method definition. ({pointer,reference}_type_def::pointer_type_def): Expect that pointed_to might not have an accompanying declaration and set a type's name in this case as well. ({pointer,reference}_type_def::get_qualified_name): Generate a qualified name even if the pointed-to type has no declaration. * src/abg-reader.cc (build_function_type): New function definition. (handle_element_node): Return a type_or_decl_base_sptr instead and try calling handle_function_type in addition to others. (handle_function_type): New function definition that calls build_function_type. (build_type): Try calling build_function_type as well. * src/abg-writer.cc (fn_shared_ptr_map): Declare new typedef. (write_context::{clear_referenced_fntypes_map,fntype_is_referenced, record_fntype_as_referenced}): New member functions. (write_translation_unit): Call the new clear_referenced_fntypes_map. * tests/data/Makefile.am: Add the new test material to the build system. (write_translation_unit): Separately write function types that have been recorded to emit by write_{pointer,reference}_type_def. (write_{pointer,reference}_type_def): Record the type pointed to as a type to be emitted if type == function type. (write_function_type): Write the details of a function type in the abixml format and unmark the type. * tests/data/test-diff-dwarf/test32-fnptr-changes-report-0.txt: New test reference report. * tests/data/test-diff-dwarf/test32-fnptr-changes-v{0,1}.cc: New test source files. * tests/data/test-diff-dwarf/test32-fnptr-changes-v{0,1}.o: New binary test inputs. * tests/data/test-diff-dwarf/test33-fnref-changes-report-0.txt: New test reference report. * tests/data/test-diff-dwarf/test33-fnref-changes-v{0,1}.cc: New test source files. * tests/data/test-diff-dwarf/test33-fnref-changes-v{0,1}.o: New binary test inputs. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-write/test27.xml: New test source file. * tests/test-diff-dwarf.cc: Adjust to launch the new tests. * tests/test-read-write.cc: Likewise. 2015-09-09 Ondrej Oprala Generalize some dwarf-reader functions to generate and return instances of type_or_decl_base_stpr to be able to propagate types occurring without an accompanying declaration. * src/abg-dwarf-reader.cc (build_ir_node_from_die): Return a type_or_decl_base_sptr instead. (get_scope_for_die): Likewise. (build_class_type_and_add_to_ir): Typecast the assignment from build_ir_node_from_die properly. (build_{qualified,reference,array,typedef}_type): Likewise. (build_pointer_type_def): Likewise. (build_{var,function}_decl): Likewise. 2015-09-29 Ondrej Oprala Move a constructor declaration * include/abg-ir.h (decl_base): Change the decl_base() declaration's visibility to private. 2015-09-24 Dodji Seketeli Bug 18535 - abidiff reports false positive ABI difference for libstdc++ *non-static* data member; a static data member only is not enough to make the class declaration become a definition. * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): The presence of a data member shouldn't make a declaration-only class loose its declaration-only-ness; the presence of a enon-static* data member should. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-4.8.3.so: New binary test input. * tests/data/test-diff-filter/test31-pr18535-libstdc++-4.9.2.so: Likewise. * tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt: New test reference output. * tests/data/Makefile.am: Add the new test material to the build system. * tests/test-diff-filter.cc (in_out_specs): Add the new test inputs to the set of inputs to consider. 2015-09-21 Dodji Seketeli Remove duplicated runtestreaddwarf test * tests/Makefile.am: Remove one copy of the runtestreaddwarf test that is present twice. 2015-09-21 Dodji Seketeli Add a missing function declaration * include/abg-tools-utils.h (dir_name): Add missing function declaration. 2015-09-21 Dodji Seketeli Remove some dead code in abilint * tools/abilint.cc (options::bidiff): Remove. (options::options): Adjust. (display_usage): Remove usage string for --bidiff (parse_command_line): Remove parsing of un-implemented option --bidiff. 2015-09-21 Dodji Seketeli Add a new --abidiff option to abidw * 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. 2015-09-21 Dodji Seketeli Misc style fixes * src/abg-hash.cc (class_decl::hash::operator()): Use a temporary variable to ease debugging. * src/abg-reader.cc (read_context::is_wip_type): Make this function const. * src/abg-writer.cc (write_context): Move data members at the top. 2015-09-21 Dodji Seketeli Speed up type canonicalization by avoiding recursive hashing * include/abg-ir.h (canonical_types_map_type): Adjust this typedef to make it point to an unordered_map which the key is now a string and the value is a vector of types. (type_or_decl_base::{get_cached_hash_value, set_cached_hash_value, cached_hash}): Remove these member functions and type. (struct type_base::cached_hash): Remove. * src/abg-ir.cc (struct type_or_decl_base::priv::hash_): Remove. (type_or_decl_base::priv::priv): Adjust. (type_or_decl_base::{g,s}et_cached_hash_value): Remove. (type_base::get_canonical_type_for): For declaration-only classes, look at their definition for the canonical_type. Do not use recursive type hashing anymore. Rather, use the pretty representation string, and hash that. (class_decl::base_spec::get_hash): Do away with hash value caching here. (class_decl::operator==): For decl-only classes, look at their definitions for canonical types. (hash_type_or_decl): Adjust comment. Use the canonical type pointer value for type hash. That's the fast path. Otherwise, if not available, fall back to a slow path which is the recursive type hash we were using before. * src/abg-dwarf-reader.cc (maybe_canonicalize_type): Schedule all classes and typedef to classes for late canonicalization. * src/abg-hash.cc (type_base::dynamic_hash::operator()): There is no hash value cashing anymore. (type_base::cached_hash::operator()): Remove. * src/abg-reader.cc (read_context::get_type): Slight style adjustment. (read_translation_unit_from_file) (read_translation_unit_from_buffer): Do not forget to canonicalize types when reading just one translation unit. (build_type_tparameter, build_template_tparameter): Canonicalize the type. * src/abg-writer.cc (struct type_hasher): New hasher type. (type_ptr_map): Use a deep pointer comparison equal operator functor, and canonical types as type hash values. (write_class_decl): Do not write size and alignment on decl-only classes. Do not record decl-only classes as being emitted. Their definition must be emitted before. * tests/test-read-write.cc (main): Do not do abi testing on translation units (as opposed to doing it on abi corpora) as that code is not wet yet. We need to know how to diff namespaces. * tests/data/test-abidiff/test-PR18791-report0.txt: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. 2015-09-21 Dodji Seketeli Update qualified name of a decl when it's added to its context * include/abg-ir.h (decl_base::priv_): Make this be public, so that the qualified name updater function can access it. (class class_decl): Make set_member_is_static() a friend function. * src/abg-ir.cc (class ::qualified_name_setter): New tree walking type. (decl_base::get_qualified_parent_name): Do not do any computation here. Just return the pre-computed qualified parent name string. (decl_base::get_qualified_name): Likewise, for qualified name. (scope_decl::{add,insert}_member_decl): Update the qualified name of the newly added member. Set the scope of the member here. It's not going to be set elsewhere, from now on. (add_decl_to_scope): Do not set the scope here anymore. Just call scope_decl::add_member_decl and let it do the work. (insert_decl_into_scope): Likewise, just call scope_decl::insert_member_decl and let it do the work. (class_decl::{add_data_member, add_member_function}): Do not handle details of context setting at this point. Let scope_decl::add_member_decl do it. Adjust the properties of the context relation afterwards. In add_data_member, when a data member changes its static-ness, move the data member into the class_decl::priv::non_static_data_members_ or out of it, as necessary. (class_decl::insert_member_decl): By default, a data member is considered static. (set_member_is_static): Move this definition after the definitions of class_decl, so that this function can see those. Also, when a data member changes its static-ness, move the data member into the class_decl::priv::non_static_data_members_ or out of it, as necessary. (class_decl::add_member_function_template): As we the underlying function template decl to the context, do not do any scope adding for it here. (::qualified_name_setter::{do_update, visit_begin}): Define new member functions. (update_qualified_name): Define new static function. * src/abg-reader.cc (build_class_decl): Make build_function_decl, build_var_decl, build_function_tdecl and build_class_tdecl automatically add the created decl to their context, and then update the properties of the resulting member decl later, just like what we do in the DWARF reader. 2015-09-21 Dodji Seketeli Add new test functions * include/abg-fwd.h (is_function_decl, is_decl, is_namespace) (is_scope_decl): Declare new function overloads. * src/abg-ir.cc (is_function_decl, is_decl, is_namespace) (is_scope_decl): Define them. 2015-09-21 Dodji Seketeli Constify some diff-utils functor operators * include/abg-diff-utils.h (deep_ptr_eq_functor::operator()): Make the overloads be const. 2015-09-16 Dodji Seketeli Support source_location_not_in and source_location_not_regexp suppressions * 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. 2015-09-16 Dodji Seketeli Pass simple property data by reference * include/abg-ini.h (simple_property::{simple_property, set_value}): Pass the value shared pointer by reference. * src/abg-ini.cc (simple_property::{simple_property, set_value): Pass the value shared pointer by reference. 2015-09-15 Dodji Seketeli Make string_ends_with() allow long suffixes * src/abg-tools-utils.cc (string_ends_with): Allow suffixes of the same size as the input string. 2015-09-13 Dodji Seketeli Add missing 'break' keyword in e_machine_to_string() * src/abg-dwarf-reader.cc (e_machine_to_string): Add missing 'break' keywords in switch/case statement. 2015-09-09 Dodji Seketeli Fix compilation warnings in abipkgdiff.cc * tools/abipkgdiff.cc (package::erase_extraction_directory) (extract_rpm, extract_deb, extract_tar) (erase_created_temporary_directories_parent): Check the return value of the system() function. (extract_package): Add necessary white space. 2015-09-09 Dodji Seketeli Fix spurious errors in the install-man-and-info-doc target * 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. 2015-09-09 Dodji Seketeli Compare qualified name in decl_base comparison operator * src/abg-ir.cc (equals): In the overload for decl_base, compare qualified names, not just names. * tests/data/test-abidiff/test-PR18791-report0.txt: Adjust. 2015-09-08 Dodji Seketeli Fix a stupid typo in function sorting code * src/abg-comparison.cc (function_comp::operator()): Fix a typo preventing the proper sorting of function name when their declarator names are equal. Oops. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust. 2015-09-08 Dodji Seketeli Update manual for abipkgdiff * doc/manuals/abipkgdiff.rst: Say we support tarballs and plain directories. 2015-09-07 Dodji Seketeli Adjust {s,g}et_show_stats() to use a reference * include/abg-dwarf-reader.h ({s,g}et_show_stats): Use a reference to the reader. * tools/abidiff.cc (main): Adjust. * tools/abidw.cc (main): Likewise. 2015-09-07 Dodji Seketeli Use cache type hash values only after type canonicalization is done *when* we request that hash value. If we are computing the hash value of struct list itself, then the temporary value of "struct list" is zero. But then once we are done computing the hash value of "struct list", that value becomes non-zero. Hence, the hash value of a type depends on when that value is computed. But then if we want to cache that hash value and re-use it later, which value should we cache? Definitely not the zero value! So in other words, we can use (and thus cache) the hash value of a given type T only after the hash values of all types which use T have been computed. To satisfy that condition, we decide to use the (cached) hash value of each type only after we've computed all the hash values of all types of the system. So, during type canonicalization, when a type T is canonicalized, this patch stores the hash value of T. But then it's only when all types are canonicalized that the hashing code is allowed to re-use the cached value of types. This fixes the issues of spurious type differences introduced when the same type was read either from DWARF or from abixml. Those differences where introduced by differences in the order of hashing types which sub-types refer to themselves. The patch also updates regression tests accordingly. * src/abg-dwarf-reader.cc (read_debug_info_into_corpus): Before we read debug info and build the IR, set a flag in the environment saying that type canonicalization isn't finished yet. But then, after type canonicalization is done, flip that flag to say that type canonicalization is done. * src/abg-reader.cc (read_corpus_from_input): Likewise. * src/abg-ir.cc (type_base::get_canonical_type_for): Once a type has been canonicalized, cache its hash value. * src/abg-hash.cc (type_base::dynamic_hash::operator()): If type canonicalization has been done and if the type has a cached value, use that one. * tests/data/test-read-dwarf/test2.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. * tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise. 2015-09-07 Dodji Seketeli Introduce the concept of environment * include/abg-ir.h: Adjust note about memory management. (class environment): Declare new class. (translation_unit::translation_unit): Take an environment in parameter. (translation_unit::{g,s}et_environment): Declare new member functions. (type_or_decl_base::{g,s}et_environment): Likewise. (type_or_decl_base::{get_cached_hash_value, set_cached_hash_value}): Change the name of decl_base::peek_hash_value() and decl_base::set_hash() here into these and move them here. (type_or_decl_base::hashing_started): Move decl_base::hashing_started() here. ({g,s}et_environment_for_artifact): Declare new functions. (class decl_base): Move member functions hashing_started(), peek_hash_value() and set_hash() on to the type_or_decl_base base class. (scope_decl::scope_decl): Initialize the virtual member type_or_decl_base(). (type_decl::{get_void_type_decl, get_variadic_parameter_type_decl}): Remove these static member functions. They are now non-static member functions of the new environment type. * src/abg-ir.cc (class environment_setter): New internal class. (get_canonical_types_map): Remove. This now becomes a member function of the environment type. (class usage_watchdog): Remove. (usage_watchdog_{s,w}ptr): Remove these typedefs. (get_usage_watchdog_wptr, ref_usage_watchdog) (maybe_cleanup_type_system_data): Remove these functions. (translation_unit::priv::usage_watchdog_): Remove data member. (translation_unit::priv::env_): New data member. (translation_unit::priv::priv): Take an environment and initialize the new env_ data member. Do not initialize the removed usage_watchdog_. (translation_unit::translation_unit): Take an environment parameter. (translation_unit::get_global_scope): Set the environment of a new global scope. (translation_unit::{g,s}et_environment): New accessors. (translation_unit::bind_function_type_life_time): Set the environment of the function type. (struct environment::priv): New class. (environment::{environment, ~environment, get_canonical_types_map, get_variadic_parameter_type_decl, canonicalization_is_done}): New member functions. (struct type_or_decl_base::priv): New class. (type_or_decl_base::{type_or_decl_base, hashing_started, get_cached_hash_value, set_cached_hash_value, set_environment, get_environment, traverse}): New member functions. ({s,g}get_environment_for_artifact): New functions. (decl_base::priv::{hash_, hashing_started}): Remove. (decl_base::priv::priv): Adjust. (decl_base::decl_base): In the copy constructor, initialize the virtual base type_or_decl_base. Do not initialize hash_ and hashing_started data member that got removed. (decl_base::{hashing_started, peek_hash_value, set_hash}): Remove member functions. (strip_typedef): Set the environment of the new type which has its typedefs stripped off. Adjust the call to type_or_void(). (scope_decl::{add, insert}_member_decl): Set the environment of the new member decl to the environment of its scope. (synthesize_type_from_translation_unit) (synthesize_function_type_from_translation_unit): Set the environment for the newly synthesized type. Adjust calls to type_or_void(). (type_or_void): Take an environment in parameter. Get the void type from the environment. (get_canonical_types_map): Remove. (type_base::get_canonical_type_for): Get the canonical types map from the environment, not from a global variable. (type_decl::{get_void_type_decl, get_variadic_parameter_type_decl}): Remove. (pointer_type_def::pointer_type_def): Adjust call to type_or_void. (reference_type_def::reference_type_def): Likewise. (function_decl::parameter::get_pretty_representation): Get the variadic parameter type decl from the environment. (class_decl::priv::classes_being_compared_): Remove static data member. (class_decl::priv::{mark_as_being_compared, unmark_as_being_compared, comparison_started): Use the "classes being compared" map from the environment. (class_decl::base_spec::get_hash): Adjust. (keep_type_alive): Get the alive types array from the environment) not from a global variable anymore. (get_next_string): Put the counter in thread-local storage. * src/abg-hash.cc (scope_decl::hash::operator()) (function_decl::hash::operator()): Do not handle caching (here). * include/abg-corpus.h (corpus::{g,s}et_environment): Declare new accessors. * src/abg-corpus.cc (corpus::priv::env): New data member. (corpus::priv::priv): Initialize it. (corpus::corpus): Take an environment in parameter. (corpus::{g,s}et_environment): Define new member functions (corpus::add): Set the environment of the newly added translation unit, if it's not set already set. In any case, assert that the translation unit must use the same environment as the corpus. * include/abg-dwarf-reader.h (create_read_context) (read_corpus_from_elf): Take an environment parameter. ({s,g}et_debug_info_root_path, {s,g}et_environment): Declare new functions. * src/abg-dwarf-reader.cc (read_context::{env_, offline_callbacks_}): New data members. (read_context::read_context): Initialize them. (read_context::clear_per_translation_unit_data): Do not touch the void type declaration, it doesn't belong to the translation unit. (read_context::{env, offline_callbacks}): New accessors. (read_context::{create_default_dwfl}): New member function. (read_context::dwfl_handle): Add a setter overload. ({s,g}et_debug_info_root_path): Define new accessors. (create_default_dwfl, create_dwfl_sptr, create_default_dwfl_sptr): Remove these. (build_translation_unit_and_add_to_ir): Adjust to pass the environment to the newly created translation unit. (build_function_decl): Adjust to pass the environment to the created function and parameter types. Get variadic parameter type node from the current environment, not from a global variable. And do not try to canonicalize function types here. (read_debug_info_into_corpus): Set the environment of the newly created corpus. (build_ir_node_for_void_type): Get the void type node from the current environment, rather than from a global variable. (create_read_context): Take the environment in parameter. Create the default dwarf front end library handle using the new member function of the read context. Set the current environment used by the reader. (read_corpus_from_elf): Take an environment in parameter. Overhaul. This is now simpler. (has_alt_debug_info): Adjust the call to create_read_context() to make it pass an empty environment. * include/abg-fwd.h (class environment): Forward declare. * include/abg-reader.h (read_translation_unit_from_file) (read_translation_unit_from_buffer) (read_translation_unit_from_istream) (read_corpus_from_native_xml): Take an environment in parameter. * src/abg-reader.cc (read_context::m_env): New data member. (read_context::read_context): Initialize it. (read_context::{get_environment, set_environment}): New data member. (read_translation_unit): Set environment of the new translation unit. (read_corpus_from_input): Set the environment of the new corpus. (read_translation_unit_from_file) (read_translation_unit_from_buffer) (read_translation_unit_from_istream, read_corpus_from_native_xml): Take an environment in parameter. (build_function_parameter): Get variadic parameter type from the environment. * src/abg-comparison.cc (compute_diff): Add asserts in all the overloads to ensure that the artifact being compared come from the same environment. * tests/print-diff-tree.cc (main): Create an env for the ABI artifacts to use. * tests/test-abidiff.cc (main): Likewise. * tests/test-diff-dwarf.cc (main): Likewise. * tests/test-ir-walker.cc (main): Likewise. * tests/test-read-dwarf.cc (main): Likewise. * tests/test-read-write.cc (main): Likewise. * tools/abicompat.cc (main): Likewise. * tools/abidiff.cc (main): Likewise. * tools/abidw.cc (main): Likewise. * tools/abilint.cc (main): Likewise. * tools/abipkgdiff.cc (main): Likewise. 2015-09-07 Dodji Seketeli Fix redundant const qualifier stripping * include/abg-ir.h (operator&, operator~): Add overloaded bitwise operators for qualified_type_def::CV. * src/abg-ir.cc (operator&, operator~): Define them. * src/abg-dwarf-reader.cc (maybe_strip_qualification): Fix comment. If there are multiple qualifiers, only strip the const one. (build_ir_node_from_die): Once we've built a qualified type, if the 'const' qualifier is stripped, then add the new (stripped) type to the set of new types. 2015-09-05 Dodji Seketeli Fix wording in README * README: Fix wording. 2015-09-02 Dodji Seketeli Misc style fixes * src/abg-hash.cc (class_decl::hash::operator()): Remove some dead code. * src/abg-ir.cc (equals): In the overload for class_decl, re-indent. 2015-09-02 Dodji Seketeli Re-arrange some regression tests order * tests/Makefile.am: Run runtestreaddwarf and runtestcanonicalizetypes at the beginning. 2015-09-02 Dodji Seketeli Bug 18904 - Fix support for C++ rvalue references * src/abg-comparison.cc (reference_diff::has_changes): Just compare the references, rather than assuming that the change can only be on underlying types. (reference_diff::report): Describe lvalue/rvalue changes for references. * src/abg-ir.cc (reference_type_def::reference_type_def): Properly set the name for an rvalue reference. (equals): For references, compare lvalue-ness too. (reference_type_def::get_qualified_name): Properly set rvalue reference names. * tests/data/test-diff-filter/test30-pr18904-rvalueref-liba.so: New test input. * tests/data/test-diff-filter/test30-pr18904-rvalueref-libb.so: New test input. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: New test reference output. * tests/data/Makefile.am: Add the new files to source distribution. * tests/test-diff-filter.cc (in_out_specs): Run the new tests. 2015-09-02 Dodji Seketeli More type degradation fixes (from DWARF to abixml) * include/abg-fwd.h (get_type_scope): Declare new function. * src/abg-hash.cc (var_decl::hash::operator()): Do not cache the hash because that can alter the hash computing of a larger type which embeds a var decl as a member declaration. This is especially true if the var decl indirectly references the larger type. The only way to cache the value of a var decl would be to wait after all canonical types have been computed. We'd then seal all types. After that sealing happens, we can cache var decls starting from the top-level ones. (function_decl::hash::operator()): Likewise. * src/abg-ir.cc (get_type_scope): Define new functions. * src/abg-reader.cc (read_is_declaration_only): Declare this function earlier. (typedef const_types_map_it): Adjust this to make it point to a map of string and vector of types, as opposed to a map to string and type as it was before. (typedef types_map_it): New typedef. (read_context::map_id_and_node): Map a type id to the last xmlNodePtr that represent a *declaration*. That gives more leeway to the declaration resolution code to choose the right definition later. Otherwise, there are cases where the wrong definition. By wrong definition, I mean a definition that is different from the one chosen by the DWARF reading code, for a given declaration. Basically for a given ABI corpus, a type declaration resolve to the first definition seen in the corpus. (read_context::get_all_type_decls): Define new member function. (read_context::types_equal): Use qualified names only if both types have a scope. (read_context::key_type_decl): Now a given ID is associated to *all* the declarations and definition that have that ID. (read_translation_unit_from_input): Make sure the current corpus node points to the right node. (build_class_decl): Resolve class declarations to the first definition seen in the corpus. Key a type decl before reading its members as a reading a member can request the current decl. No need to try and canonicalize a member type, as build_class_decl() does that already. * tests/data/test-read-dwarf/test16-pr18904.so: New test binary input. * tests/data/test-read-dwarf/test16-pr18904.so.abi: New test output reference. * tests/test-read-dwarf.cc: Run the test above. * tests/data/Makefile.am: Add the new test input to source distribution. * tests/data/test-abidiff/test-PR18791-report0.txt: Adjust. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. * tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise. * tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise. 2015-08-30 Dodji Seketeli Bug 18892 - type degradation from DWARF to abixml on libtsan.so * src/abg-reader.cc (read_context::maybe_canonicalize_type): Late canonicalize enum types. (build_enum_type_decl): Read the linkage name of the enum type. * src/abg-writer.cc (write_enum_type_decl): Emit the linkage name of the enum type. * tests/data/test-read-dwarf/test15-pr18892.so: New binary test input. * tests/data/test-read-dwarf/test15-pr18892.so.abi: New test output reference. * tests/data/Makefile.am: Add the new test inputs above to source distribution. * tests/test-read-dwarf.cc (in_out_specs): Run the two tests above. 2015-08-30 Dodji Seketeli Bug 18893 - type degradation from dwarf to abixml on libGLU.so * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Do not consider that virtual member functions disqualify a class from being declaration-only. * src/abg-hash.cc (var_decl::hash::operator()): Do not cache the result of hashing before we are done building the type of the var_decl. (function_decl::hash::operator()): Likewise, do not cache the result of hashing before we are done building the type of the function_decl. * src/abg-reader.cc (build_class_decl): Build the link between a class declaration and its definition. If there are several definitions of a class in the corpus, keep just one. * src/abg-writer.cc (write_class_is_declaration_only): Emit the link between a class declaration and its definition. (write_class_decl): Emit a class declaration even if it has a definition. The definition is going to be emitted separately. * tests/data/test-read-dwarf/test14-pr18893.so: New binary test input. * tests/data/test-read-dwarf/test14-pr18893.so.abi: New test reference output. * tests/data/Makefile.am: Add the new test input files to source distribution. * tests/test-read-dwarf.cc (in_out_specs): Run the new tests. * tests/data/test-abidiff/test-PR18791-report0.txt: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise. 2015-08-30 Dodji Seketeli Use common canonicalization oracle when reading class type from dwarf * src/abg-dwarf-reader.cc (build_ir_node_from_die): (maybe_canonicalize_type): Move the specific logic that was in build_ir_node_from_die (for class types) here. 2015-08-30 Dodji Seketeli Fix crash in file type guessing * src/abg-tools-utils.cc (string_ends_with): Handle the case where the string suffix is longer than the string itself. 2015-08-29 Dodji Seketeli Bug 18894 - Fix representation of enumerators in abixml format * include/abg-ir.h (enum_type_decl::enumerator::get_value()): Change the type of this from size_t to ssize_t. * src/abg-ir.cc (enum_type_decl::enumerator::get_value): Do the same on the definition side. (non_canonicalized_subtype_detector::visit_begin): If a type refers to itself, late canonicalize it to have a similar hashing result as what the abixml reader does. * src/abg-reader.cc (build_enum_type_decl): Use ssize_t to read the value of enumerators. * tests/data/test-read-dwarf/test13-pr18894.so.abi: New test input. * tests/data/Makefile.am: Add the new test inputs above to source distribution. * tests/test-read-dwarf.cc (in_out_specs): Add new test inputs. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. 2015-08-29 Dodji Seketeli Detect vtable changes from member function changes * include/abg-ir.h (class_decl::{has_virtual_base, has_vtable}): Declare new member functions. * src/abg-comp-filter.cc (has_virtual_mem_fn_change): New overload for function_decl_diff. (has_virtual_mem_fn_change): In the overload for diff*, support virtual member function changes detection for function_decl_diff*. * src/abg-comparison.cc (function_decl_diff::report): Detect and report changes to a vtable by looking a changes that can happen to a given member function. (corpus_diff::report): Detect and report changes to vtables by looking at changes change to member functions. * tests/data/test-diff-dwarf/test29-vtable-changes-report-0.txt: New text input. * tests/data/test-diff-dwarf/test29-vtable-changes-v{0,1}.cc: Source code of new test input binaries. * tests/data/test-diff-dwarf/test29-vtable-changes-v{0,1}.o: New test input binaries. * tests/data/test-diff-dwarf/test30-vtable-changes-report-0.txt: New text input. * tests/data/test-diff-dwarf/test30-vtable-changes-v{0,1}.cc: New test input. * tests/data/test-diff-dwarf/test30-vtable-changes-v{0,1}.o: New test input binaries. * tests/data/test-diff-dwarf/test31-vtable-changes-report-0.txt: New test input. * tests/data/test-diff-dwarf/test31-vtable-changes-v{0,1}.cc: Source code of new test input binary. * tests/data/test-diff-dwarf/test31-vtable-changes-v{0,1}.o: New test input binary. * tests/data/Makefile.am: Add the new test input files above to source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Consume the new test inputs above. 2015-08-29 Dodji Seketeli Do not hash or compare virtual member functions as par of classes * src/abg-ir.cc (equals): When comparing two classes, do not compare their virtual member functions. * src/abg-hash.cc (class_decl::hash::operator()): Do not hash virtual member functions when hashing a class. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. 2015-08-29 Dodji Seketeli Misc style fixes * src/abg-ir.cc (qualified_type_def::get_qualified_name): Fix typos in comments. (class_decl::member_class_template::operator==): Add comments. (operator==): Add comment for the overload of class_decl::member_class_template_sptr. (function_tdecl::operator==): Add comments. 2015-08-29 Dodji Seketeli Adjust many reference output for the non-regression test suite * tests/data/test-abidiff/test-enum0-report.txt: Adjust. * tests/data/test-abidiff/test-enum1-report.txt: Adjust. * tests/data/test-abidiff/test-qual-type0-report.txt: Adjust. * tests/data/test-abidiff/test-struct0-report.txt: Adjust. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-write/test17.xml: Adjust. 2015-08-29 Dodji Seketeli Make test-read-dwarf.cc and test-read-write.cc abidiff the ABIs * tests/test-read-dwarf.cc (main): Use abidiff to compare the input elf file with the XML emitted. That should yield the empty set. * tests/test-read-write.cc (main): Likewise, use abidiff to compare the input abixml file with the one that is emitted. 2015-08-29 Dodji Seketeli 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. 2015-08-29 Dodji Seketeli Add a --no-architecture option to abidiff * 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. 2015-08-29 Dodji Seketeli Read abixml as a whole file and fix lots discrepancies with dwarf * src/abg-reader.cc (class read_context): Move data member at the top of the class like what is done elsewhere in the code base. (read_context::m_corp_node): New data member. (read_context::read_context): Initialize it. (read_context::{get,set}_corpus_node): New accessors. (read_context::map_id_and_node): Accept that a node id previously defined is defined again. In that case we just remember the first mapping id -> xml-node. That seems to work for now. (read_context::get_translation_unit): Fix the logic. (read_context::m_wip_types_map): Rename read_context::m_wip_classes_map into this. (read_context::clear_wip_types_map): Rename read_context::clear_wip_classes into this. (read_context::mark_type_as_wip): Rename read_context::mark_class_as_wip into this. (read_context::unmark_type_as_wip): Rename read_context::unmark_type_as_wip into this. (read_context::is_wip_type): Rename read_context::is_wip_class into this. (read_context::types_equal): New member function. (read_context::clear_per_translation_unit_data): Do not clear anything anymore as the previous data that were per-tu are now per-corpus. (read_context::clear_per_corpus_data): Clear here the previous data that were per-tu. (read_context::maybe_canonicalize_type): Add a new force_delay flag that forces the type to be late-canonicalized. Also force late-canonicalize references, pointers, qualified-type and typedef because they must be canonicalized once they've been added to their context; but then this function might be called too early, before they are added to their context. (read_context::type_id_new_in_translation_unit): Remove this member function. (read_translation_unit_from_input): Be able to either use the xmlTextReader interface, or get the current 'abi-instr' xml element node. If using the xmlTextReader interface, use it to move to the 'abi-instr' node, expand it and then use that. In either case, call read_translation_unit() with the 'abi-instr' xml element node. (read_translation_unit): Take an 'abi-instr' XML element in argument now, use that to read the translation unit, as opposed to using the xmlTextReader interface we where using before to walk the sub-tree of the abi-instr xml node. (read_context::get_scope_for_node): If the scope is a new translation unit, then build the new translation unit. (read_symbol_db_from_input): Take the function and variable symbol data bases, and read the current xml element node (do not use the xmlTextReader interface anymore) to populate the function and variable symbols. (read_elf_needed_from_input): Do not use the xmlTextReader interface anymore. Rather, use the current xml element node, look for the 'elf-needed' xml element node and use it to populate the set of elf dependencies. (read_corpus_from_input): Rework to expand the contents of the corpus node and use the result, rather than just exclusively relying on the xmlTextReader interface. (build_function_parameter): Build a proper IR node for variadic parameters. Build function type node *after* having built all the parameters IR, so that parameter indexing is the same as what is done in the DWARF reader. Also, if the function is not being added to its context yet, then delay the canonicalizing of its type, just like what is done by the DWARF reader. (build_qualified_type_decl, build_pointer_type_def) (build_reference_type_def, build_enum_type_decl, build_type_decl): Adjust. Do not enforce anymore that the ID of this type be new in the current TU. Delay canonicalizing if the type is not being added to its context. For typedefs, use an adapted way of checking the consistency of the underlying type. (build_array_type_def): Do not enforce anymore that the ID of this type be new in the current TU. Support the fact that the array might not have any DW_AT_byte_size attribute. Force late canonicalizing if the array is not being added to its context. (build_class_decl): Adjust. Reuse the read_context::maybe_canonicalize_type() function rather than trying to determine locally when to canonicalize. (build_template_tparameter): Adjust 2015-08-29 Dodji Seketeli Fix handling of class declaration during DWARF reading *virtual* member functions, data members, base classes or a DW_AT_byte_size as being conditions for being defined. * src/abg-dwarf-reader.cc (read_context::decl_only_classes_map_): Remove this data member. (read_context::{declaration_only_classes_to_force_defined, schedule_declaration_only_class_for_forced_resolution}): Remove these member functions. (read_context::resolve_declaration_only_classes): Do not force resolution of class declaration. (build_class_type_and_add_to_ir): Do not schedule classes for forced-resolution when they are used as base classes. The presence of a member function is not enough to make the class be defined. It needs to be a virtual member function. 2015-08-28 Dodji Seketeli Fix important hashing issues * src/abg-hash.cc (class_decl::hash::operator()): Do not force base classes to have definitions anymore. GCC and Clang (at least) some time emits debug info in which the definition of some base classes are missing, especially when those base classes have vtables. In that case, the definition of the class might it's in the binary where the vtable is emitted, which might not be the binary we are looking at. So let's relax the assertion we had here for base classes. For hashing virtual member functions, directly walk the virtual member functions by looking at class_decl::get_virtual_mem_fns() rather than walking all member functions and looking for the virtual ones. This is a speed optimization but it also helps during debugging. 2015-08-28 Dodji Seketeli Fix template comparison operators * include/abg-ir.h (function_tdecl::operator==): Introduce a new virtual member operator that takes a function_tdecl&. * src/abg-ir.cc (class_decl::member_function_template::operator==): Avoid the static cast in the overload for member_base. In the overload for member_class_template, avoid infinite recursion. (function_tdecl::operator==): In the overload for decl_base, do not do the real work here in the overload for decl_base Rather, the real work is done in the new overload for function_tdecl, and all other overloads call that one. 2015-08-28 Dodji Seketeli Use size/alignment of class definition when requested on declaration * include/abg-ir.h (type_base::{set_size_in_bits, set_alignment_in_bits}): Make these member functions virtual. (class_decl::{set_size_in_bits, get_size_in_bits, get_alignment_in_bits, set_alignment_in_bits}): Declare these virtual member functions. * src/abg-ir.cc (class_decl::{set_size_in_bits, get_size_in_bits, get_alignment_in_bits, set_alignment_in_bits}): Define these virtual functions. 2015-08-28 Dodji Seketeli Fix type lookup algorithm * src/abg-ir.cc (find_next_delim_in_cplus_type): Define new static function. (fqn_to_components): Use the new function above to break up a fully qualified name into components, rather than the too simple string::find_first_of() we were using previously. (lookup_node_in_scope): If the found type (class) is a declaration-only and if it has a definition, then return it. 2015-08-26 Dodji Seketeli Make decl hashing always take qualified name into account * src/abg-hash.cc (decl_base::hash::operator()(const decl_base&)): Always hash the qualified name of the decl. 2015-08-26 Dodji Seketeli Accept base classes which types are compatible with class type * include/abg-fwd.h (is_compatible_with_class_type): Declare a new overload. * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Rather than requiring that base classes be of class type, just require that they be compatible with class types. * src/abg-ir.cc (is_compatible_with_class_type): Define a new overload. 2015-08-26 Dodji Seketeli Harden function_decl::get_pretty_representation() * src/abg-ir.cc (function_decl::get_pretty_representation): Make sure the function type is a member function before calling get_member_function_is_{virtual,ctor,dtor,const}. 2015-08-25 Dodji Seketeli Don't cache type qualified name before canonicalization * src/abg-ir.cc (decl_base::{get_qualified_parent_name, get_qualified_name}): Use the qualified name cache only if the type is fully built, i.e, when its canonical type is present. (qualified_type_def::get_qualified_name): Likewise. (pointer_type_def::get_qualified_name): Likewise. (reference_type_def::get_qualified_name): Likewise. (array_type_def::get_qualified_name): Likewise. 2015-08-22 Dodji Seketeli Misc style cleanups * configure.ac: Fix some spelling typos. * src/abg-tools-utils.cc (guess_file_type): Fix indentation. * tests/test-diff-pkg.cc (int_out_specs): Add some vertical spaces for better legibility. * tools/abidiff.cc (main): Add a missing space. * tools/abipkgdiff.cc (extract_deb): Fix a typo in the comment. 2015-08-22 Dodji Seketeli Make abipkgdiff compare tar archives containing binaries * config.h.in (WITH_TAR): New configuration preprocessor macro. * configure.ac: Add a new --enable-tar option. It's turned on automatically if the tar program is found in the PATH. Adjust the build configuration report to add the tar archive support. * include/abg-tools-utils.h (string_ends_with): Declare new function. (enum file_type): Add a new FILE_TYPE_TAR enumerator. * src/abg-tools-utils.cc (string_ends_with): Define new function. (operator<<(ostream&, file_type)): Serialize the new FILE_TYPE_TAR enumerator. (guess_file_type): Detect UStar format file by reading its magic number. Detect compressed tar files based on the file path extension. * tools/abipkgdiff.cc (extract_tar): Define new function. (extract_package): Handle tar packages. (main): Handle tar archives. * tools/abidiff.cc (main): Handle the new FILE_TYPE_TAR enumerator. * tools/abilint.cc (main): Likewise. * tests/data/test-diff-pkg/tarpkg-0-dir{1,2}.ta{,r,.bz2, gz}: New test input tarballs. * tests/data/test-diff-pkg/tarpkg-0-report-0.txt: New test output reference. * tests/data/Makefile.am: Add the new test data file above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add new tests cases. 2015-08-22 Dodji Seketeli Misc style fixes in abipkgdiff * include/abg-tools-utils.h (enum file_type): Fix the comment for for the FILE_TYPE_DEB enumerator. * tools/abipkgdiff.cc (main): Fix the style of the conditions. Also, fix the text emitted. 2015-08-22 Dodji Seketeli Make abipkgdiff compare directories containing binaries * include/abg-tools-utils.h (enum file_type): Add a new FILE_TYPE_DIR enumerator. * src/abg-tools-utils.cc (operator<<(ostream&, file_type)): Support serialization of the new FILE_TYPE_DIR enumerator. (guess_file_type): Detect that the path given is a directory. * tools/abipkgdiff.cc (package::package): If the package is a directory, then set its extracted directory path to the path of the directory. (package::erase_extraction_directory): Do not erase the extraction directory if the package is a directory provided by the user. (extract_package): If the package is a directory provided by the user, then there is nothing to extract. (main): If the first package is a directory, then the second one should be a directory as well. * tools/abidiff.cc (main): Support directories as input. * tools/abilint.cc (main): Likewise. * tests/data/test-diff-pkg/dirpkg-0-dir{1,2}/libobj-v0.so: New binary test inputs. * test/data/test-diff-pkg/dirpkg-0-report-0.txt: New input test file. * tests/data/test-diff-pkg/dirpkg-1-dir{1,2}/obj-v0.cc: Source code of the binary test inputs above. * tests/data/Makefile.am: Add the new files above to the source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the new test input files above to the set of tests this harness has to run over. 2015-08-22 Dodji Seketeli [dwarf reader] Support reference types without explicit DW_AT_byte_size * src/abg-dwarf-reader.cc (build_reference_type): If the type DIE has no DW_AT_byte_size, assume the type size is the translation unit's address size. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. 2015-08-21 Dodji Seketeli [dwarf reader] Support pointer types without explicit DW_AT_byte_size * abg-dwarf-reader.cc (build_pointer_type_def): If the type DIE has no DW_AT_byte_size, assume the type size is the translation unit's address size. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust. 2015-08-21 Dodji Seketeli make abipkgdiff compile with GCC 4.4.7 * tools/abipkgdiff.cc (package::extracted_packages_parent_dir): The string holding the dir name is no more __thread, as this won't compile with GCC 4.4.7 2015-08-21 Dodji Seketeli Misc style fixes * src/abg-dwarf-reader.cc (read_context::die_type_map): Fix typo in the comment. * src/abg-ir.cc (peel_typedef_type): Fix typo in the comment. * src/abg-reader.cc (read_context::perform_late_type_canonicalizing): Fix a type in the comment. 2015-08-21 Dodji Seketeli Make get_pretty_representation work on method types * include/abg-fwd.h (is_method_type): Declare new overloads for naked pointers. (get_method_type_name): Declare new functions. (get_pretty_representation): Declare new overloads for method_type. * src/abg-ir.cc (get_function_type_name): If the function type is a method type, handle it as such. (get_method_type_name): Define new functions. (get_pretty_representation): If the function type is a method type, handle it as such. (get_pretty_representation): Define new overloads for method_type and pointer/reference to method_type. (is_method_type): Add overloads for naked pointers. 2015-08-21 Dodji Seketeli Hash a class declaration the same as its definition * src/abg-hash.cc (class_decl::hash::operator()(const class_decl&)): If the class declaration has a definition, hash its definition instead. Otherwise, if the class declaration has no definition, just return a zero hash, like what we were doing before. * src/abg-reader.cc (read_context::maybe_canonicalize_type): Do not early canonicalize method types because most of the time, when this function is called, the method hasn't been added to its parent class yet. So wait until late before canonicalizing. * src/abg-writer.cc (write_class_is_declaration_only): Do not emit the "is-declaration-only" property if the declaration has a definition. (write_class_decl): If the class declaration has a definition, emit the definition instead. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Adjust. * tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-write/test18.xml: Likewise. * tests/data/test-read-write/test20.xml: Likewise. * tests/data/test-read-write/test21.xml: Likewise. 2015-08-20 Dodji Seketeli Add a --stats to abidiff and abidw * 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. 2015-08-19 Dodji Seketeli Canonicalize all types that got scheduled for late canonicalization * src/abg-dwarf-reader.cc (read_context::canonicalize_types_scheduled): Canonicalize all types scheduled for late canonicalization. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust. 2015-08-19 Dodji Seketeli Propagate canonical type of a class definition to its declaration * src/abg-ir.cc: (canonicalize): Propagate the canonical type of the type definition to its declaration. (class_decl::set_definition_of_declaration): Likewise. 2015-08-19 Dodji Seketeli Make type_has_non_canonicalized_subtype() tighter * include/abg-fwd.h (is_typedef, is_pointer_type) (is_reference_type): Declare new overloads. (peel_typedef_type): Renamed get_typedef_underlying_type into this. (peel_pointer_type, peel_reference_type) (peel_typedef_pointer_or_reference_type): Declare new functions. * src/abg-ir.cc (peel_typedef_type): Renamed get_typedef_underlying_type into this. (is_typedef, is_pointer_type, is_reference_type): Define new overloads. (peel_pointer_type, peel_reference_type) (peel_typedef_pointer_or_reference_type): Define new functions. (non_canonicalized_subtype_detector::has_non_canonical_type_): Make the type of this data member be a type_base*, not a bool. This is so that we can return the first non-canonicalized subtype of the type we are looking at. (non_canonicalized_subtype_detector::non_canonicalized_subtype_detector): Adjust the data member initialization. (non_canonicalized_subtype_detector::visit_begin): Add an overload for function_decl*, to avoid looking into non-virtual member functions. In the overload for type_base*, peel typedefs, pointers and reference of each sub-type that has no canonical type, to see if refers to the type we are actually walking. If yes, then keep going. (type_has_non_canonicalized_subtype): Return the non-canonicalized sub-type found. * src/abg-comparison.cc (type_suppression::suppresses_diff): Adjust for the get_typedef_underlying_type -> peel_typedef_type renaming. 2015-08-19 Dodji Seketeli Make decl_base::get_qualified_name() work when decl context changes * include/abg-ir.h (class decl_base): Make class scope_decl a friend of decl_base. (type_base::priv_): Make this protected, rather than private. * src/abg-ir.cc (scope_decl::add_member_decl) (scope_decl::insert_member_decl): Reset the cache of the result of decl_base::get_qualified_name(). * tests/data/test-abidiff/test-PR18791-report0.txt: Adjust. 2015-08-18 Dodji Seketeli Bug 18844 - assert failure in abidw at abg-dwarf-reader.cc:6537 * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Schedule declaration-only class resolution before the class appears as usable as to other types being built. * tests/data/test-read-dwarf/test12-pr18844.so: Add a new binary test input. * tests/data/test-read-dwarf/test12-pr18844.so.abi: The reference ABI XML output for the binary above. * tests/data/Makefile.am: Add the new test inputs above to the source distribution. * tests/test-read-dwarf.cc (in_out_specs): Add the new test inputs above to the set of input this test harness has to run over. 2015-08-18 Dodji Seketeli Fix a little glitch in the test suite * test-read-dwarf.cc (in_out_specs): Emit the output of the test11 to output/test-read-dwarf/test11-pr18828.so.abi, not output/test-read-dwarf/test10-pr18828.so.abi. 2015-08-18 Dodji Seketeli Escape XML property names that were not escaped before * src/abg-writer.cc (write_namespace_decl, write_typedef_decl) (write_var_decl): Escape the XML characters that are forbidden in XML properties, and that are emitted as value of the 'name' property. 2015-08-15 Dodji Seketeli Bug 18828 - Handle force-resolving of multiple declarations-only of the same type * src/abg-dwarf-reader.cc (read_context::resolve_declaration_only_classes): Accept that a class that needs to be force-resolved might have been declared several times. In that case, some instances of that declaration-only class might have already been resolved (or completed). * tests/data/test-read-dwarf/test11-pr18828.so: New binary input. It comes from bug https://sourceware.org/bugzilla/show_bug.cgi?id=18828. * tests/data/test-read-dwarf/test11-pr18828.so.abi: The reference output for the binary above. * tests/data/Makefile.am: Add the test input files above to source distribution. * tests/test-read-dwarf.cc (in_out_specs): Add the test inputs above to the set of input this test harness has to run over. 2015-08-15 Dodji Seketeli Avoid declaring a type several times in the same TU in the XML format * src/abg-writer.cc (write_context::{record_type_id_as_emitted, record_type_as_emitted, type_id_is_emitted, type_is_emitted, clear_emitted_types_map}): New member functions. (write_context::m_emitted_type_id_map): New data member. (write_translation_unit): Clear the per-translation unit map of emitted types. Do not emit a type that has already been emitted in this translation unit. (write_namespace_decl): Do not emit a type that has already been emitted in this translation unit. (write_type_decl, write_qualified_type_def) (write_pointer_type_def, write_reference_type_def) (write_array_type_def, write_typedef_decl, write_class_decl) (write_type_tparameter, write_template_tparameter): Record the type we've just written as having been written out. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust as duplicated declarations got removed. 2015-08-14 Dodji Seketeli Misc style fixes in the XMLABI writer * src/abg-writer.cc (write_context): Align data members. (write_translation_unit): Remove useless horizontal white spaces. (write_decl, write_qualified_type_def, write_pointer_type_def) (write_reference_type_def, write_array_type_def) (write_enum_type_decl, write_typedef_decl, write_class_decl) (write_type_tparameter): Use the *_sptr typedefs rather than the longer form of shared_ptr in function signatures. (write_enum_type_decl): In this function in particular, indent a line properly. 2015-08-14 Dodji Seketeli Fix typos in abipkgdiff * tools/abipkgdiff.cc (display_usage): s/pompare/compare. Give a better help message for --help. (extract_rpm): Insert a space after the path of the package being extracted, when emitting a verbose message. 2015-08-14 Dodji Seketeli 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. 2015-08-12 Dodji Seketeli Bug 18818 - abidw aborts on a class with a non-complete base class * src/abg-dwarf-reader.cc (read_context::decl_only_classes_to_force_defined_map_): New data member. (read_context::declaration_only_classes_to_force_defined): New accessors. (read_context::schedule_declaration_only_class_for_forced_resolution): New member function. (build_class_type_and_add_to_ir): If a base class is a declaration-only class then mark it as needing to be force-defined *if* it's still not defined at the end of the abi corpus loading. (read_context::resolve_declaration_only_classes): If declaration-only classes that need to force-defined are present and not defined (when we reach the end of the ABI corpus) then force-define them as empty classes. * tests/data/test-read-dwarf/test10-pr18818-gcc.so: New test binary input file. This comes from a user binary submitted to bug https://sourceware.org/bugzilla/show_bug.cgi?id=18818. The original URL to the binary is https://sourceware.org/bugzilla/attachment.cgi?id=8518. * tests/data/test-read-dwarf/test9-pr18818-clang.so: New binary input file. This comes from the same bug report as above. The original URL to the binary is https://sourceware.org/bugzilla/attachment.cgi?id=8511. * tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: New reference output file. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/Makefile.am: Add the new files above to the source distribution. * tests/test-read-dwarf.cc (in_out_specs): Add the test inputs above the set of tests input this harness has to run over. 2015-08-14 Dodji Seketeli 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. 2015-08-14 Dodji Seketeli Update comment about the supported formats in abipkgdiff * tools/abipkgdiff.cc: Now that .deb packages are supported, say it. 2015-08-14 Dodji Seketeli Make the support of RPM and DEB package formats conditional * config.h.in: Define WITH_DEB and WITH_RPM pre-processor macros. * configure.ac: Add --enable-{rpm,deb} switches. Check for rpm2cpio and cpio programs, unless --disable-rpm was provided. If they are found and if --enable-rpm=auto was provided, then consider that --enable-rpm=yes was provided. In that case, set the WITH_RPM macro to 1. Otherwise, undefine that macro. Similarly, check for dpkg unless --disable-deb was provided. If it's found and if --enable-deb=auto was provided, consider that --enable-deb=yes was provided. In that case, set the WITH_DEB macro to 1. Otherwise, undefine that macro. Define the ENABLE_RPM and ENABLE_DEB conditional automake variables, if the rpm resp. deb support is enabled. Emit a notice about the rpm and deb features being enabled or not, at the end of the configure process. * tests/test-diff-pkg.cc: Include the config.h header. (in_out_spec): Guard rpm tests by the WITH_RPM macro. Similarly, guard deb tests by the WITH_DEB macro. * tools/abipkgdiff.cc: Include the config.h header. (extract_rpm): Guard this function definition with the WITH_RPM macro. (extract_deb): Guard this function definition with the WITH_DEB macro. (extract_package): Guard the handling of rpm packages with the WITH_RPM macro and the handling of deb package with the WITH_DEB macro. If a package not-support package format is encountered, emit an appropriate error message and error out. 2015-08-07 Matthias Klose Add support for .deb files to abipkgdiff * include/abg-tools-utils.h (file_type): Add FILE_TYPE_DEB. * tools/abipkgdiff.cc (extract_deb): New. (extract_package, main): Handle FILE_TYPE_DEB. * src/abg-tools-utils.cc (operator<<): Handle FILE_TYPE_DEB. (guess_file_type): Detect FILE_TYPE_DEB. * tools/abidiff.cc (main): Handle FILE_TYPE_DEB. * tools/abilint.cc (main): Handle FILE_TYPE_DEB. * tests/data/test-diff-pkg/libsigc++-2.0-0c2a-dbgsym_2.4.0-1_amd64.ddeb: Input debian debug info package; to be compared by the test harness runtestdiffpkg. * tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64.deb: Input debian package; to be compared by the test harness runtestdiffpkg. * tests/data/test-diff-pkg/libsigc++-2.0-0v5-dbgsym_2.4.1-1ubuntu2_amd64.ddeb: Input debug info package * tests/data/test-diff-pkg/libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64.deb: Input debian package; to be compared by the test harness runtestdiffpkg. * tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt: Reference output for the comparison of the packages above. * tests/data/Makefile.am: Add the new files above to the source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the input packages above to the set of files to be compared by this test harness. 2015-08-14 Dodji Seketeli Add configure check for rm and mkdir used by abipkgdiff * configure.ac: Add configure checks for rm and mkdir used by abipkgdiff. 2015-08-14 Dodji Seketeli Fix a comment in configure.ac * configure.ac: Fix a comment. 2015-08-14 Dodji Seketeli Do not remove api and website source files by accident * 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. 2015-08-13 Dodji Seketeli 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. 2015-08-13 Dodji Seketeli Add -h and -d option shortcuts to abidw * 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. 2015-08-13 Dodji Seketeli Add a -h option shortcut to abidiff * 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. 2015-08-13 Dodji Seketeli 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. 2015-08-09 Dodji Seketeli Bug 18791 - libabigail fails to read the output of abidw * src/abg-reader.cc (read_context::get_scope_for_node): Take an access_specifier output parameter to set the access specifier of the current node in its scope. Update the function to set the access_specifier. (read_context::build_or_get_type_decl): Adjust to set the access specifier of the type we are building, in case it's a member type. * tests/data/test-abidiff/test-PR18791-v{0,1}.so.abi: New test input files. * tests/data/test-abidiff/test-PR18791-report0.txt: New test output reference. * tests/data/Makefile.am: Add the new test material to the source distribution. * tests/test-abidiff.cc (specs): Add the new test inputs to the set of input files this test harness has to run over. 2015-08-09 Dodji Seketeli Fix a thinko in language support de-serialization * src/abg-ir.cc (string_to_translation_unit_language): Fix thinko. What was I thinking ... 2015-08-06 Dodji Seketeli Add --no-added-syms to abipkgdiff * 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. fixup! Add --no-added-syms to abipkgdiff 2015-08-06 Dodji Seketeli Update diff stats when added symbols are removed from change report * include/abg-comparison.h (diff_context_wptr) (corpus_diff::diff_stats_sptr): New typedefs. (corpus_diff::diff_stats::diff_stats): Make this constructor take a diff_context_sptr. Make the default constructor private. * src/abg-comparison.cc (corpus_diff::diff_stats::priv::ctxt_): New data member. This is a weak pointer to a diff_context. (corpus_diff::diff_stats::priv::priv): Take a diff_context_sptr and initialize the weak pointer ctxt_ to it. (corpus_diff::diff_stats::priv::ctxt): New accessor to the diff_context hold by the diff_stats. (corpus_diff::diff_stats::{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}): If the user asked for the added [or removed] variables/functions/symbols to be ignored, the accessors for the number of filtered added/removed variables/functions/symbols return the total number of added/removed variables/functions/symbols; that is, say that *all* added/removed variables/functions/symbols got filtered out. (corpus_diff::priv::diff_stats_): Turn this data member into a [shared] pointer to diff_stats. (corpus_diff::priv::filters_and_suppr_applied_): Remove this data member. Now that diff_stats_ is a pointer, we don't need this boolean anymore. (corpus_diff::apply_filters_and_suppressions_before_reporting): Adjust to the fact that filters_and_suppr_applied_ is gone, and that diff_stats_ is now a pointer. (corpus_diff::report): Control un-referenced added symbols reporting with diff_context::show_added_symbols_unreferenced_by_debug_info() 2015-07-31 Dodji Seketeli Make applying supp specs through pointer access look through typedefs * include/abg-comparison.h (type_suppression::suppresses_type): Declare new member function. (get_typedef_diff_underlying_type_diff): Declare new function. * include/abg-fwd.h (get_typedef_underlying_type): Likewise. * src/abg-comparison.cc (type_suppression::suppresses_type): Define new member function. (get_typedef_diff_underlying_type_diff): Define new function. (type_suppression::suppresses_diff): After looking through the different kind of access methods, use the new type_suppression::suppresses_type(), rather than doing lots of stuff ourselves here. But then, if the suppression doesn't apply to the subjects of the diff, look through typedefs and try to apply the suppression again. * src/abg-ir.cc (get_typedef_underlying_type): Define new function. * tests/data/test-diff-suppr/libtest25-typedef-v{0,1}.so: New binary test input files. * tests/data/test-diff-suppr/test25-typedef-v{0,1}.c: Source code for the binary test input files above. * tests/data/test-diff-suppr/test25-typedef-report-{0, 1}.txt: New test input files. * tests/data/test-diff-suppr/test25-typedef-suppr-0.txt: New test input file. * tests/data/Makefile.am: Add the new test material to the source distribution. * tests/test-diff-suppr.cc (in_out_specs): Add the test inputs above to the set of test inputs this harness has to run over. 2015-07-24 Dodji Seketeli Make abipkgdiff erase the *parent* directory of temporary files * tools/abipkgdiff.cc (erase_created_temporary_directories_parent): New static function. (compare): After comparison, erase the temporary parent directory as well. 2015-07-24 Dodji Seketeli Make the name of the removed variable section be consistent * src/abg-comparison.cc (corpus_diff::report): Introduce the section of removed variables with the string "Removed variable", rather than with the string "Deleted variable". * tests/data/test-abicompat/test2-var-removed-report-0.txt: Adjust. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-0.txt: Likewise. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-3.txt: Likewise. * tests/data/test-diff-suppr/test18-suppr-removed-var-report-5.txt: Likewise. 2015-07-24 Dodji Seketeli Consider default symbol versions when computing added/removed fns/vars * include/abg-corpus.h (corpus::{lookup_function_symbol, lookup_variable_symbol}): Take a elf_symbol::version object, rather than a string representing the version. Add an overload that takes an elf_symbol. * src/abg-corpus.cc (find_symbol_by_version): New static function. (corpus::{lookup_function_symbol, lookup_variable_symbol}): Take a elf_symbol::version object, rather than a string representing the version. Add an overload that takes an elf_symbol. If the looked up symbol has no version and if the corpus contains a symbol with the same name and with a default version, then return that latter symbol if the corpus doesn't contain a symbol with the same name and empty version. * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Adjust. (corpus_diff::priv::ensure_lookup_tables_populated): Before deciding that a symbol has been added, if the symbol has a default version, make sure no symbol with the same name and without version was present in the former corpus. Similarly, before deciding that a symbol has been removed, if the symbol has no version, make sure the latter corpus has no symbol with the same name and with a default version. * tests/data/test-diff-dwarf/test12-report.txt: Adjust. The function should not be considered as added, because its symbol (and version) was already present in the former DSO. 2015-07-24 Dodji Seketeli Fix a thinko in removed variables detection * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): Once we have computed a set of potentially deleted variables that turned out to contain variables that were actually *NOT* deleted, really take these into account by removing these false positives from the set of deleted *variables*. We were trying to delete these from the set deleted *functions*; woops, I guess this was a copy & paste error. 2015-07-24 Dodji Seketeli Fix logic of type_has_non_canonicalized_subtype() * src/abg-ir.cc (type_has_non_canonicalized_subtype): Once the type has been traversed, just test if the visitor has accumulated the 'has_non_canonical_type' property. 2015-07-24 Dodji Seketeli Fix style issues * include/abg-ir.h (struct ir_node_visitor): Fix the wording of the comment of this type. * src/abg-dwarf-reader.cc (build_ir_node_from_die): Fix the filling of the text of the comment of the code that chooses to perform early canonicalizing. 2015-07-24 Dodji Seketeli Adding member type doesn't reset declaration-only-ness of a class * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Adding a new member type shouldn't remove the declaration-only-ness of the class. 2015-07-22 Dodji Seketeli Extract all packages for a given run of abipkgdiff under the same temp dir * tools/abipkgdiff.cc (package::{}): Make the data members be private. Make their names end with an underscore. (package::extracted_package_parent_dir_path): Remove. (package::extracted_package_dir_path): Rename into package::extracted_dir_path_. (package::extracted_packages_parent_dir): New static member function, accessor. (package::package): Adjust to the new names of the data members. Call the new package::extracted_package_parent_dir() static member function to initial the package::extracted_dir_path_ data member. (package::{path, extracted_dir_path, type, is_debug, path_elf_file_sptr_map, debug_info_package}): New accessors for the data members. (package::{erase_extraction_directory, erase_extraction_directories}): Adjust. (erase_created_temporary_directories) (create_maps_of_package_content) (extract_package_and_map_its_content, prepare_packages, compare) (main): Adjust. 2015-07-22 Dodji Seketeli Add a --keep-tmp-files option to abipkgidff * 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. 2015-07-21 Dodji Seketeli Show linkage names in abipkgdiff output * 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. 2015-07-21 Dodji Seketeli 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. 2015-07-21 Dodji Seketeli make abipkgdiff return a proper exit code * 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. 2015-07-21 Dodji Seketeli Fix logic of determining if changes happened in abidiff * tools/abidiff.cc (main): Simplify the logic when determining if the comparison between two corpora yields worthwhile changes. 2015-07-21 Dodji Seketeli Add a new corpus_diff::has_net_changes() entry point * include/abg-comparison.h (corpus_diff::has_net_changes): Declare new member function. * src/abg-comparison.cc (corpus_diff::has_net_changes): Define it. 2015-07-20 Dodji Seketeli Fix type synthesis to fix abicompat weak mode * include/abg-fwd.h (synthesize_type_from_translation_unit): Declare new function. (synthesize_function_type_from_translation_unit): Make the translation_unit parameter non-const because the function needs to bind the life time of the synthesized function to the life time of the translation unit. Make this function be a friend of abigail::ir::translation_unit. (synthesize_function_type_from_translation_unit): * src/abg-ir.cc (translation_unit::priv::synthesized_types_): New data member. (synthesize_type_from_translation_unit): Define new function. (synthesize_function_type_from_translation_unit): Make the translation_unit parameter non-const. If the return is void, then take that in account carefuly. Rather than just looking up the type of parameters and return value, synthesize them too, especially when they are qualified types. Bind the life time of the synthesized function type to the lifetime of the translation unit. * tests/data/test-abicompat/test7-fn-changed-report-1.txt: New test reference output. * tests/test-abicompat.cc (in_out_spec): Run the harness on the exisiting test7-fn-changed-app and libtest7-fn-changed-libapp-v1 but in weak mode this time. 2015-07-20 Dodji Seketeli Clean up the output of abicompat weak mode * tools/abicompat.cc (perform_compat_check_in_weak_mode): Remove disgracious vertical spaces in the wording. * tests/data/test-abicompat/test5-fn-changed-report-0.txt: Adjust. * tests/data/test-abicompat/test6-var-changed-report-0.txt: Adjust. 2015-07-20 Sinny Kumari Display --suppressions|--suppr option in help usage * tools/abipkgdiff.cc (display_usage): Print --suppressions|--suppr option in help usage 2015-07-20 Dodji Seketeli Fix computing the set of exported functions and varible symbols * src/abg-ir.cc (elf_symbol::get_name_and_version_from_id): Always set the version and name of the symbol. * src/abg-corpus.cc (corpus::exported_decls_builder::{keep_wrt_id_of_fns_to_keep, keep_wrt_id_of_vars_to_keep}): Reset the symbol name *and* version before passing it. This is redundant with the fix in elf_symbol::get_name_and_version_from_id() that always set the symbol name and version now, but I felt it makes it easier to understand the fix overall. * tests/data/test-abicompat/libtest7-fn-changed-libapp-v{0,1}.so: New test input binaries. * tests/data/test-abicompat/test7-fn-changed-app: Likewise. * tests/data/test-abicompat/test7-fn-changed-{app, libapp-v0, libapp-v1}.c: Source code of the binary test inputs above. * * tests/data/test-abicompat/test7-fn-changed-{libapp-v0, libapp-v1}.h: Likewise. * tests/data/test-abicompat/test7-fn-changed-report-0.txt: Test input. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-abicompat.cc (int_out_specs): Add the test inputs above to the set of inputs this test harness has to run over. 2015-07-20 Dodji Seketeli Fix the wording of description of abipkgdiff.cc again * tools/abipkgdiff.cc: Fix the wording again. 2015-07-20 Dodji Seketeli Remove use of tmpnam from abilint * include/abg-tools-utils.h (abigail::tools_utils::temp_file): Declare new type. (abigail::tools_utils::temp_file_sptr): New typedef. * src/abg-tools-utils.cc (temp_file::priv): Define new type. (temp_file::{temp_file, is_good, get_path, get_stream, create}): Define new member functions. * tools/abilint.cc (main): Do not use tmpnam anymore. Use the new abigail::tools_utils::temp_file type instead. 2015-07-20 Dodji Seketeli Try to avoid a race condition when abipkgdiff extracts packages. * include/abg-tools-utils.h (get_random_number) (get_random_number_as_string): Declare new functions. * src/abg-tools-utils.cc (get_random_number) (get_random_number_as_string): Define them. * tools/abipkgdiff.cc (package::extracted_package_parent_dir_path): New data member. (package::package): Initialize package::extracted_package_parent_dir_path to /, with randomname being a random number represented as a string. (extract_rpm): Make sure to create a hierarchy of directories, not just a directory. 2015-07-19 Dodji Seketeli Fix the wording of the description of the abipkgdiff.cc file * tools/abipkgdiff.cc: Fix the wording of the description. 2015-07-19 Dodji Seketeli Fix the --suppressions manual doc for abidiff * doc/manuals/abidiff.rst: Talk about the --suppr shortcut of the --suppressions option. 2015-07-19 Dodji Seketeli On changed fn, show symbol info when name is different from linkage name in C * include/abg-ir.h (translation_unit::language): New enum type. (translation_unit::{get_language, set_language}): Declare new accessors. (translation_unit_language_to_string) (string_to_translation_unit_language, is_c_language) (is_cplus_plus_language): Declare new functions. * src/abg-ir.cc (translation_unit::priv::language_): New data member. (translation_unit::priv::language_): Initialize it. (translation_unit::{set_language, get_language}): Define new member functions. (translation_unit_language_to_string) (string_to_translation_unit_language, is_c_language) (is_cplus_plus_language): Define new functions. * src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): New static function. (build_translation_unit_and_add_to_ir): Read the language of the translation unit. * src/abg-comparison.cc (corpus_diff::report): When reporting a change in a function sub-type, if we are in C language translation unit, if the function name is different from its linkage name, even if the symbol doesn't have any alias, show symbol information. * src/abg-reader.cc (read_translation_unit_from_input): Read the 'language' property of the translation unit, if present. * src/abg-writer.cc (write_translation_unit): Write the 'language' property to the translation unit, if present. * tests/data/test-read-dwarf/test0.abi: Adjust for the new 'language' property of the 'abi-instr' element. * tests/data/test-read-dwarf/test1.abi: Likewise. * tests/data/test-read-dwarf/test2.so.abi: Likewise. * tests/data/test-read-dwarf/test3.so.abi: Likewise. * tests/data/test-read-dwarf/test4.so.abi: Likewise. * tests/data/test-read-dwarf/test5.o.abi: Likewise. * tests/data/test-read-dwarf/test6.so.abi: Likewise. * tests/data/test-read-dwarf/test7.so.abi: Likewise. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Likewise. 2015-07-19 Dodji Seketeli 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. 2015-07-18 Dodji Seketeli Support file_name_regexp and soname_regexp in supp-specs * 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. 2015-07-18 Dodji Seketeli Fix possible crash in suppression evaluation * src/abg-comparison.cc (type_suppression::suppresses_diff): When evaluating the reach_kind property, do not crash on diff nodes that are pointer_diff or reference_diff to something else but a type diff. 2015-07-17 Dodji Seketeli 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. 2015-07-17 Dodji Seketeli Fix the --verbose option * tools/abipkgdiff.cc (compare): In the elf_file overload, do not emit an error message when a binary could not be analyzed unless --verbose was provided. 2015-07-16 Dodji Seketeli Cleanup the output for added/removed binaries * tools/abipkgdiff.cc (compare): In the overload for packages, indent the content of the "Removed binaries" and "Added binaries" paragraphs. 2015-07-16 Dodji Seketeli Avoid redundant diff report messages by default. * 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. 2015-07-16 Dodji Seketeli Support comparing only shared libraries * 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. 2015-07-15 Dodji Seketeli Comment functions and types of abipkgdiff * src/abg-dwarf-reader.cc (get_soname_of_elf_file): Better wording of the apidoc of this function. * tools/abipkgdiff.cc (verbose, elf_file_paths): Add apidoc for these global variables. (struct options, ): Add apidoc for these types. (options::{erase_extraction_directory, erase_extraction_directories}, display_usage, extract_rpm) (erase_created_temporary_directories, extract_package) (file_tree_walker_callback_fn, compare) (create_maps_of_package_content) (extract_package_and_map_its_content, prepare_packages, compare) (parse_command_line): Add apidoc for these functions. 2015-07-16 Sinny Kumari Add regression tests for abipkgdiff tool * tests/Makefile.am: Build new runtestdiffpkg regression test * tests/data/Makefile.am: Add new test files to source * tests/data/test-diff-pkg/dbus-glib-0.104-3.fc23.x86_64.rpm: Test data for abipkgdiff tool * tests/data/test-diff-pkg/dbus-glib-0.80-3.fc12.x86_64.rpm: Likewise * tests/data/test-diff-pkg/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm: Likewise * tests/data/test-diff-pkg/dbus-glib-debuginfo-0.80-3.fc12.x86_64.rpm: Likewise * tests/data/test-diff-pkg/test-rpm-report-0.txt: Expected test output * tests/data/test-diff-pkg/test-rpm-report-1.txt: Likewise * tests/data/test-diff-pkg/test-rpm-report-2.txt: Likewise * tests/data/test-diff-pkg/test-rpm-report-3.txt: Likewise * tests/data/test-diff-pkg/test-rpm-report-4.txt: Likewise * tests/test-diff-pkg.cc: New file 2015-07-15 Dodji Seketeli 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. 2015-07-15 Dodji Seketeli Comment functions and types of abipkgdiff * src/abg-dwarf-reader.cc (get_soname_of_elf_file): Better wording of the apidoc of this function. * tools/abipkgdiff.cc (verbose, elf_file_paths): Add apidoc for these global variables. (struct options, ): Add apidoc for these types. (options::{erase_extraction_directory, erase_extraction_directories}, display_usage, extract_rpm) (erase_created_temporary_directories, extract_package) (file_tree_walker_callback_fn, compare) (create_maps_of_package_content) (extract_package_and_map_its_content, prepare_packages, compare) (parse_command_line): Add apidoc for these functions. 2015-07-15 Dodji Seketeli Various style fixes * abipkgdiff.cc (get_soname_of_elf_file): Fix spacing. * tools/abipkgdiff.cc (elf_file_paths): Make this global variable static. (extract_rpm): Rename parameter pkg_path name into package_path. 2015-07-15 Dodji Seketeli Remove the last direct fiddling with ELF from abipkgdiff.cc * abg-dwarf-reader.h (enum elf_type): Move this declaration here from abipkgdiff.cc to here. (get_type_of_elf_file): Declare this new function. (get_soname_from_elf): Change this to take a path to the elf file rather than a Elf* handler. So now to use this, the user doesn't have to get her hand dirty with elfutils. * src/abg-dwarf-reader.cc (get_soname_from_elf): Change this to take a path to the elf file rather than a Elf* handler. (elf_file_type): Move this static function here, from abipkgdiff.cc. (get_type_of_elf_file): New function. This has been factorized out of create_maps_of_package_content() in abipkgdiff.cc. * tools/abipkgdiff.cc (class elf_file): Changed struct elf_file into this. Make the default constructor private. (elf_file::elf_file): Change the constructor to just take the path to the elf_file. The base name, soname and elf file type are now computed from the path file, in the constructor. This makes instantiation much much easier from the point of view of the user of the type. (struct abi_diff): Renamed struct abi_changes into this. (abi_diff::has_changes): Define new member function. (abi_diffs): Remove this global variable. (package::package): Remove the elf file type from the set of parameters of this constructor. Rather, compute that elf file type from the path to the elf file, in the constructor. Again, this eases the use of the type. (elf_file_type): Remove this from here, as it got moved to abg-dwarf-reader.cc. (compare): In the elf_file overload, return true if the comparison yields ABI changes. (create_maps_of_package_content): Do not fiddle with elfutils stuff here. Rather, just instantiate elf_file and the analyzing of the file magically happens. (compare): Make the package overload take an abi_diff as output parameter, rather than populating a global variable in return. (compare): Add an other overload for package that doesn't take the abi_diff as output parameter and write it in terms of the previous one. (main): Adjust as the instantiation of package is now simpler. 2015-07-08 Dodji Seketeli Add a --verbose option to abipkgdiff * tools/abipkgdiff.cc (verbose): Add a new global variable. (package::erase_extraction_directory, extract_rpm, compare) (create_maps_of_package_content): Emit verbose information. (parse_command_line): Parse the --verbose option. 2015-07-08 Dodji Seketeli Use the library to implement ABI comparison in abipkgdiff * tools/abipkgdiff.cc (compare): In the overload for elf_file, use abigail::comparison::compute_diff() to compare the ABI of two corpora. The corpora themselves is read using abigail::dwarf_reader::read_corpus_from_elf(). This cleans up the output of the tool because nothing is emitted to standard output if the two ABI corpora compares equal. 2015-07-08 Dodji Seketeli Fix several string passing issues in abipkgdiff.cc * tools/abipkgdiff.cc (elf_file::elf_file): Pass the strings by reference. Also, change the order of the parameters; all the strings are passed first, then the elf_type is passed last. (package::package): Likewise, pass the strings by reference, not by value. (create_maps_of_package_content): Adjust for the change in parameters order of elf_file::elf_file. 2015-07-08 Dodji Seketeli Only try to compare DSOs or executable binaries in abipkgdiff * tools/abipkgdiff.cc (compare): In the overload for packages, only compare binaries that are DSO or executable. 2015-07-08 Dodji Seketeli Avoid flushing the output stream in abipkgdiff.cc * tools/abipkgdiff.cc (extract_package) (create_maps_of_package_content, compare, main): Avoid flushing the output stream arbitrarily. 2015-07-08 Sinny Kumari Move get_soname() function to abg-dwarf-reader.h/cc * include/abg-dwarf-reader.h (get_soname_from_elf): Declare new function * src/abg-dwarf-reader.cc (get_soname_from_elf): Define new function * tools/abipkgdiff.cc (get_soname): Remove function (pkg_diff): Call get_soname_from_elf() instead of get_soname() 2015-07-07 Dodji Seketeli Important organizational changes in abipkgdiff.cc * Avoid using shortened names when the line is not too long. * Use shared_ptr when possible. * When a function parameter is not meant to be nil, do not pass it as a pointer; rather, pass it as a reference. * Avoid doing things that can "fail" in a destructor; e.g, spawning a process. Also, it's not common practise to cleanup a resource in a type destructor, when that resource has not been created in one of the member functions of the type. It eases maintenance when resource creation and cleanup is performed at the same logical level. * tools/abipkgdiff.cc (option::package{1,2}): Rename option::pkg{1,2} into this, to increase legibility. (option::debug_package{1,2}): Likewise, rename option::debug_pkg{1,2} into this. (elf_file::~elf_file): Do not "delete this" in a destructor. This leads to double free. It's when someone invokes the "delete" operator on a pointer to the object that the destructor of the object is executed automatically; so if in the destructor the delete operator is called again, bad things are going to happen. As the destructor is now empty, remove it altogether. (elf_file_sptr): New typedef for shared_ptr. (package::path): Rename package::pkg_path into this, for better legibility. (package::extracted_package_dir_path): Rename package::extracted_pkg_dir_path into this. (package::type): Rename package::pkg_type into this. (package::is_debug_info): Rename package::is_debuginfo_pkg into this. (package::path_elf_file_sptr_map): Rename package::dir_elf_files_map into this because this is a map of path -> elf_file_sptr. Also, now the value of the map element is a elf_file_sptr, no more an elf_file*. (package::debug_info_package): Rename package::debuginfo_pkg into this. (package::package): Adjust for the changes above. (package::{erase_extraction_directory, erase_extraction_directories}): New member functions. (elf_file_paths): Renamed dir_elf_files_path into this. (erase_created_temporary_directories) (create_maps_of_package_content) (extract_package_and_map_its_content, prepare_packages): New static functions. (get_soname, elf_file_type, extract_rpm): Make this static. (extract_package): Take a const package& rather than a package_sptr to express that the function really expects a non-nil object by reference (not by copy) and that the object won't be modified. Using a reference removes the possibility that the pointer could be nil, causing crashes in the code where parameter->something was used. Now only parameter.something can be used, so no crash possible there. This is more solid code. (file_tree_walker_callback_fn): Rename callback() into this. It makes the code more legible and kind of 'self-documented'. At least you get the hint that this is a callback function for some file tree walking (ftw) function. Adjust for the relevant names renaming above. (compare): Rename compute_abidiff into this; again, this increases legibility; at least at the point of use of this function. Rename compare_package() into a an overload of compare() as well. compare_package() used to take a vector of packages. It was hard to guess by reading the signature of the function, which element of the vector is expected to be the first vector of the comparison, which one is to be the second, etc. Now, this function takes two packages, named first_package and second_package. That is more "typed"; that is, the signature is more meaningful. Greater legibility, hopefully. And in the body of the function, the debug information packages are now accessed using the package::debug_info_package data member. Again, this is less surprising, I believe. Also, explicitly erase the temporary files that were created during this comparison. All this simplifies the logic of this function, hopefully. (parse_command_line): Make this static. Add new --d1 and --d2 command line switches that are shortcuts of --debug-info-pkg1 and --debug-info-pkg2. Adjust this function for the relevant name changes above. Make lines be shorter than 80 characters. (main): Do not create any vector of parameters anymore as the compare_packages() function don't take any vector of parameter anymore. Just instantiate first_package and second_package now. Adjust for the relevant name changes above. This hopefully simplifies the logic of this function. 2015-07-06 Dodji Seketeli Wording fixes in abipkgdiff.cc * tools/abipkgdiff.cc (extract_package): Renamed extract_pkg into this because shortening 'package' into 'pkg' provides no legibility improvement. (compare_packages): Renamed pkg_diff() into this, so that the name of the function starts with a verb, and the shortened 'pkg' word is renamed back to the 'package' word. This way, the code almost reads like normal English sentences with verbs and complement, thus enhancing legibility and easing latter maintenance. (main): Adjust for the changes above. 2015-07-06 Dodji Seketeli Re-indent tools/abipkgdiff.cc * tools/abipkgdiff.cc: Re-indent the file properly and fix some white spacing here and there. 2015-07-06 Dodji Seketeli Some slight typo and wording fixes in abipkgdiff * tools/abipkgdiff.cc (display_usage): Fixed the typo in 'bi-pacakge.' Also, refer to 'package', not to 'bi-package' that is surprising to the user at first. (compute_abidiff): Shorten the size of the introductory line. 2015-07-03 Dodji Seketeli Remove names of unused variables in callback() * tools/abipkgdiff.cc (callback): Remove the name of parameters st and flag. 2015-07-03 Dodji Seketeli Remove useless const from the declaration of extract_rpm() * tools/abipkgdiff.cc (extract_rpm): Remove useless const qualifier. 2015-07-03 Dodji Seketeli End all branches of get_soname() finish with a return statement * tools/abipkgdiff.cc (get_soname): Have just one return statement at the end of this function. 2015-07-03 Dodji Seketeli Fix abipkgdiff compilation issues * tools/abipkgdiff.cc (elf_file::elf_file): Initialize data member in the same order as they were declared. (package::package): Likewise. 2015-06-19 Sinny Kumari Exclude processing symlink, display removed/added binaries between two packages * tools/abipkgdiff.cc (abi_changes): Declare new struct (callback): Exclude symbloic link file for durther processing (compute_abidiff): Consider SONAME if exists as key in map instead of binary name, else binary as key. Also, print if removed/added binaries exist between packages 2015-06-09 Sinny Kumari Stdout ABI changes if same binary found in both package * tools/abipkgdiff.cc (compute_abidiff): New function tools/abipkgdiff.cc (pkg_diff): Iterate through list of binaries in both package directory and call compute_diff function if same binary found in both file. tools/abipkgdiff.cc (main): Also consider debug-info directories avilable in debu-info packages. 2015-06-02 Sinny Kumari Save ELF files, their type and SONAME if exist for extracted packages * tools/abipkgdiff.cc (elf_type): Declare new enum (elf_file): Declare new struct (package): Add member variable dir_elf_files_map (get_soname): Define new function (elf_file_type): Define new function (extract_rpm): Iterate over extracted directory files and filter ELF binary files along with their information like name, soname, elf_type and save in dir_elf_files_map 2015-05-26 Sinny Kumari Extract packages(RPMs) into temporary directories for further processing * tools/abipkgdiff.cc (struct package): Declare new struct (package_sptr): Declare shared_ptr for struct package (extract_rpm): Define new fuction to extract rpm package (extract_pkg): Define new function to extract pacakge (pkg_diff): Define new function to get ABI diff between two packages (main): Create new object of type pacakge for each binary and debuginfo pacakge passed in commandline options 2015-05-21 Sinny Kumari Guess RPM file type * include/abg-tools-utils.h (file_type): Added member FILE_TYPE_RPM and FILE_TYPE_SRPM (operator<<): New function declaration. * src/abg-tools-utils.cc (file_type): Detect RPM and SRPM file type (operator<<): New function definition * tools/abidiff.cc (main): Check for RPM and SRPM file type as well. * tools/abilint.cci (main): Check for RPM and SRPM file type as well. * tools/abipkgdiff.cc (main): Check whether input files to abipkgdiff are valid RPM files or not. 2015-05-19 Sinny Kumari Initial skeleton of abipkgdiff tool * tools/Makefile.am: Include abipkgdiff.cc in compilation and generate abipkgdiff binary. * tools/abipkgdiff.cc: New file 2015-07-16 Dodji Seketeli Support reading binaries that do not have a symbol table * src/abg-dwarf-reader.cc (read_context::find_symbol_table_section): Allow returning a nil pointer to symbol table. (read_context::lookup_elf_symbol_from_index): Return an empty elf symbol if we got a nil pointer to symbol table. (read_context::load_symbol_maps): If no symbol table is found then consider that the symbol maps loading failed. 2015-07-16 Dodji Seketeli Remove extra vertical spaces from diff report * src/abg-comparison.cc (class_diff::report): Do not emit new line unless the diff is to be reported. * tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: Adjust. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-0.txt: Adjust. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt: : Adjust. 2015-07-09 Dodji Seketeli Allow null types in type comparison again * src/abg-comparison.cc (compute_diff): In the overload of type_base_sptr accept nil types. 2015-07-08 Dodji Seketeli Handle the life time of the map of canonical types * include/abg-ir.h (type_base::canonical_types_map_type): Move this typedef into abg-ir.cc and out of the type_base namespace. (type_base::get_canonical_types_map): Likewise. * src/abg-ir.cc (canonical_types_map_type): New typedef that got moved here from type_base::canonical_types_map_type. (get_canonical_types_map): Likewise got moved here from type_base::get_canonical_types_map. Made static in the process. (class usage_watchdog): New type. (usage_watchdog_sptr, usage_watchdog_wptr): New typedefs. (get_usage_watchdog, get_usage_watchdog_wptr, ref_usage_watchdog) (maybe_cleanup_type_system_data): New static functions. (translation_unit::priv::usage_watchdog_): Add new data member. (translation_unit::priv::priv): Get a reference on the usage watchdog. (translation_unit::priv::~priv): If the usage watchdog says that the type system is not used, then cleanup the global data logically owned by the type system. * include/abg-dwarf-reader.h (read_corpus_from_elf): Make this return a corpus and set the status by reference using a parameter. * src/abg-dwarf-reader.cc (read_corpus_from_elf): Implement the above. * include/abg-reader.h (read_translation_unit_from_file) (read_translation_unit_from_buffer) (read_translation_unit_from_istream): Remove the overloads that do not return a translation_unit_sptr and that pass it as a parameter. Only keep the overloads that return a translation_unit_sptr, forcing users of the API to own a proper reference on the resulting translation_unit pointer. That is important to handle the life time of the global data of the type system that need to be cleared when the last translation unit is de-allocated. * src/abg-reader.cc (read_translation_unit_from_input): Make this return a translation_unit_sptr. (read_translation_unit_from_file) (read_translation_unit_from_buffer) (read_translation_unit_from_istream): Remove the overloads that do not return a translation_unit_sptr and that pass it as a parameter. Only keep the overloads that return a translation_unit_sptr. (read_to_translation_unit): Make this return a translation_unit_sptr. * tests/print-diff-tree.cc (main): Adjust. * tests/test-diff-dwarf.cc (main): Likewise. * tests/test-ir-walker.cc (main): Likewise. * tests/test-read-dwarf.cc (main): Likewise. * tests/test-read-write.cc (main): Likewise. * tools/abicompat.cc (main): Likewise. * tools/abidiff.cc (main): Likewise. * tools/abidw.cc (main): Likewise. * tools/abilint.cc (main): Likewise. 2015-07-08 Dodji Seketeli Add --d{1,2} shortcut options for --debug-info-dir{1,2} in abidiff * tools/abidiff.cc (display_usage): Add the --d{1,2} to the help strings. (parse_command_line): Parse the new --d1 and --d2 options. 2015-07-08 Dodji Seketeli Factorize incompatible and subtype changes detection * include/abg-comparison.h (corpus_diff::{has_incompatible_changes, has_net_subtype_changes}): Declare new member functions. * src/abg-comparison.cc (corpus_diff::{has_incompatible_changes, has_net_subtype_changes}): Define them. * abidiff.cc (main): Use the new member functions above. 2015-07-09 Dodji Seketeli Adjust some tests for output changes * tests/data/test-abidiff/test-struct1-report.txt: Adjust. * tests/data/test-diff-dwarf/test10-report.txt: Likewise. * tests/data/test-diff-dwarf/test11-report.txt: Likewise. * tests/data/test-diff-dwarf/test13-report.txt: Likewise. * tests/data/test-diff-filter/test2-report.txt: Likewise. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-0.txt: Likewise. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-1.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt: Likewise. 2015-07-06 Dodji Seketeli Fix missing newlines in diff report * src/abg-comparison.cc (class_diff::report): The overload of represent() for instances of var_decl does not emit new lines. So the caller must ensure a new line is emitted. 2015-07-02 Dodji Seketeli Support filtering out just one alias of a function * 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. 2015-07-01 Dodji Seketeli Complete apidoc * src/abg-ir.cc (elf_symbol::get_aliases_id_string): Finish the incomplete apidoc for this member function. 2015-07-01 Dodji Seketeli Show aliases of functions with changed sub-types * include/abg-ir.h (elf_symbol::get_aliases_id_string): Declare new overload. * src/abg-ir.cc (elf_symbol::get_aliases_id_string): Define new overload. * src/abg-comparison.cc (corpus_diff::report): For functions with sub-type changes report their aliases. Do not do this if the function is a constructor or destructor because these almost always have aliases, at least with GCC and the developer most certainly has not done anything special for that; she would thus be uselessly surprised by that remote implementation detail. * tests/data/test-diff-dwarf/test5-report.txt: Adjust test. 2015-06-25 Dodji Seketeli Update ChangeLog file * ChangeLog: Update automatically using 'make update-changelog'. 2015-06-23 Dodji Seketeli Misc typo fixes * src/abg-comparison.cc (corpus_diff::priv::{deleted, added}n_variable_is_suppressed): Fix a typo. * tests/data/test-diff-dwarf/test16-syms-only-v0.cc: Fix a typo in the comments. * tests/data/test-diff-dwarf/test16-syms-only-v1.cc: Likewise. 2015-06-22 Dodji Seketeli Apply suppression specifications to added and removed functions and variables * 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. 2015-06-22 Dodji Seketeli Do not compare static data members when comparing types * include/abg-ir.h (class_decl::get_non_static_data_members): Declare new data members. * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Only look at non-static data members. (compute_diff): In the overload for class_decl, only compare non-static data members. * src/abg-hash.cc (class_decl::hash::operator()): Do not hash static data members members hashing a class_decl. * src/abg-ir.cc (class_decl::priv::data_members_): New data member. (class_decl::priv::priv): When initializing data members, store the non-static data members on the side, in the new class_decl::priv::non_static_data_members_ data member. (class_decl::get_non_static_data_members): Define member function. (class_decl::add_data_member): Store the non-static data members on the side in class_decl::priv::non_static_data_members_. (equals): In the overload for class_decl, do not take in account static data members when running the comparison. * tests/data/test-diff-dwarf/test7-report.txt: Adjust. * tests/data/test-diff-filter/test12-report.txt: Adjust. 2015-06-23 Dodji Seketeli Add a --suppr short alias to the --suppressions option of abidiff * tools/abidiff.cc (display_usage): Add a help string for the new --suppr option. (parse_command_line): Support the --suppr option which is an alias for --suppressions. 2015-06-23 Dodji Seketeli Enable large file support * configure.ac: Call the AC_SYS_LARGEFILE autoconf macro. * config.h.in: Update. 2015-06-23 Dodji Seketeli Do not build zip archive support by default * configure.ac: By default, unconditionally disable the zip-archive support. 2015-06-23 Dodji Seketeli Put the man pages of the binaries in section 1 * 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. 2015-06-23 Dodji Seketeli Sort deleted/added variables and symbols before emitting report * src/abg-comparison.cc (sort_string_var_ptr_map) (sort_string_elf_symbol_map): Define new static functions. (var_comp, elf_symbol_comp): Define new comparison functors. (corpus_diff::report): Sort the deleted variables, added variables, deleted function symbols, added function symbols, deleted variable symbols, and added variable symbols before walking them to emit reports. 2015-06-23 Dodji Seketeli Remove useless white space * src/abg-comparison.cc (sort_string_parm_map): Remove trailing white space from comment. 2015-06-23 Dodji Seketeli Bug 18580 - abidw ignores --out-file * tools/abidw.cc (main): Take the argument of --out-file into account when emitting the serialized form of the ABI. 2015-06-23 Dodji Seketeli Fix a thinko in the comparison code * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Ensure that when a member function is wrongly considered as being added, then either the new member function doesn't have a symbol name (linkage name) or it has one, and it was already present in the first version of the binary. # Veuillez saisir le message de validation pour vos modifications. Les lignes # commençant par '#' seront ignorées, et un message vide abandonne la validation. # Sur la branche fix-master # Votre branche est à jour avec 'origin/master'. # # Modifications qui seront validées : # modified: src/abg-comparison.cc # # Modifications qui ne seront pas validées : # modified: tools/abidw.cc # # Fichiers non suivis: # abidw.abi # build/ # depcomp # missing # patch-edited.txt # patch.txt # prtests/ # test-driver # # ------------------------ >8 ------------------------ # Ne touchez pas à la ligne ci-dessus # Tout se qui suit sera éliminé. diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index 14208f5..ef7c6c9 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -7419,8 +7419,8 @@ class_diff::ensure_lookup_tables_populated(void) const inserted_member_fns().begin(); i != inserted_member_fns().end(); ++i) - if (i->second->get_symbol() - && f->lookup_function_symbol(i->second->get_symbol()->get_name(), + if (!i->second->get_symbol() + || f->lookup_function_symbol(i->second->get_symbol()->get_name(), i->second->get_symbol()->get_version().str())) to_delete.push_back(i->first); 2015-06-07 Dodji Seketeli Build libabigail tests with position-independent code * tests/Makefile.am: Add -fPIC to the compile flags. 2015-06-07 Dodji Seketeli Build libabigail tools as position-independent code * tools/Makefile.am: Compile the binaries here with -fPIC. Note that the library libabigail.la is built with libtool which already takes care of this, so no need to worry about this for libabigail.la. 2015-06-07 Dodji Seketeli Update ChangeLog file * ChangeLog: Update this automatically by typing make update-changelog. 2015-06-07 Dodji Seketeli Avoid infinite loop in elf_symbol::get_alias_from_name() * src/abg-ir.cc (elf_symbol::get_alias_from_name) (elf_symbol::get_alias_which_equals): Test for the next alias pointing to the main symbol, in the loop exit condition. 2015-06-04 Dodji Seketeli Change the linkage name only when necessary * include/abg-ir.h (elf_symbol::get_alias_from_name): Declare new member function. * src/abg-ir.cc (elf_symbol::get_alias_from_name): Define it. * src/abg-dwarf-reader.cc (build_var_decl, build_function_decl): Once the linkage name is supposed to contain the value of the DW_AT_linkage_name attribute, set it the name of the underlying symbol only if value of DW_At_linkage_name is missing or different from the names of all the aliases of the underlying symbol. * tests/data/test-read-dwarf/test2.so.abi: Adjust. 2015-06-04 Dodji Seketeli Various white space cleanups * include/abg-comparison.h: Remove various useless vertical white spaces. * tests/test-diff-dwarf.cc (in_out_spec): Fix indentation of some entries. 2015-06-04 Dodji Seketeli Fix various comments here and there * src/abg-comparison.cc (diff_context::set_or_get_canonical_diff_for, compute_diff) (redundancy_marking_visitor::visit_begin): Fix comment in these functions. * src/abg-ir.cc (elf_symbol::is_variable): Likewise. 2015-06-04 Dodji Seketeli Add missing apidoc to elf_symbol type * src/abg-ir.cc (elf_symbol::{elf_symbol, get_name, set_name, get_type, set_type, get_binding, set_binding, get_version, is_defined, is_public, is_function, is_variable}): Add missing apidoc to these member functions. 2015-06-04 Dodji Seketeli Cleanup logic in class_diff::ensure_lookup_tables_populated() * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Remove the code that tries to lookup allegedly added functions from the set of deleted ones, by using the pretty printed name of the function. Handling the case of a function decl not correctly tied to it symbol is handled my generically a bit later in this function. 2015-06-04 Dodji Seketeli Report possible changes in the set of aliases of a symbol. * src/abg-comparison.cc (function_decl_diff::report): Report a change in the aliases of the symbols of a function; note that everything else but have stayed equal in the function. 2015-06-04 Dodji Seketeli Report vtable changes in top-level function change reports * src/abg-comparison.cc (function_decl_diff::report): Report about virtual-ness and vtable offset changes. * tests/data/test-diff-dwarf/test28-vtable-changes-report-0.txt: New test input file. * tests/data/test-diff-dwarf/test28-vtable-changes-v{0,1}.o: New test input binaries. * tests/data/test-diff-dwarf/test28-vtable-changes-v{0,1}.cc: Source code of the input binaries above. * tests/data/Makefile.am: Add the new test input above to source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test input above to the list of input this test harness has to run over. 2015-06-03 Dodji Seketeli Support new 'accessed_through' suppression property * 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. 2015-06-03 Dodji Seketeli Fix redundancy marking for change of types used directly * include/abg-comparison.h (pointer_map): Make this be a map of {size_t, size_t} pairs, rather than {size_t, bool}, so that each pointer in the map can be associated to another one. (diff_context::diff_has_been_visited): Return the pointer to the first diff node of the equivalence class that has been visited. * src/abg-comparison.cc (is_pointer_diff, is_reference_diff) (is_reference_or_pointer_diff, is_fn_parm_diff, is_base_diff) (is_child_node_of_function_parm_diff, is_child_node_of_base_diff): Define new static functions. (diff_context::diff_has_been_visited): Return the pointer to the first diff node of the equivalence class that has been visited. (diff_context::mark_diff_as_visited): Save the pointer to the first diff node of a given class of equivalence that has been visited. (redundancy_marking_visitor::visit_begin): If a diff node is a child node of a function parameter diff or base diff node and if it's not a pointer or reference diff node, then do not mark it as redundant. Also, make sure to not mark the first diff node of a given class of equivalence that has been visited, as redundant; only the other subsequent nodes should be marked redundant; we were hitting this case because of an optimization that makes equivalent class diff nodes to share their private (pimpl) data. * tests/data/test-diff-filter/test29-finer-redundancy-marking-v{0,1}.o: New test input binaries. * tests/data/test-diff-filter/test29-finer-redundancy-marking-v{0,1}.cc: Source code of the new test input binaries above. * tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt: New test input. * tests/data/Makefile.am: Add the new test material above to the source distribution. * tests/test-diff-filter.cc (in_out_specs): Make this test harness run over the additional test input above. * tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Adjust. 2015-06-02 Dodji Seketeli Fix detection of local changes in base classes * abg-ir.cc (equals): In the overload of class_decl::base_spec, if the underlying class carries changes, then do not flag these changes as local for the class_decl::base_spec. * tests/data/test-diff-dwarf/test27-local-base-diff-v{0,1}.o: New test input binaries. * tests/data/test-diff-dwarf/test27-local-base-diff-v{0,1}.cc: Source code for the test input binaries above. * tests/data/test-diff-dwarf/test27-local-base-diff-report.txt: New test input. * tests/data/Makefile.am: Add the test inputs above to source distribution. 2015-06-02 Dodji Seketeli Fix symbols comparison * include/abg-ir.h (elf_symbol_wptr): New typedef. (elf_symbol): Make the constructors and assignment operator private. The type can neither be copied nor created with the new operator. (elf_symbol::create): New static member function. (elf_symbol::{get_main_symbol, get_next_alias, add_alias}): Adjust. ( compute_aliases_for_elf_symbol): Likewise. (elf_symbol::operator=): Make this private. (elf_symbol::get_alias_which_equals): Declare new member function. * src/abg-comp-filter.cc (function_name_changed_but_not_symbol): Adjust. * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Adjust. * src/abg-corpus.cc (corpus::priv::build_unreferenced_symbols_tables): Likewise. * include/abg-dwarf-reader.h (lookup_symbol_from_elf) (lookup_public_function_symbol_from_elf): Adjust. * src/abg-dwarf-reader.cc (lookup_symbol_from_sysv_hash_tab) (lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_elf_hash_tab) (lookup_symbol_from_symtab, lookup_symbol_from_elf) (lookup_public_function_symbol_from_elf) (lookup_public_variable_symbol_from_elf): Adjust. (read_context::lookup_elf_symbol_from_index): Likewise. (read_context::lookup_elf_fn_symbol_from_address): Likewise. (read_context::lookup_elf_var_symbol_from_address): Likewise. (read_context::lookup_public_function_symbol_from_elf): Likewise. (read_context::lookup_public_variable_symbol_from_elf): Likewise. (read_context::load_symbol_maps): Likewise. (build_var_decl, build_function_decl): Likewise. * src/abg-ir.cc (elf_symbol::priv::{main_symbol_, next_alias_}): Change the type of these from elf_symbol* to elf_symbol_wptr. (elf_symbol::priv::priv): Adjust. (elf_symbol::{create, get_alias_which_equals}): Define new functions. (textually_equals): Likewise. (elf_symbol::{get_main_symbol, is_main_symbol, get_next_alias, add_alias}): Adjust to return or take elf_symbol_sptr type, rather than a elf_symbol* one. (elf_symbol::{get_aliases_id_string, does_alias}): Adjust. (compute_alias_for_elf_symbol): Likewise. (elf_symbol::operator==): Two symbols A and B are now equal if A has at least one alias that is textually equal to B. (equals): In the overload for function_decls, in the part where we compare the decl_base part of the functions without considering their decl names, we now also omit considering their linkage names, because we compared they symbols before. * tools/abisym.cc (main): Adjust. * tests/data/test-diff-dwarf/test12-report.txt: Adjust. * tests/data/test-diff-dwarf/test12-report.txt: Adjust. * tests/data/test-diff-dwarf/test18-alias-sym-report-0.txt: Adjust. * tests/data/test-diff-dwarf/test8-report.txt: Adjust. * tests/data/test-diff-filter/test10-report.txt: Adjust. * tests/data/test-diff-filter/test13-report.txt: Adjust. * tests/data/test-diff-filter/test2-report.txt: Adjust. * tests/data/test-diff-filter/test20-inline-report-0.txt: Adjust. * tests/data/test-diff-filter/test20-inline-report-1.txt: Adjust. * tests/data/test-diff-filter/test9-report.txt: Adjust. 2015-04-22 Dodji Seketeli Support specifying data member insertion in suppressions * 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. 2015-05-24 Dodji Seketeli Make indexes of function parameters start at 1 * src/abg-ir.cc (function_type::function_type): Starts the index of the parameters at 1, unless the firs parameter is an artificial one, in which case it starts at 0. * tests/data/test-abicompat/test5-fn-changed-report-0.txt: Adjust. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. * tests/data/test-diff-dwarf/test1-report.txt: Adjust. * tests/data/test-diff-dwarf/test10-report.txt: Adjust. * tests/data/test-diff-dwarf/test11-report.txt: Adjust. * tests/data/test-diff-dwarf/test13-report.txt: Adjust. * tests/data/test-diff-dwarf/test15-enum-report.txt: Adjust. * tests/data/test-diff-dwarf/test2-report.txt: Adjust. * tests/data/test-diff-dwarf/test20-add-fn-parm-report-0.txt: Adjust. * tests/data/test-diff-dwarf/test21-redundant-fn-report-0.txt: Adjust. * tests/data/test-diff-dwarf/test22-changed-parm-c-report-0.txt: Adjust. * tests/data/test-diff-dwarf/test24-added-fn-parms-report-0.txt: Adjust. * tests/data/test-diff-dwarf/test25-removed-fn-parms-report-0.txt: Adjust. * tests/data/test-diff-dwarf/test26-added-parms-before-variadic-report.txt: Adjust. * tests/data/test-diff-dwarf/test4-report.txt: Adjust. * tests/data/test-diff-dwarf/test6-report.txt: Adjust. * tests/data/test-diff-dwarf/test7-report.txt: Adjust. * tests/data/test-diff-dwarf/test8-report.txt: Adjust. * tests/data/test-diff-filter/test0-report.txt: Adjust. * tests/data/test-diff-filter/test01-report.txt: Adjust. * tests/data/test-diff-filter/test1-report.txt: Adjust. * tests/data/test-diff-filter/test10-report.txt: Adjust. * tests/data/test-diff-filter/test13-report.txt: Adjust. * tests/data/test-diff-filter/test14-0-report.txt: Adjust. * tests/data/test-diff-filter/test14-1-report.txt: Adjust. * tests/data/test-diff-filter/test16-report-2.txt: Adjust. * tests/data/test-diff-filter/test16-report.txt: Adjust. * tests/data/test-diff-filter/test17-0-report.txt: Adjust. * tests/data/test-diff-filter/test17-1-report.txt: Adjust. * tests/data/test-diff-filter/test18-report.txt: Adjust. * tests/data/test-diff-filter/test19-enum-report-1.txt: Adjust. * tests/data/test-diff-filter/test2-report.txt: Adjust. * tests/data/test-diff-filter/test22-compatible-fns-report-0.txt: Adjust. * tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt: Adjust. * tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: Adjust. * tests/data/test-diff-filter/test25-cyclic-type-report-1.txt: Adjust. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-0.txt: Adjust. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-1.txt: Adjust. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt: Adjust. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt: Adjust. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt: Adjust. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-1.txt: Adjust. * tests/data/test-diff-filter/test3-report.txt: Adjust. * tests/data/test-diff-filter/test9-report.txt: Adjust. * tests/data/test-diff-suppr/test0-type-suppr-report-0.txt: Adjust. * tests/data/test-diff-suppr/test0-type-suppr-report-3.txt: Adjust. * tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Adjust. * tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Adjust. * tests/data/test-diff-suppr/test10-changed-parm-c-report-0.txt: Adjust. * tests/data/test-diff-suppr/test2-struct-suppr-report-0.txt: Adjust. * tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Adjust. * tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Adjust. * tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Adjust. * tests/data/test-diff-suppr/test4-local-suppr-report-0.txt: Adjust. * tests/data/test-diff-suppr/test4-local-suppr-report-1.txt: Adjust. * tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Adjust. * tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: Adjust. * tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: Adjust. * tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: Adjust. * tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: Adjust. * tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: Adjust. * tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: Adjust. * tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: Adjust. * tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: Adjust. * tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: Adjust. * tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: Adjust. * tests/data/test-diff-suppr/test8-redundant-fn-report-1.txt: Adjust. * tests/data/test-diff-suppr/test9-changed-parm-c-report-0.txt: Adjust. * tests/data/test-diff-suppr/test9-changed-parm-c-report-1.txt: Adjust. 2015-05-22 Dodji Seketeli Some wording fixes to doc/manuals/libabigail-concepts.rst * doc/manuals/libabigail-concepts.rst: Some light wording fixes. 2015-05-24 Dodji Seketeli Type read from DWARF don't have alignment information * src/abg-dwarf-reader.cc (build_type_decl) (build_class_type_and_add_to_ir, build_pointer_type_def) (build_reference_type, build_function_decl): Set the alignment for native types, class, reference and function type to zero, effectively meaning that they don't have alignment information. * src/abg-hash.cc (var_decl::hash::operator): Take the hash value of the data member context in account when computing the hash value of a given data member. * tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt: Adjust. * tests/data/test-diff-dwarf/test10-report.txt: Likewise. * tests/data/test-diff-dwarf/test13-report.txt: Likewise. * tests/data/test-diff-dwarf/test22-changed-parm-c-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test26-added-parms-before-variadic-report.txt: Likewise. * tests/data/test-diff-dwarf/test8-report.txt: Likewise. * tests/data/test-diff-dwarf/test9-report.txt: Likewise. * tests/data/test-diff-filter/test13-report.txt: Likewise. * tests/data/test-diff-filter/test6-report.txt: Likewise. * tests/data/test-diff-suppr/test9-changed-parm-c-report-0.txt: Likewise. * tests/data/test-read-dwarf/test0.abi: Likewise. * tests/data/test-read-dwarf/test1.abi: Likewise. * tests/data/test-read-dwarf/test2.so.abi: Likewise. * tests/data/test-read-dwarf/test3.so.abi: Likewise. * tests/data/test-read-dwarf/test4.so.abi: Likewise. * tests/data/test-read-dwarf/test5.o.abi: Likewise. * tests/data/test-read-dwarf/test6.so.abi: Likewise. * tests/data/test-read-dwarf/test7.so.abi: Likewise. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: Likewise. 2015-05-06 Dodji Seketeli Better name ID function parameters * src/abg-ir.cc (function_decl::parameter::get_name_id): Make this be "parameter-". 2015-05-06 Dodji Seketeli Better detection of parameter sub-type changes * include/abg-fwd.h (type_has_sub_type_changes): Declare new function. * src/abg-ir.cc (type_has_sub_type_changes): Define it. * src/abg-comparison.cc (fn_parm_diff::report): Use the new function type_has_sub_type_changes() instead of just looking at name changes. * tests/data/test-diff-dwarf/test4-report.txt: Adjust this reference test output. 2015-05-06 Dodji Seketeli Fix a potential crash when comparing variadic parameters again * src/abg-comparison.cc (redundancy_marking_visitor::visit_begin): Avoid flagging diffs of variadic parameter *types* as redundant as well. 2015-05-06 Dodji Seketeli Add debugging function for function parameters * include/abg-ir.h (function_decl::parameter::get_pretty_representation): Declare new virtual member function. * src/abg-ir.cc (function_decl::parameter::get_pretty_representation): Define it. 2015-05-06 Dodji Seketeli Add comments * src/abg-dwarf-reader.cc (build_function_decl): Add comments when building the function parameters. 2015-05-06 Dodji Seketeli Add a debugging function for type_or_decl_base* * include/abg-fwd.h (get_pretty_representation): Declare new overload for type_or_decl_base*. * src/abg-ir.cc (get_pretty_representation): Define it and express the previous overload for type_or_decl_base_sptr in terms of this new one. 2015-05-05 Dodji Seketeli Return a reference to smart pointer for the void type node * src/abg-ir.h (type_decl::get_void_type_decl): Return a reference to the smart pointer initially returned. * src/abg-ir.cc (type_decl::get_void_type_decl): Likewise. 2015-05-05 Dodji Seketeli Bug 18342 - Segmentation fault while comparing functions with variadic parameters * include/abg-fwd.h (is_array_type): New overload for a naked pointer. * include/abg-ir.h (type_decl::get_variadic_parameter_type_decl): Declare new static function. * src/abg-ir.cc (is_array_type): Define new function overload for naked pointers (type_decl::get_variadic_parameter_type_decl): Define new static function. * src/abg-dwarf-reader.cc (build_function_decl): The type of variadic parameter is now a special type_decl. * include/abg-comparison.h (is_diff_of_variadic_parameter_type) (is_diff_of_variadic_parameter): New function declarations. * src/abg-comparison.cc (is_diff_of_variadic_parameter_type) (is_diff_of_variadic_parameter): Define new functions. (compute_diff): Refuse to return a NULL diff for types. Assert that the parameters are non-NULL. (report_size_and_alignment_changes): We are comparing arrays only if the two parameters are arrays. (fn_parm_diff::fn_parm_diff): Refuse that type diff for this diff node is non empty. (fn_parm_diff::report): Strengthen an assert. Cleanup a comment. (redundancy_marking_visitor::visit_begin): Do not mark function type and variadic parms diff nodes as redundant for local changes. * tests/data/test-diff-dwarf/libtest26-added-parms-before-variadic-v{0,1}.so: New test input binaries. * tests/data/test-diff-dwarf/test26-added-parms-before-variadic-report.txt: New test output reference. * tests/data/test-diff-dwarf/test26-added-parms-before-variadic-v{0,1}.c: Source code of the new test input binaries above. * tests/data/Makefile.am: Add the new test stuff to source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test inputs above to the set of input to run this test harness over. 2015-04-24 Dodji Seketeli Fix archive writing support * configure.ac: Require libzip 0.10.1 at least. * src/abg-writer.cc (archive_write_ctxt::serialized_tus): Make this be a list, rather than a vector. (create_archive_write_context): Truncate the archive if it exists already. (write_translation_unit_to_archive): Do not use the deprecated zip_add() function anymore. Rather, use zip_file_add(). * tests/test-write-read-archive.cc (main): Double check if the translation unit we read is empty or not. 2015-04-22 Dodji Seketeli Use a better wording for the COPYING file * COPYING: Update to a more complete description. 2015-04-20 Dodji Seketeli Update licence texts * COPYING: Of course we know the licence we want to use now :-) * COPYING-GPLV3: Add the text of GPLv3. * Makefile.am: Add the file COPYING-GPLV3 above to source distribution. 2015-04-15 Dodji Seketeli 18252 - Added parameters are not properly sorted * src/abg-comparison.cc (sort_string_parm_map): Define new static function. (struct parm_comp): Define new type. (function_type_diff::priv::{sorted_deleted_parms_, sorted_added_parms_}): New data members that hold sorted deleted/added parameters. (function_type_diff::ensure_lookup_tables_populated): Initialize the two new data members above. (function_type_diff::report): For the report of parameters that got added/removed, use the sorted set of added/removed parameters above. * tests/data/test-diff-dwarf/test24-added-fn-parms-report-0.txt: New test input. * tests/data/test-diff-dwarf/libtest24-added-fn-parms-v{0,1}.so: Likewise. * tests/data/test-diff-dwarf/test25-removed-fn-parms-report-0.txt: Likewise. * tests/data/test-diff-dwarf/libtest25-removed-fn-parms-v{0,1}.so: Likewise. * tests/data/test-diff-dwarf/test24-added-fn-parms-v{0,1}.c: Likewise. * tests/data/test-diff-dwarf/test25-removed-fn-parms-v{0,1}.c: Likewise. * tests/data/Makefile.am: Add the new test material above to the source distribution. 2015-04-14 Dodji Seketeli Misc reporting fixes/improvements * src/abg-comparison.cc (distinct_diff::report): Remove spurious vertical space before reporting size and alignment changes here. (represent): In the variables/data member overload, report type changes first. Then the other changes. (report_size_and_alignment_changes): Make this report array size changes too. Also, make some small adjustments about how type size/alignment changes are introduced. (array_diff::report): Now that report_size_and_alignment_changes() supports size change reporting, just use that function rather than doing it here. (corpus_diff::report): Consistently add a space between each changed function report. Prefix changed variables with a [C], just like for functions. * tests/data/test-abicompat/test0-fn-changed-report-0.txt: Adjust. * tests/data/test-abicompat/test5-fn-changed-report-0.txt: Likewise. * tests/data/test-abicompat/test6-var-changed-report-0.txt: Likewise. * tests/data/test-abidiff/test-qual-type0-report.txt: Likewise. * tests/data/test-abidiff/test-struct0-report.txt: Likewise. * tests/data/test-abidiff/test-struct1-report.txt: Likewise. * tests/data/test-abidiff/test-var0-report.txt: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test0-report.txt: Likewise. * tests/data/test-diff-dwarf/test1-report.txt: Likewise. * tests/data/test-diff-dwarf/test10-report.txt: Likewise. * tests/data/test-diff-dwarf/test11-report.txt: Likewise. * tests/data/test-diff-dwarf/test13-report.txt: Likewise. * tests/data/test-diff-dwarf/test15-enum-report.txt: Likewise. * tests/data/test-diff-dwarf/test2-report.txt: Likewise. * tests/data/test-diff-dwarf/test20-add-fn-parm-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test21-redundant-fn-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test22-changed-parm-c-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test3-report.txt: Likewise. * tests/data/test-diff-dwarf/test6-report.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-filter/test0-report.txt: Likewise. * tests/data/test-diff-filter/test01-report.txt: Likewise. * tests/data/test-diff-filter/test1-report.txt: Likewise. * tests/data/test-diff-filter/test10-report.txt: Likewise. * tests/data/test-diff-filter/test11-report.txt: Likewise. * tests/data/test-diff-filter/test13-report.txt: Likewise. * tests/data/test-diff-filter/test14-0-report.txt: Likewise. * tests/data/test-diff-filter/test14-1-report.txt: Likewise. * tests/data/test-diff-filter/test15-0-report.txt: Likewise. * tests/data/test-diff-filter/test15-1-report.txt: Likewise. * tests/data/test-diff-filter/test16-report-2.txt: Likewise. * tests/data/test-diff-filter/test16-report.txt: Likewise. * tests/data/test-diff-filter/test17-0-report.txt: Likewise. * tests/data/test-diff-filter/test17-1-report.txt: Likewise. * tests/data/test-diff-filter/test18-report.txt: Likewise. * tests/data/test-diff-filter/test19-enum-report-1.txt: Likewise. * tests/data/test-diff-filter/test2-report.txt: Likewise. * tests/data/test-diff-filter/test20-inline-report-1.txt: Likewise. * tests/data/test-diff-filter/test21-compatible-vars-report-0.txt: Likewise. * tests/data/test-diff-filter/test22-compatible-fns-report-0.txt: Likewise. * tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt: Likewise. * tests/data/test-diff-filter/test24-compatible-vars-report-1.txt: Likewise. * tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: Likewise. * tests/data/test-diff-filter/test25-cyclic-type-report-1.txt: Likewise. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-0.txt: Likewise. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-1.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-0.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt: Likewise. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt: Likewise. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt: Likewise. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-1.txt: Likewise. * tests/data/test-diff-filter/test3-report.txt: Likewise. * tests/data/test-diff-filter/test6-report.txt: Likewise. * tests/data/test-diff-filter/test9-report.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test10-changed-parm-c-report-0.txt: Likewise. * tests/data/test-diff-suppr/test2-struct-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test4-local-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test4-local-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-8.txt: Likewise. * tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: Likewise. * tests/data/test-diff-suppr/test8-redundant-fn-report-1.txt: Likewise. * tests/data/test-diff-suppr/test9-changed-parm-c-report-0.txt: Likewise. * tests/data/test-diff-suppr/test9-changed-parm-c-report-1.txt: Likewise. 2015-04-10 Dodji Seketeli Make abidiff and abicompat return meaningful exit codes * 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. 2015-04-01 Dodji Seketeli Add support for abicompat weak mode * 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. 2015-04-01 Dodji Seketeli 18186 - Assertion in abigail::ir::class_decl::hash::operator() * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): When the size of the class is provided then the class is complete, no matter if this function called to update the class or to build it for the first time. 2015-03-31 Sinny Kumari Check if EM_AARCH64, EM_TILEPRO and EM_TILEGX macros are defined in elf.h * config.h.in: Generated autoheader by configure.ac for added macros * configure.ac: Defining HAVE_EM_AARCH64_MACRO, HAVE_EM_TILEPRO_MACRO and HAVE_EM_TILEGX_MACRO to check whether EM_AARCH64, EM_TILEPRO and EM_TILEGX macros are defined in elf.h or not * src/abg-dwarf-reader.cc (e_machine_to_string): Look for EM_AARCH64, EM_TILEPRO and EM_TILEGX macros only if they are defined in elf.h 2015-03-30 Dodji PR libabigail/18180 * src/abg-hash.cc (class_decl::hash::operator()(const class_decl&) const): Return zero only for class declarations that are not resolved. * tests/data/test-read-write/test20.xml: Fix the output to make a class definition to reference its declaration, when there was a forward declaration for it. 2015-03-30 Dodji Seketeli 18179 - abidiff crashes on libcangjie * include/abg-fwd.h (lookup_class_type_in_corpus) (lookup_class_type_in_translation_unit): Declare new functions. * src/abg-ir.cc (lookup_class_type_in_translation_unit): Define new function. (get_node, convert_node_to_decl): Define new specializations for the class_decl type. * src/abg-corpus.cc (lookup_class_type_in_corpus): Define new function. * src/abg-dwarf-reader.cc (read_context::resolve_declaration_only_classes): Lookup class types specifically. 2015-03-30 Dodji Seketeli Forgot to initialize a data member * src/abg-reader.cc (read_context::read_context): Initialize the new m_exported_decls_builder_ data member. 2015-03-30 Dodji Seketeli 18166 - Abidiff fails with internal on Libtirpc ABI in XML format * src/abg-reader.cc (read_context::m_exported_decls_builder_): New data member. (read_context::read_context): Initialize it. (read_context::{type_is_from_translation_unit, get_exported_decls_builder, set_exported_decls_builder, maybe_add_fn_to_exported_decls, maybe_add_fn_to_exported_decls, type_id_new_in_translation_unit}): New member functions. (read_context::clear_per_translation_unit_data): Clear id->xml node map here ... (read_context::clear_per_corpus_data): ... not here. (read_context::walk_xml_node_to_map_type_ids): Only walk the sub-tree we are asked to walk. (read_translation_unit_from_input): Cleanup. (read_corpus_from_input): Wire populating of exported declarations of the current corpus. (build_function_decl, build_var_decl): Populate exported declarations of the current corpus here. (build_type_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_array_type_def, build_enum_type_decl, build_type_decl) (build_template_tparameter): Adjust assert on ID to make sure it's the first type it's being defined in the current translation unit. * tests/data/test-abidiff/test-corpus0-report0.txt: New test reference output. * tests/data/test-abidiff/test-corpus0-v{0,1}.so.abi: New test input. * tests/test-abidiff.cc (specs): Add the test inputs above to the list of inputs over which to run the test harness. (main): Support reading corpora too, as this test harness was reading just translation units before. (tests/data/Makefile.am): Add test material above to source distribution. 2015-03-19 Dodji Seketeli Update the CONTRIBUTING file * CONTRIBUTING: How to check out the web pages. 2015-03-19 Dodji Seketeli Update website documentation * doc/website/mainpage.txt: Update the web page. 2015-03-18 Dodji Seketeli Cleanup type canonicalizing logic * src/abg-ir.cc (type_base::get_canonical_type_for): Cleanup the logic here. Basically since we are not trying to cache the result of type hashing anymore, this can be simpler. 2015-03-18 Dodji Seketeli Fix redundancy propagation on node with filtered local changes *NOT* take in account the categories inherited from its children nodes. That way, it's possible to know if the *local changes* of a given node have been filtered out. * include/abg-comparison.h (diff::{get_local_category, add_to_local_category, add_to_local_and_inherited_categories, remove_from_local_category, set_local_category, is_filtered_out_wrt_non_inherited_categories, has_local_changes_to_be_reported}): Declare new member functions. * src/abg-comp-filter.cc ({harmless, harmful}_filter::{visit, visit_end}): Update local category too. * src/abg-comparison.cc (diff::priv::local_category_): Add new data member. (diff::priv::priv): Initialize it. (diff::priv::is_filtered_out): Add new member function. This is factorized out of diff::is_filtered_out(). (diff::is_filtered_out): Re-write in terms of diff::priv::is_filtered_out(). (diff::{get_local_category, add_to_local_category, add_to_local_and_inherited_categories, remove_from_local_category, set_local_category, is_filtered_out_wrt_non_inherited_categories, has_local_changes_to_be_reported}): Define new member functions. (suppression_categorization_visitor::visit_begin): Update local categories too. (redundancy_marking_visitor::visit_end): If all of the children nodes of the a diff node N are redundant and if N has filtered-out local changes, then N is redundant too. * tests/data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v{1,2}.so: New binary test inputs. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-v{0,1}.cc: Source code for the binary test inputs above. * tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-{0,1}.txt: New test output references. * tests/test-diff-filter.cc (in_out_specs): Add the test inputs above to the set of inputs this test harness has to run over. * tests/data/Makefile.am: Add the test materials above to the source distribution. 2015-03-17 Dodji Seketeli Various style cleanups * src/abg-hash.cc (class_decl::hash::operator()(const class_decl& t) const): Fix comment. * src/abg-ir.cc (lookup_node_in_scope): Likewise. (class_decl::add_base_specifier): Use base_spec_sptr rather than shared_ptr. (class non_canonicalized_subtype_detector): Fix comment. 2015-03-17 Dodji Seketeli Make is_global_scope() return a pointer to the global scope * include/abg-fwd.h (is_global_scope): Return a global_scope*. * src/abg-ir.cc (is_global_scope): Likewise. 2015-03-17 Dodji Seketeli Add a useful assert in the comparison engine * src/abg-comparison.cc (qualified_type_diff::report): Assert that if the qualified type diff node has changes to be reported and no local change, then its child node must have changes to be reported. 2015-03-17 Dodji Seketeli Fix diff report about non-static data members. * src/abg-comparison.cc (class_diff::priv::{get_deleted_non_static_data_members_number, get_inserted_non_static_data_members_number}): Define new member functions. (class_diff::reports): Use the new functions above. Also, add forgotten new lines where they belong. 2015-03-17 Dodji Seketeli Do not cache hash values in decl_base::get_hash * src/abg-ir.cc (decl_base::get_hash): Do not cache the hash value. 2015-03-17 Dodji Seketeli Do not miss early non-complete type resolution when it's possible * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): A type that has its size defined is not non-complete. Same if it has a method or a member type. 2015-03-17 Dodji Seketeli Delay non-complete class type resolution up to end of corpus reading * include/abg-fwd.h (lookup_type_in_corpus): Declare new function. * src/abg-corpus.cc (lookup_type_in_corpus): Define new function here. * include/abg-ir.h (function_types_type): Declare new typedef. (translation_unit::get_canonical_function_type): Remove member function. (translation_unit::bind_function_type_life_time): Declare new member function. (classes_type): New typedef. * src/abg-ir.cc (translation_unit::priv::canonical_function_types_): Remove data member. (translation_unit::priv::function_types): New data member. (translation_unit::get_canonical_function_type): Remove this function definition. (translation_unit::bind_function_type_life_time): New function definition. (lookup_node_in_scope): Ensure that the type returned is complete. * src/abg-dwarf-reader.cc (string_classes_map): New typedef. (read_context::decl_only_classes_map_): New data member. (read_context::declaration_only_classes): New accessor. (read_context::{maybe_schedule_declaration_only_class_for_resolution, is_decl_only_class_scheduled_for_resolution, resolve_declaration_only_classes, current_elf_file_is_executable, current_elf_file_is_dso}): Define new member functions. (read_context::clear_per_translation_unit_data): Do not clear the data structures that associate DIEs to decls/types or that contain the types to canonicalize here. Rather, clear them ... (read_context::clear_per_corpus_data): ... here instead. (read_context::build_translation_unit_and_add_to_ir): Do not perform late type canonicalizing here. Rather, do it ... (read_debug_info_into_corpus): ... here instead. And before that, call read_context::clear_per_corpus_data() and the new read_context::resolve_declaration_only_classes() here. (build_class_type_and_add_to_ir): Schedule the non-complete types for resolution to complete types. Assert that base classes that are non-complete are scheduled to be completed. (build_function_decl): Do not try to canonicalize function types this early, systematically. Now, all the non-complete types needs to be completed before starting canonicalizing. So let function types go through the normal processes of deciding when to canonicalize them. But then, bind the life time of the function type to the life time of the current translation unit. (maybe_canonicalize_type): If a class type is non-complete, schedule it for late canonicalizing. * src/abg-hash.cc (class_decl::hash::operator()(const class_decl&) const): During hashing, a base class should be complete. * src/abg-reader.cc (read_context::clear_per_translation_unit_data): Do not clear id/xml node, and type maps here. Rather, clear it ... (read_context::clear_per_corpus_data): ... here instead. (read_translation_unit_from_input): Do not perform late canonicalizing here. Rather, do it ... (read_corpus_from_input): ... here. Also, call the new read_context::clear_per_corpus_data() here. (build_function_decl): Do not canonicalize function types here so early. Rather, bind the life time of the function type to the life time of the translation unit. * src/abg-writer.cc (write_translation_unit): Do not clear the type/ID map here. * tests/data/test-read-dwarf/test2.so.abi: Adjust test input. 2015-03-17 Dodji Seketeli Add --no-architecture option to abidw * tools/abidw.cc (options::write_architecture): New flag. (options::options): Initialize it. (display_usage): Add usage string for the new --no-architecture option. (parse_command): Parse the new --no-architecture command line option. (main): Ignore the architecture name if required by the user. 2015-03-13 Dodji Seketeli We shouldn't build qualified types with empty underlying type * src/abg-ir.cc (qualified_type_def::qualified_type_def): Assert that we shouldn't build qualified types with empty underlying type. 2015-03-13 Dodji Seketeli Add an overload for is_type() that takes naked pointers * include/abg-fwd.h (is_type): Declare new overload that takes a naked pointer. * src/abg-ir.cc (is_type): Define new overload that takes a naked pointer. 2015-03-13 Dodji Seketeli Declaration-only classes shouldn't have canonical types * include/abg-fwd.h (keep_type_alive): Declare new function. * src/abg-ir.cc (strip_typedef): Simplify logic. Support types that are not canonicalized. (type_base::get_canonical_type_for): For declaration-only classes, return an empty canonical class, forcing the class to be compared structurally. (keep_type_alive): Define new function. * src/abg-hash.cc ({decl_base, type_decl, scope_type_decl, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, class_decl::member_class_template, class_decl, type_tparameter, template_tparameter, }::hash::operator()): Do not cache the computed hash. 2015-03-13 Dodji Seketeli Fix redundancy categorization propagation * src/abg-comparison.cc (redundancy_marking_visitor::visit_end): Consider the cases of changes that are a filtered out. * tests/data/test-diff-filter/libtest27-redundant-and-filtered-children-nodes-v{0,1}.so: New test binaries to use as test input. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-{0,1,2}.txt: New test result baselines. * tests/data/test-diff-filter/test27-redundant-and-filtered-children-nodes-v{0,1}.cc: Source code for the test input binaries above. * tests/test-diff-filter.cc (in_out_spec): Add the binaries to the test inputs used for this test harness. * tests/data/Makefile.am: Add the new test material above to the distribution. 2015-03-13 Dodji Seketeli Fix thinko in has_virtual_mem_fn_change(). * src/abg-comp-filter.cc (has_virtual_mem_fn_change): Fix thinko. 2015-03-13 Dodji Seketeli From inside the comparison engine re-use IR's equality operators * include/abg-ir.h (operator==(scope_decl_sptr, scope_decl_sptr)): Declare. (operator==(type_decl_sptr, type_decl_sptr)): Likewise. (operator==(enum_type_decl_sptr, enum_type_decl_sptr)): Likewise. * src/abg-comparison.cc (diff_length_of_decl_bases) (diff_length_of_type_bases): Remove these static functions. (class_diff::has_changes): Re-use the comparison operator for class_decl_sptr. (type_decl_diff::has_changes): Re-use the comparison operator for type_decl_sptr. * src/abg-ir.cc (operator==(scope_decl_sptr, scope_decl_sptr)): Define. (operator==(type_decl_sptr, type_decl_sptr)): Likewise. (operator==(enum_type_decl_sptr, enum_type_decl_sptr)): Likewise. 2015-03-11 Dodji Seketeli Remove unnecessary vertical white space from diff report * src/abg-comparison.cc (class_diff::report): When reporting virtual member functions make sure to emit the newline only if one report for member function has already been emitted. 2015-03-10 Dodji Seketeli Cleanup array_type_def::is_infinite * src/abg-ir.cc (array_type_def::is_infinite): Style cleanup. 2015-03-10 Dodji Seketeli Make a function static as it oughts to be * src/abg-ir.cc (get_type_representation): Make this static. 2015-03-10 Dodji Seketeli Canonicalize function types * src/abg-dwarf-reader.cc (build_function_decl): Call maybe_canonicalize_type to canonicalize the function type. 2015-03-10 Dodji Seketeli Use more naked pointers when comparing function types * src/abg-ir.cc (equals): In the overload for function types, use more naked pointers, less smart pointers. 2015-03-10 Dodji Seketeli Pass a bunch of smart pointers by reference * include/abg-fwd.h (get_member_is_static, is_member_function) (get_member_function_is_ctor, set_member_function_is_ctor) (get_member_function_is_dtor, set_member_function_is_dtor) (get_member_function_is_const, set_member_function_is_const) (get_member_function_vtable_offset) (set_member_function_vtable_offset) (get_member_function_is_virtual): Declare the smart pointer parameter of these as being passed by reference. * include/abg-ir.h (get_member_access_specifier) (get_member_is_static, get_member_access_specifier) (set_member_function_is_ctor, set_member_function_is_const) (set_member_function_vtable_offset): Likewise, for these friend declarations to the decl_base type. * src/abg-ir.cc (get_member_access_specifier) (get_member_is_static, is_member_function) (get_member_function_is_ctor, set_member_function_is_ctor) (get_member_function_is_dtor, set_member_function_is_dtor) (get_member_function_is_const, set_member_function_is_const) (get_member_function_vtable_offset) (set_member_function_vtable_offset) (get_member_function_is_virtual): In these definitions, the smart pointer parameter is passed by reference. 2015-03-10 Dodji Seketeli Make decl_base::get_context_rel() return a naked pointer * include/abg-fwd.h (set_member_is_static): Add an overload that takes the member as a reference to a smart pointer. (set_member_function_{is_dtor, is_ctor, is_const, vtable_offset, is_virtual}): Pass the member function as a reference. (set_member_function_is_const, set_member_function_is_virtual): Pass the member function as a non-const reference. * include/abg-ir.h (decl_base::get_context_rel): Return a naked pointer. (set_member_is_static, set_member_function_is_virtual): Adjust this friend declaration. (set_member_access_specifier): Add an overload that takes a reference to the member. Pass a reference to smart pointer to the other overload. (set_member_function_is_{is_ctor,is_dtor,is_const,is_virtual,vtable_offset}): Take a non-const reference to function_decl. * src/abg-ir.cc (decl_base::get_context_rel): Likewise. (equals(const decl_base&, const decl_base&, change_kind*)): Adjust. (equals(const var_decl&, const var_decl&, change_kind*)): Likewise. (get_member_access_specifier, get_member_is_static) (set_data_member_offset, get_data_member_offset) (set_data_member_is_laid_out, get_data_member_is_laid_out) (get_member_function_is_ctor, set_member_function_is_ctor) (get_member_function_is_dtor, set_member_function_is_dtor) (get_member_function_is_const, set_member_function_is_const) (get_member_function_vtable_offset) (set_member_function_vtable_offset) (get_member_function_is_virtual, set_member_function_is_virtual): Likewise. (set_member_access_specifier): Add an overload that takes a reference to decl_base. (set_member_is_static, set_member_function_{is_dtor, is_ctor, is_const, vtable_offset, is_virtual}): Pass the member function as a reference.): Add an overload that takes the member as a reference, and write the older overload in terms of the new one. 2015-03-09 Dodji Seketeli Make overloads of decl_base::get_qualified_name() return a reference * incude/abg-ir.h (decl::get_{qualified_name, qualified_parent_name}): Return a reference to a string rather than a copy of a string. (qualified_type_def::get_qualified_name): Likewise. (reference_type_def::get_qualified_name): Likewise. (array_type_def::get_qualified_name): Likewise. (class enum_type_decl::enumerator): Make this is an out-of-line pimpled class implementation. (enum_type_decl::enumerator::{get, set}_enum_type): Declare new method. (enum_type_decl::enumerator::get_qualified_name): Change this so that it doesn't take the name of the enum type anymore. * src/abg-comparison.cc (enum_diff::report): Adjust for enum_type_decl::enumerator::get_qualified_name() not taking the name of the enum type anymore. * src/abg-ir.cc (decl_base::get_qualified_parent_name): Return a reference to string. (decl_base::get_qualified_name): Likewise. (decl_base::get_qualified_name(string&)): Use the new verson of decl_base::get_qualified_name() that returns a reference. ({qualified_type_def, pointer_type_def, reference_type_def, array_type_def}::get_qualified_name()): Return a string reference. ({qualified_type_def, pointer_type_def, reference_type_def, array_type_def}::get_qualified_name(string& qualified_name) const): Use the new qualified_type_def::get_qualified_name() that returns a string reference. (class enum_type_decl::priv): New type. (enum_type_decl::{get_underlying_type, get_enumerators}): Adjust. (enum_type_decl::{enumerator::enumerator, enumerator::operator==, enumerator::get_name, enumerator::get_qualified_name, enumerator::set_name, enumerator::get_value, enumerator::set_value, enumerator::get_enum_type, enumerator::set_enum_type}): Define methodes out-of-line here. 2015-02-24 Dodji Seketeli Harden strip_typedef * src/abg-ir.cc (strip_typedef): Consider that the underlying type can be void. 2015-02-24 Dodji Seketeli When reading DWARF set member type access where the type is built * include/abg-fwd.h (is_class(decl_base*)): Return a class_decl* rather than just a bool. * abg-ir.cc (is_class(decl_base*)): Return a class_decl* rather than just a bool. Simplify the implementation. * src/abg-dwarf-reader.cc (maybe_set_member_type_access_specifier): Define new static function. (build_ir_node_from_die): Remove the is_member_type flag. When building member types set their access specifier. Simplify the logic of detecting that a type is a member type; basically delegate taht to the new maybe_set_member_type_access_specifier(). (build_class_type_and_add_to_ir): Do not try to set the member type access specifiers anymore. (build_qualified_type, build_pointer_type, build_reference_type) (build_typedef_type, build_var_decl, build_function_decl): Adjust. 2015-02-24 Dodji Seketeli Fix enum_diff::has_changes() * src/abg-comparison.cc (enum_diff::has_changes): Just use the normal comparison operator to compare the two enums here. It's fast now. 2015-02-23 Dodji Seketeli Build the set of exported decls directly during DWARF loading * include/abg-ir.h ({var,function}_decl::get_id): Return a reference. * src/abg-ir.cc ({var,function}_decl::get_id): Return a reference to the string rather than copying it over. * include/abg-corpus.h (class corpus::exported_decls_builder): Declare new type. (corpus::{sort_functions, sort_variables, maybe_drop_some_exported_decls, get_exported_decls_builder}): Declare new methods. * src/abg-corpus.h (corpus::exported_decls_builder::priv): Define new type. (class symtab_build_visitor_type): Remove this type that is useless now. (corpus::exported_decls_builder::{exported_decls_builder, exported_functions, exported_variables, maybe_add_fn_to_exported_fns, maybe_add_var_to_exported_vars}): Define new functions. (corpus::priv::is_public_decl_table_built): Remove this data member. It's now useless. (corpus::priv::priv): Adjust. (corpus::priv::build_public_decl_table): Remove this member function. It's now useless. (corpus::{priv::build_unreferenced_symbols_tables, get_functions, get_variables}): No need to build the public decls table here. It's already built by the time the corpus is read from DWARF now. (corpus::{sort_functions, sort_variables, maybe_drop_some_exported_decls, get_exported_decls_builder}): Define new member functions. * src/abg-dwarf-reader.cc (read_context::exported_decls_builder): New data member. (read_context::read_context): Initialize it. (read_context::{exported_decls_builder, maybe_add_fn_to_exported_fns, maybe_add_var_to_exported_vars}): Define new member functions. (read_debug_info_into_corpus): Get the the new 'exported_decls_builder' object from the corpus and stick it into the read context so the DWARF reading code can use it to build the exported decls set. When the DWARF reading is done, sort the set of exported functions and variables that was built. (build_ir_node_from_die): When a function or variable is built, consider putting it into the set of exported decls. * tools/abicompat.cc (main): Now that the exported decls is built *before* we had a chance to stick the list of symbol IDs to keep, call corpus::maybe_drop_some_exported_decls() to update the set of exported decls we should consider for the corpus. was applied to that list and the final 2015-02-22 Dodji Seketeli Fix canonicalizing of member types ... *AGAIN* * src/abg-dwarf-reader.cc (build_ir_node_from_die): For typedefs, we don't need to test that the current scope is a class to know that we are looking at a member type. Just looking at the is_member flag is enough. So the issue arises when for instance, we are reading a class that defines a member typedef (or enum) and uses that enum as the type of a data member. When reading that data member (before reading the definition of the typedef), we read the type of the data member; so we hit the typedef. But build_ir_node_from_die() cannot fully construct the scope of the typedef before handing off the typedef because we are currently building it! So it hands out a non-complete version of the class that is being built; 'is_member' is not set to 'true' because we are getting the type of the data member; it's not *necessarily* a member type. So we need to check !is_class_type(scope) to know if we are given a member type. I am now thinking that the "is_member" flag is actually useless. I think I'll remove it in a later patch. Anyway, this fixes 'abidiff libabigail.so libabigail.so' again. I have some stashed patches that brings it's time down to ~ 45 seconds. So we are getting close to being able to include that *ultimate* test in regression test suite. Oh well. * src/abg-dwarf-reader.cc (build_ir_node_from_die): When building typedefs, enum and memeber classes, check that the scope is a member class to detect if we are building a member type. In which case the caller is going to handle the canonicalizing of the member type *after* it's access specification has been adjusted. Otherwise, that adjustments happens after the type has been canonicalized and bad things happen at comparison type. 2015-02-21 Dodji Seketeli Bug 17649 Avoid endless looping on diff graph with cycles * include/abg-comp-filter.h (harm{less,ful}_filter::visit_end): Declare new methods. * include/abg-comparison.h (diff_context::maybe_apply_filters): Remove the traverse_nodes_once flag. * src/abg-comp-filter.cc (apply_filter): Force the traversing to operate in cycle avoidance mode. (harm{less,ful}_filter::visit): Update the category of the canonical node too. (harm{less,ful}_filter::visit_end): Define new method. * src/abg-comparison.cc (diff_context::maybe_apply_filters): Remove the traverse_nodes_once flag. Adjust. Simplify logic. (diff::traverse): Always call diff_node_visitor::{begin,end}. If the node has already been visited previously then do not call diff_node_visitor::visit() and do not visit the children nodes. (category_propagation_visitor::visit_end): If the node has already been visited, then propagate the category from the canonical nodes of the children nodes. (propagate_categories): Force the traversing to operate in cycle avoidance mode. 2015-02-20 Dodji Seketeli Add missing new line after reporting alignment changes * src/abg-comparison.cc (distinct_diff::report): After calling report_size_and_alignment_changes, one needs to add a new line if some stuff got emitted out the output stream. 2015-02-20 Dodji Seketeli Add type checking overloads that ease their calling from GDB * include/abg-fwd.h (is_class_type, is_pointer, is_reference_type) (is_qualified_type): Declare overloads that take naked (non-smart) pointers. * src/abg-ir.cc (is_class_type, is_pointer, is_reference_type) (is_qualified_type): Define overloads that take naked (non-smart) pointers. 2015-02-20 Dodji Seketeli Remove overly eager assert in distinct_diff::report * src/abg-comparison.cc (distinct_diff::report): Remove over-eager assert. 2015-02-20 Dodji Seketeli Factorize late canonicalizing code in the dwarf reader * src/abg-dwarf-reader.cc (read_context::{canonicalize_types_scheduled, perform_late_type_canonicalizing}): Factorize these from ... (build_translation_unit_and_add_to_ir): ... here. 2015-02-20 Dodji Seketeli Rename schedule_type_for_canonicalization -> schedule_type_for_late_canonicalization * src/abg-dwarf-reader.cc (read_context::schedule_type_for_late_canonicalization): Renamed read_context::schedule_type_for_canonicalization into this. Also, add some sanity checking code in there. (build_class_type_and_add_to_ir, maybe_canonicalize_type): Adjust. 2015-02-20 Dodji Seketeli Adjust semantics of the 'is_member' flag of build_ir_node_from_die() * src/abg-dwarf-reader.cc (build_ir_node_from_die): Rename is_member into is_member_type. Adjust. (get_scope_for_die, build_translation_unit_and_add_to_ir) (build_namespace_decl_and_add_to_ir): Adjust. (build_class_type_and_add_to_ir): Adjust. Adjust set to false when calling build_ir_node_from_die() to build a function_decl. 2015-02-20 Dodji Seketeli Simplify canonicalizing handling for typedefs * src/abg-dwarf-reader.cc (build_ir_node_from_die): For typedefs, we don't need to test that the current scope is a class to know that we are looking at a member type. Just looking at the is_member flag is enough. 2015-02-20 Dodji Seketeli Do not miss canonicalizing opportunities on non-member class types * src/abg-dwarf-reader.cc (build_ir_node_from_die): When a class is not a member type, then it at least ought to be scheduled for late canonicalizing. 2015-02-20 Dodji Seketeli Fix handling of canonicalizing of member enum types * src/abg-dwarf-reader.cc (build_ir_node_from_die): Once we've built the enum type by calling build_enum_type(), do not try to canonicalize it here if it's a member type. The calling build_class_type_and_add_to_ir() must deal with it already. 2015-02-20 Dodji Seketeli Stick qualified, pointer, reference and array types into the global scope * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Do not consider qualified, pointer, reference and array types as member types. Only typedef, class and enum types are. (build_ir_node_from_die): Stick base, pointer, reference, qualified and array types into the global scope. 2015-02-20 Dodji Seketeli Avoid creating multiple versions of certain composite types * src/abg-dwarf-reader.cc (build_qualified_type) (build_pointer_type_def, build_reference_type, build_array_type) (build_typedef_type): If the composite type we are about to create was already created, just return the one that exists already. 2015-02-20 Dodji Seketeli Do not forget to canonicalize enum underlying type and void type * src/abg-dwarf-reader.cc (build_enum_type): Canoncialize the underlying type of the enum type. (build_ir_node_for_void_type): Canonicalize the void type. 2015-02-20 Dodji Seketeli Do not forget to associate DIE to the types they represent * src/abg-dwarf-reader.cc (build_type_decl, build_enum_type) (build_qualified_type, build_pointer_type_def) (build_reference_type, build_typedef_type) (build_class_type_and_add_to_ir): Take a new flag that says if the DIE is from the alternate debug info section or not. Perform the DIE->type association in these functions. Note that in build_class_type_and_add_to_ir we are now doing the DIE->type association even for declaration-only classes. And for member types, do not bother doing the association because it's already been done by build_ir_node_from_die(). (build_ir_node_from_die): Do not do the DIE->type association here anymore. Adjust to the new signature of the build_* functions above that actually build the types. 2015-02-20 Dodji Seketeli Clear per-TU data before reading debub info for a TU * src/abg-dwarf-reader.cc (read_context::die_type_map): New accessor for the two DIE->Type maps we have; the one of the main debug info section and the one of the alternate debug info section. (read_context::{associate_die_to_type, lookup_type_from_die_offset}): use the new die_type_map() accessor. (read_context::clear_per_translation_unit_data): Factorize this from build_translation_unit_and_add_to_ir(). Also, add code to clear the DIE->type map as well as the vectors of offsets of the types of the DIEs to canonicalize after the translation unit has been read. 2015-02-19 Dodji Seketeli Fix the new regression test for type canonicalizing * tests/runtestcanonicalizetypes.sh.in (binaries): Refer to abg-tools-utils, not abg-tools-utils.o; the extension is computed automatically, depending on the underlying platform. 2015-02-19 Dodji Seketeli Make strip_typedef() act on canonical types only * include/abg-fwd.h (is_compatible_with_class_type): Declare new function. (canonicalize): Move the declaration here, from ... * include/abg-ir.h (canonicalize): ... here. * src/abg-ir.cc (strip_typedef): Assert that the input type is canonicalized. Make sure that weak references are on canonicalized types. Make sure that the returned type is a canonical one. (canonicalize): Make this return the canonical type that it has computed. * src/abg-comp-filter.cc (type_size_changed): Use the new is_compatible_with_class_type() function, instead of is_class_type(). 2015-02-18 Dodji Seketeli Speed up function_decl::get_id() and var_decl::get_id() * src/abg-ir.cc (var_decl::priv::id_): New data member. (var_decl::get_id): Cache the result on the first invocation and and returns it on subsequent invocations. (function_dec::priv::id_): New data member. (function_decl::get_id): Cache the result on the first invocation and and returns it on subsequent invocations. 2015-02-18 Dodji Seketeli Speed up symbol version reading * src/abg-dwarf-reader.cc (find_symbol_table_section) (get_symbol_versionning_sections): Forward declare these existing static functions. (read_context::{symtab_section_, symbol_versionning_sections_loaded_, symbol_versionning_sections_found_, versym_section_ verdef_section, verneed_section}): New data members. (read_context::read_context): Initialize them. (read_context::{find_symbol_table_section, get_symbol_versionning_sections, get_version_for_symbol}): Implement a caching version of their exisiting non-caching counterpart. (read_context::lookup_elf_symbol_from_index): Use the new caching functions read_context::find_symbol_table_section and read_context::get_version_for_symbol. (read_context::load_symbol_maps): Likewise, use the new caching function read_context::find_symbol_table_section. 2015-02-17 Dodji Seketeli Stop traversing function/variable node when added to symbol table * src/abg-corpus.cc (symtab_build_visitor_type::visit_begin): Replace symtab_build_visitor_type::visit_end with this and return false. 2015-02-13 Dodji Seketeli Do not apply diff filters sub-tree not carrying changes * src/abg-comp-filter.cc ({harmless, harmful}_filter::visit): Do not try to do the categorizing on a diff sub-tree that does not carry any change. * src/abg-comparison.cc (diff_context::maybe_apply_filters): Do not bother trying to apply the filters on a diff sub-tree that does not carry any change. 2015-02-13 Dodji Seketeli Canonicalize types either early or late after TU reading * include/abg-fwd.h (is_class_type) (type_has_non_canonicalized_subtype): Declare new functions. (is_member_type): Remove the overload that takes a decl_base_sptr. It's superfluous. We just need the one that takes a type_base_sptr. * include/abg-ir.h (translation_unit::{is_constructed, set_is_constructed}): Add new methods. (class_decl::has_virtual_member_functions): Likewise. (class decl_base): Makes it virtually inherit ir_traversable_base. (class type_base): Make this virtually inherit traversable_base too. (type_base::canonicalize): Renamed enable_canonical_equality into this. (type_base::traverse): Declare new virtual method. (canonicalize): Renamed enable_canonical_equality into this. (scope_type_decl::traverse): Declare new virtual method. (namespace_decl::get_pretty_representation): Declare new virtual method. (function_type::traverse): Likewise. (class_decl::base_spec::traverse): Likewise. (ir_node_visitor::visit): Remove the overloads and replace each of them with a pair of ... (ir_node_visitor::{visit_begin, visit_end}): ... of these. * include/abg-traverse.h (traversable_base::visiting): New method. (traversable_base::visiting_): New data member. (traversable_base::traversable_base): New constructor. * src/abg-ir.cc ({scope_decl, type_decl, namespace_decl, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, function_decl::parameter, class_decl, class_decl::member_function_template, class_decl::member_class_template, function_tdecl, class_tdecl}::traverse): Fix this to properly set the traversable_base::visiting_ flag and to reflect the new signatures of the ir_node_visitor methods. ({type_base, scope_type_decl, function_type, class_decl::base_spec}::traverse): New method. (type_base::get_canonical_type_for): Handle the case of the type already having a canonical type. Properly hash the type using the dynamic type hasher. Look through declaration-only classes to consider the definition of the class instead. Fix logic to have a single pointer of return, to ease debugging. (canonicalize): Renamed enable_canonical_equality into this. (namespace_decl::get_pretty_representation): Define new method. (ir_node_visitor::visit): Replace each of these overloads with a pair of visit_begin/visit_end ones. (translation_unit::priv::is_constructed_): New data member. (translation_unit::priv::priv): Initialize it. (translation_unit::{is_constructed, set_is_constructed}): Define new methods. (is_member_type(const decl_base_sptr)): Remove. (is_class_type(decl_base *d)): Define new function. (class_decl::has_virtual_member_functions): Define new method. (equals(const class_decl&, const class_decl&, change_kind*)): If the containing translation unit is not constructed yet, do not take virtual member functions in account when comparing the classes. This is because when reading from DWARF, there can be DIEs that change the number of virtual member functions after the DIE of the class. So one needs to start taking virtual members into account only after the translation unit has been constructed. (class non_canonicalized_subtype_detector): Define new type. (type_has_non_canonicalized_subtype): Define new function. * src/abg-corpus.cc (symtab_build_visitor_type::visit): Renamed this into symtab_build_visitor_type::visit_end. * src/abg-dwarf-reader.cc (die_type_map_type): New typedef. (die_class_map_type): This is now a typedef on a map of Dwarf_Off/class_decl_sptr. (read_context::{die_type_map_, alternate_die_type_map_, types_to_canonicalize_, alt_types_to_canonicalize_}): New data members. (read_context::{associate_die_to_decl, associate_die_to_decl_primary}): Make these methods public. (read_context::{associate_die_to_type, lookup_type_from_die_offset, is_wip_class_die_offset, types_to_canonicalize, schedule_type_for_canonicalization}): Define new methods. (build_type_decl, build_enum_type) (build_class_type_and_add_to_ir, build_qualified_type) (build_pointer_type_def, build_reference_type, build_array_type) (build_typedef_type, build_function_decl): Do not canonicalize types here. (maybe_canonicalize_type): Define new function. (build_ir_node_from_die): Take a new flag that says if the ir node is a member type/function or not. Early-canonicalize base types. Canonicalize composite types that have only canonicalized sub-types. Schedule the other types for late canonicalizing. For class types, early canonicalize those that are non-member types, that are fully constructed and that have only canonicalized sub-types. Adjust to the new signature of build_ir_node_from_die. (get_scope_for_die, build_namespace_decl_and_add_to_ir) (build_qualified_type, build_pointer_type_def) (build_reference_type, build_array_type, build_typedef_type) (build_var_decl, build_function_decl): Adjust for the new signature of build_ir_node_from_die. (build_translation_unit_and_add_to_ir): Likewise. Perform the late canonicalizing of the types that have been scheduled for that. (build_class_type_and_add_to_ir): Return a class_decl_sptr, not a decl_base_sptr. Adjust for the new signature of build_ir_node_from_die. Early canonicalize member types that are created and added to a given class, or schedule them for late canonicalizing. * src/abg-reader.cc (class read_context::{m_wip_classes_map, m_types_to_canonicalize}): New data members. (read_context::{clear_types_to_canonicalize, clear_wip_classes_map, mark_class_as_wip, unmark_class_as_wip, is_wip_class, maybe_canonicalize_type, schedule_type_for_late_canonicalizing, perform_late_type_canonicalizing}): Add new method definitions. (read_context::clear_per_translation_unit_data): Call read_context::clear_types_to_canonicalize(). (read_translation_unit_from_input): Call read_context::perform_late_type_canonicalizing() at the end of the function. (build_function_decl): Fix the function type canonicalizing (per translation) that was already in place. Do the canonicalizing of these only when the type is fully built. Oops. This was really brokend. Also, when the function type is constructed, consider it for type canonicalizing. (build_type_decl): Early canonicalize basic types. (build_qualified_type_decl, build_pointer_type_def) (build_pointer_type_def, build_reference_type_def) (build_array_type_def, build_enum_type_decl, build_typedef_decl): Handle the canonicalizing for these composite types: either early or late. (build_class_decl): Likewise. Also, mark this class a 'being built' until it's fully built. This helps the canonicalizing code to know that it should leave a class alone until it's fully built. * tests/test-ir-walker.cc (struct name_printing_visitor): Adjust to the visitor methods naming change. * configure.ac: Generate the tests/runtestcanonicalizetypes.sh testing script from tests/runtestcanonicalizetypes.sh.in. * tests/runtestcanonicalizetypes.sh.in: Add the template for the new runtestcanonicalizetypes.sh script that test for type canonicalizing. * tests/Makefile.am: Add the new runtestcanonicalizetypes.sh regression testing script to the build system. 2015-02-18 Dodji Seketeli Factorize per TU data clearing in the xml-abi reader * src/abg-reader.cc (read_context::clear_per_translation_unit_data): Factorize this function out of ... (read_context::read_translation_unit_from_input): ... this one. 2015-02-13 Dodji Seketeli Use the deep type sptr equality operator when possible * src/abg-ir.cc (equals): On function_decl overload, use the deep sptr type equality operator when comparing types. (non_type_tparameter::operator==): Likewise. 2015-02-18 Dodji Seketeli Properly compare virtualness of member functions * src/abg-ir.cc (equals(const function_decl&, const function_decl&, change_kind*)): Compare virtualness of member function before comparing their vtable offsets. 2015-02-13 Dodji Seketeli Misc style fixes * include/abg-ir.h (reference_type_def::get_pointed_to_type): use type_base_sptr, rather than shared_ptr (typdef_decl::get_underlying_type): Likewise. (function_decl::get_return_type): Likewise. (function_decl::set_type): Likewise. (class_decl::member_class_template::as_class_tdecl): Likewise. * src/abg-comparison.cc (compute_diff): Remove useless vertical space. (corpus_diff::traverse): Add a vertical space after this. * src/abg-dwarf-reader.cc (type_ptr_map): Remove this unused typedef. (get_version_for_symbol) (finish_member_function_reading): Fix the comments of these functions. * src/abg-reader.cc (build_function_decl): Return a function_decl_sptr rather than a shared_ptr. (build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_array_type_def, build_typedef_decl, build_class_decl): Use the is_ functions here, rather than using the dynamic cast. This increases maintainability. 2015-02-11 Dodji Seketeli Optimize compressed debug info reading for speed * src/abg-dwarf-reader.cc (find_last_import_unit_point_before_die): Look for the inclusion point of the partial unit in reverse topological order. 2015-02-10 Dodji Seketeli Share private data of class_diff nodes * src/abg-comparison.cc (class_diff::class_diff): Do not initialize the private data of class_diff here. (compute_diff): In the overload for class_diff, initialize the private data of the new instance of class_diff to the private data of its canonical instance. (redundancy_marking_visitor::visit_begin): If a node is marked redundant, do not dare visit its children. In cases of classes that have members that reference themselves, this prevents us from wrongly marking some of the data member changes as being redundant. 2015-02-10 Dodji Seketeli Do not crash when applying filters to a NULL diff * src/abg-comparison.cc (diff_context::maybe_apply_filters): Do not crash when called with a NULL diff. 2015-02-09 Dodji Seketeli Initial implementation of canonical type comparison in the IR * include/abg-ir.h (class type_base): Pimplify this class. (type_base::canonical_types_map_type): New typedef. (type_base::{get_canonical_types_map, get_canonical_type_for, get_canonical_type}): Declare new member functions. (enable_canonical_equality): Declare new function. (struct type_base::hash): Declare this functor here. * src/abg-ir.cc (): * src/abg-dwarf-reader.cc (build_type_decl, build_enum_type) (build_class_type_and_add_to_ir, build_qualified_type) (build_pointer_type_def, build_reference_type, build_array_type) (build_typedef_type, build_function_decl): Enable canonical equality for the resulting type returned by these functions. * src/abg-hash.cc (type_base::hash::operator()(const type_base&)): Adjust as this is now out-of-line. Also, add two overloads for type_base* and type_base_sptr. (struct type_base::priv): Define new type for private data of type_base. (type_base::{get_canonical_types_map, get_canonical_type_for, get_canonical_type}): Define new member functions. (enable_canonical_equality): Define new function (type_base::{type_base, set_size_in_bits, get_size_in_bits, set_alignment_in_bits, get_alignment_in_bits}): Adjust. ({type_decl, scope_type_decl, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, function_type, class_decl}::operator==): If the types being compared have canonical type then use them for comparison. 2015-02-07 Dodji Seketeli Don't walk the diff tree when there are no suppressions * src/abg-comparison.cc (apply_suppressions): Do not walk the diff tree to apply suppressions when there are no suppressions to apply. 2015-02-07 Dodji Seketeli Speedup some diff::has_changes() implementations * src/abg-comparison.cc ({distinct_diff, var_diff, class_diff}::has_changes): Use the hash value of the diff subjects to detect quickly if they differ. If they don't, then go the slow path of comparing the types. 2015-02-05 Dodji Seketeli Get out as early as possible when comparing different ABI artefacts * include/abg-ir.h (equal): Turn the last parameter of type change_kind& into a change_kind*. Do this on all the overloads' declarations. * src/abg-ir.cc (equal): Do the same for the definitions of the overloads and adapt them to report about the kind of changes makes the two ABI artifact different -- only if the change_kind pointer is non-null. That way, callers have a way to choose if they want to go the expensive route of knowing what kind of changes there are. ({decl_base, scope_decl, type_base, scope_type_decl, qualified_type_def, pointer_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_type, function_decl, function_decl::parameter, class_decl::base_spec, class_decl}::operator==): Adjust to the new signature of equals; call it with the change_kind* parameter set to NULL. * src/abg-comparison.cc ({var_diff, pointer_diff, array_diff, reference_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, fn_parm_diff, function_decl_diff, type_decl_diff, typedef_diff}::has_local_changes): Adjust. 2015-02-05 Dodji Seketeli Rename diff::length() into diff::has_changes() * include/abg-comparison.h (*::has_changes): Rename the ::length() method of all the diff types that inherit the diff class into this, in the class declarations. * src/abg-comparison.cc (*::has_changes): Do the same as in the declarations, in the definitions. (diff::to_be_reported, distinct_diff::has_local_changes) (distinct_diff::report, distinct_diff::, array_diff::has_changes) (reference_diff::has_changes, qualified_type_diff::has_changes) (enum_diff::has_changes, translation_unit_diff::has_changes) (suppression_categorization_visitor::visit_end) (redundancy_marking_visitor::visit_begin): Adjust. * tests/test-diff-dwarf.cc (main): Adjust. * tools/abidiff.cc (main): Likewise. 2015-01-27 Dodji Seketeli Add a method to diff_context to dump a diff tree to error output * include/abg-comparison.h (diff_context::error_output_stream): Make this function const. (diff_context::{do_dump_diff_tree}): Declare new methods. * src/abg-comparison.cc (diff_context::error_output_stream): Make this function const. (diff_context::do_dump_diff_tree): Define new methods. 2015-01-27 Dodji Seketeli Keep children nodes of class_diff and scope_diff sorted * include/abg-comparison.h (decl_diff_base, type_diff_base): Forward declare these types. (diff_sptrs_type, decl_diff_base_sptr, decl_diff_base_sptrs_type) (type_diff_base_sptr, type_diff_base_sptrs_type) (base_diff_sptrs_type, string_type_diff_base_sptr_map) (string_decl_diff_base_sptr_map, string_diff_sptr_map): New typedefs. (changed_type_or_decl, changed_parm, changed_parms_type) (string_changed_type_or_decl_map) (unsigned_changed_type_or_decl_map, changed_type_or_decl_vector): Remove typedefs. (class_diff::changed_base): Make this return a base_diff_sptrs_type now. No more a string_base_diff_sptr_map. (class_diff::changed_member_fns): Make this return a function_decl_diff_sptrs_type, no more a string_changed_member_function_sptr_map. (class_diff::changed_types): Make this return a diff_sptrs_type, not a string_changed_type_or_decl_map anymore. (class_diff::changed_decls): Make this return a diff_sptrs_type, not a string_changed_type_or_decl_map anymore. * src/abg-comp-filter.cc (has_virtual_mem_fn_change) (has_non_virtual_mem_fn_change): Adjust. * src/abg-comparison.cc (compute_diff): For the decl_base_sptr and type_base_sptr overloads, assert that the resulting diff is non-null. (class_diff::priv::{sorted_changed_base_, sorted_changed_member_types_, sorted_subtype_changed_dm_, sorted_changed_dm_, sorted_changed_member_functions_, sorted_changed_member_class_tmpls_}): New data members. (class_diff::priv::changed_member_types_): Changed the type of this from string_changed_type_or_decl_map to string_diff_sptr_map. (class_diff::priv::changed_member_functions_): Changed the type of this from string_changed_member_function_sptr_map to string_function_decl_diff_sptr_map. (class_diff::priv::changed_member_class_tmpls_): Changed the type of this from string_changed_type_or_decl_map to string_diff_sptr_map. (class_diff::ensure_lookup_tables_populated): Adjust. Initialize the new sorted members class_diff::priv::{sorted_changed_bases_, sorted_subtype_changed_dm_, sorted_changed_dm_, sorted_changed_member_functions_, sorted_changed_member_types_}. (class_diff::priv::{member_type_has_changed, member_class_tmpl_has_changed, count_filtered_bases, count_filtered_subtype_changed_dm, count_filtered_changed_mem_fns, }): Adjust. (class_diff::chain_into_hierarchy): Adjust: The children nodes of class_diff are now laid out in a sorted way. (class_diff::{changed_bases, changed_member_fns}): Adjust. (base_diff_comp, virtual_member_function_diff_comp): New types. (sort_string_base_diff_sptr_map) (sort_string_virtual_member_function_diff_sptr_map): New static functions. (data_member_diff_comp): Renamed var_diff_comp into this. (sort_unsigned_data_member_diff_sptr_map): Renamed sort_var_diffs into this and adjust. (class_diff::report): Do not sort the nodes we are about to emit here. Just use the natural order of the nodes in their parent tree as they should now be sorted. (scope_diff::priv::{changed_types_, changed_decls_}): Change the type of these from string_changed_type_or_decl_map to string_diff_sptr_map. (scope_diff::priv::{sorted_changed_types_, sorted_changed_decls_}): New data members. (scope_diff::ensure_lookup_tables_populated): Adjust. Initialize the new scope_diff::priv::sorted_changed_{types_, decls_}. (scope_diff::chain_into_hierarchy): Adjust. The children of scope_diff are now sorted. (scope_diff::changed_{types, decls}): Return the sorted vectors of children nodes. (struct changed_type_or_decl_comp): Remove. (struct diff_comp): New type. (sort_changed_type_or_decl): Remove. (sort_string_diff_sptr_map): New static function. (scope_diff::report): Adjust. Do not sort children nodes here ourselves before reporting about them. Rather, use the natural topological order of the children as they are now sorted. (corpus_diff::priv::sorted_changed_vars_): Renamed corpus_diff::priv::changed_vars_ into this to make it more explicit that the things it holds are sorted. (corpus_diff::changed_variables_sorted): Adjust. (corpus_diff::priv::ensure_lookup_tables_populated): Likewise. (corpus_diff::priv::apply_filters_and_compute_diff_stats): Likewise. (corpus_diff::priv::categorize_redundant_changed_sub_nodes): Likewise. (corpus_diff::priv::clear_redundancy_categorization): Likewise. (corpus_diff::priv::maybe_dump_diff_tree): Likewise. (corpus_diff::report): Likewise. 2015-01-26 Dodji Seketeli Hand-code the string representation of GElf_Ehdr::e_machine * configure.ac: Do not check for elfutils/libebl.h and libebl.a anymore. * src/abg-dwarf-reader.cc: Do not include elfutils/libebl.h anymore. (e_machine_to_string): Define new static function. (read_context::::load_elf_architecture): Use the new e_machine_to_string() function rather than ebl_backend_name() and ebl_openbackend(). * tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt: Adjust. 2015-01-26 Dodji Seketeli Fix chaining of descendant node of qualified type diff node * include/abg-comparison.h (qualified_type_diff::leaf_underlying_type_diff): Declare new accessor. * src/abg-comparison.cc (get_leaf_type): Forward declare this static function. (qualified_type_diff::priv::leaf_underlying_type_diff): Define new data member. (qualified_type_diff::leaf_underlying_type_diff): Define this new accessor. (qualified_type_diff::chain_into_hierarchy): Call leaf_underlying_type_diff() here rather than underlying_type_diff(). (qualified_type_diff::report): Use leaf_underlying_type_diff() rather than re-computing the diff between the two leaf underlying type diff nodes. * libtest26-qualified-redundant-node-v{0,1}.so: New binary test input files. * tests/data/test-diff-filter/test26-qualified-redundant-node-v{0,1}.cc: Source code for the binary test inputs above. * tests/test-diff-filter.cc (int_out_spec): Add the new test input to the vector of test input data over which to run this test harness. * tests/data/test-diff-filter/test26-qualified-redundant-node-report-{0,1.txt: New test input file. * tests/data/Makefile.am: Add the new test input data to the source distribution. 2015-01-24 Dodji Seketeli Recognize cyclic diff tree nodes as being redundant * include/abg-comparison.h (enum visiting_kind): Rename enumerator DO_NOT_MARK_VISITED_NODES_AS_TRAVERSED into DO_NOT_MARK_VISITED_NODES_AS_VISITED. (diff_context::diff_has_been_visited): Rename diff_context::diff_has_been_traversed into this. (diff_context::mark_diff_as_visited): Rename diff_context::mark_diff_as_traversed into this. (diff_context::forget_visited_diffs): Rename diff_context::forget_traversed_diffs into this. (diff_context::forbid_visiting_a_node_twice): Rename diff_context::forbid_traversing_a_node_twice into this. (diff_context::visiting_a_node_twice_is_forbidden): Rename diff_context::traversing_a_node_twice_is_forbidden into this. (diff::is_traversing): Move this from protected to public. * src/abg-comparison.cc (diff_context::priv::visited_diff_nodes_): Rename diff_context::priv::traversed_diff_nodes_ into this. (diff_context::priv::forbid_visiting_a_node_twice_): Rename diff_context::priv::forbid_traversing_a_node_twice_ into this. (diff_context::priv::priv): Adjust. (diff_context::diff_has_been_visited): Rename diff_context::diff_has_been_traversed into this. Adjust. (diff_context::mark_diff_as_visited): Rename diff_context::mark_diff_as_traversed into this. Adjust. (diff_context::forget_visited_diffs): Rename diff_context::forget_traversed_diffs into this. Adjust. (diff_context::forbid_visiting_a_node_twice): Rename diff_context::forbid_traversing_a_node_twice into this. (diff_context::visiting_a_node_twice_is_forbidden): Rename diff_context::traversing_a_node_twice_is_forbidden into this. (diff_context::maybe_apply_filters): Adjust. (diff::end_traversing): Remove the 'mark_as_traversed' parameter of this. Remove the visited-marking code. (diff::traverse): This is the crux of the changes of this patch. Avoid traversing a node that is being traversed, but one can visit a node being visited. Also, traversing a node means visiting it and visiting its children nodes. (diff::is_filtered_out): Simplify logic for filtering redundant code. Basically all nodes that are redundant are filtered. All the complicated logic that was due when diff nodes were shared is not relevant anymore. (corpus_diff::priv::categorize_redundant_changed_sub_nodes) (propagate_categories, apply_suppressions) (diff_node_printer::diff_node_printer, print_diff_tree) (categorize_redundant_changed_sub_nodes) (clear_redundancy_categorization) (clear_redundancy_categorization): Adjust. (redundancy_marking_visitor::visit_begin): Adjust. Also, if the current diff node is already being traversed (that's a clyclic node) then mark it as redundant. * src/abg-comp-filter.cc (apply_filter): Adjust. * tests/data/test-diff-filter/test16-report-2.txt: New test input data. * tests/data/test-diff-filter/libtest25-cyclic-type-v{0,1}.so: New test input binaries. * tests/data/test-diff-filter/test25-cyclic-type-v{0,1}.cc: Source code for the test input binaries. * tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: New test input data. * tests/data/test-diff-filter/test25-cyclic-type-report-1.txt: Likewise. * tests/test-diff-filter.cc (in_out_specs): Add the new test inputs above to the list of test input data over which to run this test harness. * tests/data/Makefile.am: Add the new test files above to source distribution. * tests/data/test-diff-filter/test16-report.txt: Adjust. * tests/data/test-diff-filter/test17-0-report.txt: Likewise. 2015-01-20 Dodji Seketeli Tighten the condition for creating a cloned function from DWARF * src/abg-dwarf-reader.cc (build_ir_node): Re-indent. Also, consider that when a DIE C refers to a DIE A via the DW_abstract_origin attribute, C represents a clone of A, only if C and A have *different* linkage names. 2015-01-19 Dodji Seketeli Fix the output of the array diff report * src/abg-comparison.cc (array_diff::report): Refer to the pretty representation of the array when talking about changes of the array element type. * src/abg-ir.cc (equals): In the overload for array_type, use the equality operator that knows how to handle null pointers to element type. This avoids crashes when the pointer to element type is null. * tests/data/test-diff-dwarf/test10-report.txt: Adjust. * tests/data/test-diff-filter/test24-compatible-vars-report-1.txt: Likewise. 2015-01-14 Dodji Seketeli Do not install the generated documentation by default * doc/manuals/Makefile.am: Do not install the generated documentation by default 2015-01-14 Dodji Seketeli 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 2015-01-14 Dodji Seketeli Do not install the abinilint program * tools/Makefile.am: Add abinilint to the noinst_PROGRAMS primary. 2015-01-13 Dodji Seketeli Small grammar fix in a manpage title * doc/manuals/conf.py: Fix the grammar of the title of the abidiff man page. 2015-01-13 Dodji Seketeli Generate texinfo documentation properly * 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. 2015-01-13 Dodji Seketeli Fix man pages installation * doc/manuals/Makefile.am: Install the man pages only if they are generated. 2015-01-13 Dodji Seketeli Bump the candidate version of the library to 1.0 * configure.ac: Bump version to 1.0.0 2015-01-13 Dodji Seketeli Do not forget to install the Manpages * doc/manuals/Makefile.am: Add the man pages to the man7_MANS automake primary. 2015-01-13 Dodji Seketeli Adjust archive-related code for the recent addition of tools_utils::* * tests/Makefile.am: tools/libtoolsutils.la is no more. * tests/test-write-read-archive.cc (main): Adjust. * tools/abiar.cc (extract_tus_from_archive): Likewise. 2015-01-13 Dodji Seketeli Generate Manpages for abidiff, abidw, abilint * doc/manuals/conf.py: Define man pages for abidiff, abidw, abilint and an introductory one for libabigail. 2015-01-09 Dodji Seketeli Sort functions & variables diff nodes in the diff tree * include/abg-comparison.h (function_decl_diff_sptrs_type) (var_diff_sptrs_type): New typedefs. (corpus_diff::{changed_functions, changed_variables}): Declare new methods. * src/abg-comparison.cc (sort_string_function_decl_diff_sptr_map) (sort_string_var_diff_sptr_map): Forward declare these static functions there were already defined later. (struct diff_less_than_functor): Define new comparison functor. (diff::append_child_node): Sort the children diff nodes of a given diff node. (corpus_diff::priv::changed_fns_map_): Renamed the data member corpus_diff::priv::changed_fns_ into this. (corpus_diff::priv::changed_fns_): New data member that is a sorted vector of changed functions. (corpus_diff::priv::{lookup_tables_empty, clear_lookup_tables}): Adjust changed_fns_ -> changed_fns_map_ and changed_vars_ -> changed_vars_map_. (corpus_diff::priv::ensure_lookup_tables_populated): Likewise. Sort the changed functions and changed variables. (corpus_diff::priv::apply_filters_and_compute_diff_stats): Adjust changed_fns_ -> changed_fns_map_ and changed_vars_ -> changed_vars_map_. Also, walk the changed functions and variables diff nodes in their sorted order. (corpus_diff::priv::{categorize_redundant_changed_sub_nodes, clear_redundancy_categorization, maybe_dump_diff_tree}): Walk the changed functions and variables diff nodes in their sorted order. * include/abg-ir.h (function_decl::get_pretty_representation_of_declarator): Declarenew method. * src/abg-ir.cc (function_decl::get_pretty_representation_of_declarator): Define new function. Its content got split out of ... (function_decl::get_pretty_representation): ... this one. * src/abg-comparison.cc (corpus_diff::chain_into_hierarchy): Consider the sorted the children nodes of a diff tree node. (corpus_diff::append_child_node): Keep the children nodes of a diff tree node sorted. (corpus_diff::{changed_functions, changed_variables, length, report}): Adjust. (corpus_diff::{changed_functions_sorted, changed_variables_sorted}): Define new functions. (function_comp::operator()): First compare the qualified function names along with the parameter declarations, then the rest. (sort_string_function_decl_diff_sptr_map) (sort_string_var_diff_sptr_map): Adjust. * tests/data/test-abicompat/test0-fn-changed-report-0.txt: Adjust. * tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Adjust. * tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: Adjust. 2015-01-09 Dodji Seketeli Fix logic of function parmeters diff redundancy detection * src/abg-comparison.cc (redundancy_marking_visitor::visit_begin): For a given function parameter diff node N, we were comparing it against the other parmeter diff nodes of the function. This change ensures that we do not compare N against itself. 2015-01-09 Dodji Seketeli Update copyright year for tests/test-abicompat.cc * tests/test-abicompat.cc: Update copyright year. 2015-01-09 Dodji Seketeli Enhance the format of the diff tree dumping report * src/abg-comparison.cc (diff_node_printer::do_indent): New method. (diff_node_printer::visit): Use diff_node_printer::do_indent(). Print the addresses of the diff tree node and its canonical node. Add some vertical spaces and some indenting to make the report more readable. 2015-01-08 Dodji Seketeli Expose a new libabigail::tools_utils namespace * include/abg-tools-utils.h: Moved tools/abg-tools-utils.h in here. Renamed the namespace tools into tools_utils. Inject std::ostream, std::istream, std::ifstream, and std::string types into the tools_utils namespace. Adjust the function declarations accordingly. Remove the useless dirname() function declaration. * include/Makefile.am: Add abg-tools-utils.h to the list of exported headers. * src/abg-tools-utils.cc: Moved tools/abg-tools-utils.cc in here. Renamed the namespace tools into tools_utils. (get_stat): Add apidoc. (is_dir): Cleanup apidoc. (dir_name); Cleanup parameter name. (guess_file_type): Cleanup parameter type. * src/Makefile.am: Add abg-tools-utils.cc to the list of exported headers. * tools/Makefile.am: Do not build the temporary library libtoolsutils.la anymore as abg-tools-utils.{h,cc} have moved out of this directory. * tools/abicompat.cc (parse_command_line, main): Adjust for tools -> tools_utils namespace change. * tools/abidiff.cc (parse_command_line, main): Likewise. * tools/abidw.cc (parse_command_line, main): Likewise. * tools/abilint.cc (parse_command_line, main): Likewise. * tests/test-abicompat.cc (main): Adjust for tools -> tools_utils namespace change. * tests/test-abidiff.cc (main): Likewise. * tests/test-alt-dwarf-file.cc (main): Likewise. * tests/test-core-diff.cc (main): Likewise. * tests/test-diff-dwarf.cc (main): Likewise. * tests/test-diff-filter.cc (main): Likewise. * tests/test-diff-suppr.cc (main): Likewise. * tests/test-lookup-syms.cc (main): Likewise. * tests/test-read-dwarf.cc (main): Likewise. * tests/test-read-write.cc (main): Likewise. * tests/Makefile.am: Do not reference the libtoolsutils.la private library anymore. 2015-01-07 Dodji Seketeli Update copyright years * include/abg-comp-filter.h: Update copyright years. * include/abg-comparison.h: Likewise. * include/abg-config.h: Likewise. * include/abg-corpus.h: Likewise. * include/abg-diff-utils.h: Likewise. * include/abg-dwarf-reader.h: Likewise. * include/abg-fwd.h: Likewise. * include/abg-hash.h: Likewise. * include/abg-ini.h: Likewise. * include/abg-ir.h: Likewise. * include/abg-libxml-utils.h: Likewise. * include/abg-libzip-utils.h: Likewise. * include/abg-reader.h: Likewise. * include/abg-sptr-utils.h: Likewise. * include/abg-traverse.h: Likewise. * include/abg-viz-common.h: Likewise. * include/abg-viz-dot.h: Likewise. * include/abg-viz-svg.h: Likewise. * include/abg-writer.h: Likewise. * src/abg-comp-filter.cc: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-libzip-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-writer.cc: Likewise. * tests/print-diff-tree.cc: Likewise. * tests/test-abidiff.cc: Likewise. * tests/test-alt-dwarf-file.cc: Likewise. * tests/test-core-diff.cc: Likewise. * tests/test-diff-dwarf.cc: Likewise. * tests/test-diff-filter.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tests/test-diff2.cc: Likewise. * tests/test-ir-walker.cc: Likewise. * tests/test-lookup-syms.cc: Likewise. * tests/test-read-dwarf.cc: Likewise. * tests/test-read-write.cc: Likewise. * tests/test-utils.cc: Likewise. * tests/test-utils.h: Likewise. * tests/test-write-read-archive.cc: Likewise. * tools/abg-tools-utils.cc: Likewise. * tools/abg-tools-utils.h: Likewise. * tools/abiar.cc: Likewise. * tools/abidiff.cc: Likewise. * tools/abidw.cc: Likewise. * tools/abilint.cc: Likewise. * tools/abisym.cc: Likewise. * tools/binilint.cc: Likewise. 2015-01-07 Dodji Seketeli Detect and report changes in ELF architecture * configure.ac: Detect the presence of libebl.a and add it to the list of library we depend on to build libabigail. Report when libelf.so is not found. * include/abg-comparison.h: (diff_context::show_architecture_change): Declare new accessors. (corpus_diff::architecture_changed): Declare new method. * include/abg-corpus.h (corpus::{get,set}_architecture_name): Declare new accessors. * src/abg-comparison.cc (diff_context::priv::show_architecture_change_): New data member. (diff_context::priv::priv): Initialize it. (diff_context::show_architecture_change): Define new accessors. (function_decl_diff::report): Report when the size/alignment of the function address changes. (corpus_diff::priv::architectures_equal_): New data member. (corpus_diff::priv::priv): Initialize it. (corpus_diff::priv::emit_diff_stats): Take in account changes of architecture. (corpus_diff::architecture_changed): Define new method. (corpus_diff::length): Take in account changes of architecture. (corpus_diff::report): Report about changes of architecture. (compute_diff): In the overload for corpus_diff_sptr, detect changes fo architecture. * src/abg-corpus.cc (corpus_priv::architecture_name): Define new data member. (corpus::{get,set}_architecture_name): Define new method. * src/abg-dwarf-reader.cc: Include elfutils/libebl.h to use ebl_openbackend() and ebl_backend_name() (read_context::elf_architecture_): Define new data member. (read_context::elf_architecture): Define new accessor. (read_context::{load_elf_architecture, load_remaining_elf_data}): Define new methods. (read_corpus_from_elf): Use ctxt.load_remaining_elf_data() in lieu of ctxt.load_dt_soname_and_needed. Stick the architecture into the corpus. * src/abg-reader.cc (read_corpus_from_input): Read the 'architecture' XML property. * src/abg-writer.cc (write_corpus_to_native_xml): Write the 'architecture' XML property. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-32.so: New test input file. * tests/data/test-diff-dwarf/libtest-23-diff-arch-v0-64.so: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test-23-diff-arch-v0.cc: Source code for the binary test input files above. * tests/data/Makefile.am: Add the new test input files to the source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test input data to the set of input data to run this test harness over. * tests/test-read-dwarf.cc (main): Do not take the architecture in account during comparisons. 2015-01-05 Sinny Kumari Include libabigail-website.doxy file in EXTRA_DIST * doc/Makefile.am: Include website/libabigail-website.doxy file in EXTRA_DIST 2015-01-06 Dodji Seketeli Delete ltsugar.m4 and pkg.m4 files from m4/ * m4/ltsugar.m4: Removed. * m4/pkg.m4: Likewise. 2014-12-27 Dodji Seketeli Enable parallel tests * configure.ac (AM_INIT_AUTOMAKE): Enable parallel tests by switching on the parallel-tests option. 2014-12-27 Dodji Seketeli Add a --dump-diff-tree to abidiff for debugging purposes * 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. 2014-12-27 Dodji Seketeli Fix typos in the abicompat manual * doc/manuals/abicompat.rst: Fix typos. 2014-12-27 Dodji Seketeli Fix a typo in the abidiff manual * doc/manuals/abidiff.rst: Fix a typo. 2014-12-27 Dodji Seketeli Fix redundancy in abidiff manual * doc/manuals/abidiff.rst: Remove the redundant bullet point about the --drop-fn command line switch. 2014-12-26 Dodji Seketeli Fix the doc string of the CanonicalDiff section of the apidoc * src/abg-comparison.cc: The summary of the CanonicalDiff should not be a @par directive, otherwise it won't show up in the summary field on the html-genereated page. 2014-12-26 Dodji Seketeli 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. 2014-12-26 Dodji Seketeli Make abidiff *NOT* show redundant changes by default * tools/abidiff.cc (options::options): Initialize options::show_redundant_changes to false. 2014-12-26 Dodji Seketeli Try harder to handle pointer/reference to void * include/abg-fwd.h (type_or_void): Declare new function. * src/abg-ir.cc (type_or_void): Define it. (pointer_type_def::pointer_type_def) (reference_type_def::reference_type_def) (reference_type_def::get_qualified_name, strip_typedef): Use it to ensure that empty pointed-to-type is considered as a void type. 2014-12-26 Dodji Seketeli Do not mark sibling structurally identical nodes as redundant * include/abg-comparison.h (diff::parent_node): Declare new accessor. * src/abg-comparison.cc (diff::priv::parent_): New data member. (diff::priv::priv): Initialize it. (diff::parent_node): Define new accessor. (diff::append_child_node): Set the diff::priv::parent_ data member of the added child node. (redundancy_marking_visitor::visit_begin): If two (logical) sibbling nodes are structurally equivalent, do not mark them as being redundant. * tests/data/test-diff-suppr/libtest10-changed-parm-c-v0.so: New test input binary. * tests/data/test-diff-suppr/libtest10-changed-parm-c-v1.so: Likewise. * tests/data/test-diff-suppr/test10-changed-parm-c-report-0.txt: New test input data. * tests/data/test-diff-suppr/test10-changed-parm-c-v0.c: Source code for the binary input above. * tests/data/test-diff-suppr/test10-changed-parm-c-v1.c: Likewise. * tests/data/Makefile.am: Add the new test files to source distribution. * tests/test-diff-suppr.cc (in_out_specs): Add the new test input to the vector of test inputs to run this harness over. 2014-12-26 Dodji Seketeli Un-share diff nodes in the comparison IR * include/abg-ir.h: Prefix the doc string with "///", rather than writing it inside a /**/ comment. * include/abg-comparison.h (function_decl_diff) (function_decl_diff_sptr, fn_parm_diff, fn_parm_diff_sptr) (var_diff_sptr, base_diff, class_diff, class_diff_sptr): Move these class & typedef decls to the top of the file. (string_changed_base_map, string_changed_parm_map) (unsigned_changed_parm_map, changed_function_ptr) (string_changed_function_ptr_map): Remove these typedefs. (string_base_diff_sptr_map, string_fn_parm_diff_sptr_map) (unsigned_fn_parm_diff_sptr_map, string_var_diff_sptr_map) (unsigned_var_diff_sptr_map, string_function_decl_diff_sptr_map) (string_var_diff_ptr_map): New typedefs. (diff_context::{has_diff_for,add_diff}): Make these member functions private. (diff_context::{set_canonical_diff_for, set_or_get_canonical_diff_for}): Declare new private member functions. (diff_context::{get_canonical_diff_for, initialize_canonical_diff}): New public member functions. (diff_context::maybe_apply_filters): Set the default value of the 'traverse_nodes_once' parameter to false. (compute_diff): Make the overload for class_decl_sptr friend of the diff_context class. (class diff): Make the diff_context class a friend of this one. (diff::set_canonical_diff): Declare new private member function. (diff::get_canonical_diff): Declare new public member function. (diff::children_nodes): Make this return a vector, rather than a vector. (diff::append_child_node): Make this take a diff_sptr rather than a diff*. (class fn_parm_diff): Declare new type. (compute_diff): Declare new overload for the new function_decl::parameter_sptr. (function_decl_diff::subtype_changed_parms): Return a string_fn_parm_diff_sptr_map rather than a string_changed_parm. (function_decl_diff::children_nodes): Return a vector. (function_decl_diff::append_child_node): Take a diff_sptr. (function_decl_diff::changed_functions): Return a string_function_decl_diff_sptr_map. (function_decl_diff::changed_variables): Return a string_var_diff_sptr. (class function_decl::parameter): Make this a pimpled class. Also, make it inherit decl_base. (equals): New overload for function_decl::parameter. (struct function_decl::parameter::hash): Declare this. (ir_node_visitor::visit): Declare new overload for function_decl::parameter. * src/abg-comparison.cc: Add doc-string about the internal representation of the comparison engine and also about the concept of canonical diff of the comparison engine. (RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER) (RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2) (RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3): Consider the canonical diff when trying to know if the current node was reported earlier. (diff_context::priv::canonical_diffs): New data member. (diff_context::{get_canonical_diff_for, set_canonical_diff_for, set_or_get_canonical_diff_for, initialize_canonical_diff}): Define new member functions. (diff_context::{diff_has_been_traversed, mark_diff_as_traversed): Consider canonical diff for these tests and actions. (diff::priv::children_): Change the type of this to vector. (diff::canonical_diff_): New data member. (diff::diff): Initialize the diff::canonical_diff_ data member. (diff::begin_traversing): Mark the canonical diff node too. (diff::is_traversing): Consider the canonical diff node in this test. (diff::end_traversing): Make the canonical diff node too. Also mark the current node as having been traversed. (diff::children_nodes): Return a vector type. (diff::{get_canonical_diff, set_canonical_diff}): Define new member functions. (diff::append_child_node): Take a diff_sptr type parameter. (diff::{reported_once, currently_reporting}): Flag the canonical diff node too. And consider the canonical diff node when checking the flag. (diff::traverse): No need to mark the node as being traversed because the diff::end_traversing() function does it now. Adjust the code because diff::children_nodes() now returns vector. ({distinct_diff, var_diff, pointer_diff, array_diff, reference_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, function_decl_diff, typedef_diff, corpus_diff}::chain_into_hierarchy): Adjust to the new type that diff::append_child_node() takes. Also, take into account that the diff nodes are now un-shared. (compute_diff_for_distinct_kinds, compute_diff_for_types) (compute_diff): Do not share diff nodes anymore. Initialize the canonical diff node for the new created node. (represent): Take a var_diff_sptr rather than two var_decl_sptr. Adjust. Also take in account the fact that diff nodes are not shared anymore, and that they do have canonical diffs. (var_diff::type_diff): Make the computation of the type_diff of the var_diff be lazy. This avoids infinite (recursive) creation of diff nodes when a class diff node has a sub-type of data member that is a class diff node too. (var_diff::report): Detect redundant reporting of this kind of diff node. (class_diff::priv::changed_bases_): Change the type of this to string_base_diff_sptr_map. (class_diff::priv::subtype_changed_dm_): Change the type of this to string_var_diff_sptr_map. (class_diff::priv::changed_dm_): Change the type of this to unsigned_var_diff_sptr_map. (class_diff::priv::{count_filtered_subtype_changed_dm, count_filtered_bases}): Do not take a diff_context_sptr anymore. (class_diff::ensure_lookup_tables_populated): changed_bases_ subtype_changed_dm_ and changed_dm_ are now *NOT* shared diff nodes anymore. (class_diff::priv::base_has_changed): Adjust. (class_diff::priv::subtype_changed_dm): Adjust. (class_diff::priv::count_filtered_bases): Adjust as changed_bases_ is now a map of un-shared diff nodes. (class_diff::priv::count_filtered_subtype_changed_dm): Adjust as subtype_changed_dm_ is now a map of un-shared diff nodes. (class_diff::priv::{count_filtered_changed_mem_fns, count_filtered_inserted_mem_fns, count_filtered_deleted_mem_fns, }): Adjust for change of the default parameter value of diff_context::maybe_apply_filters(). (class_diff::~class_diff): New destructor. (class_diff::changed_bases): Return a string_base_diff_sptr_map& type. (class_diff::{inserted_data_members, deleted_data_members, changed_member_fns}): Add doc strings. (struct changed_data_member_comp): Remove. (struct var_diff_comp): New comparison functor. (sort_changed_data_members): Remove. (sort_var_diffs): Define new sorting function. (class_diff::report): Adjust. (fn_parm_diff::*): Define member types and functions of the new fn_parm_diff type. (function_decl_diff::priv::{subtype_changed_parms_, changed_parms_by_id_}): Make these take a map of fn_parm_diff_sptr nodes. (function_decl_diff::ensure_lookup_tables_populated): Adjust to the fact that priv_->subtype_changed_parms_ and priv_->priv_->changed_parms_by_id_ now are maps of un-shared fn_parm_diff_sptr nodes. (function_decl_diff::subtype_changed_parms): Adjust. (struct changed_parm_comp): Remove. (struct fn_parm_diff_comp): New comparison functor. (sort_changed_parm_map): Remove. (sort_string_fn_parm_diff_sptr_map): New sorting function. (function_decl_diff::report): Adjust. (corpus_diff::priv::children_): Change the type of this to vector. (corpus_diff::priv::changed_fns_): Changed the type of this to string_function_decl_diff_sptr_map. (corpus_diff::priv::changed_vars_): Changed the type of this to string_var_diff_sptr_map. (corpus_diff::priv::ensure_lookup_tables_populated): Adjust. (corpus_diff::priv::apply_filters_and_compute_diff_stats}): Adjust. Do not need to clear redundancy categorization anymore because the diff nodes are not shared anymore. (corpus_diff::priv::categorize_redundant_changed_sub_nodes): Adjust. (corpus_diff::priv::clear_redundancy_categorization): Adjust. (corpus_diff::changed_variables): Adjust. (struct changed_function_ptr_comp): Remove. (struct function_decl_diff_comp): New comparison functor. (sort_string_changed_function_ptr_map): Remove. (sort_string_function_decl_diff_sptr_map): Define new sorting function. (struct changed_vars_comp): Remove. (struct var_diff_sptr_comp): New comparison functor. (sort_changed_vars): Remove. (sort_string_var_diff_sptr_map): Define new sorting function. (corpus_diff::report): Adjust. (corpus_diff::traverse): Adjust. ({category_propagation_visitor, suppression_categorization_visitor}::visit_end): Adjust. (clear_redundancy_categorization): Adjust. * src/abg-hash.cc (function_decl::parameter::hash::operator): Adjust. * src/abg-ir.cc (struct function_decl::parameter::priv): Define here as part of pimpl-ifying the function_decl::parameter type. (function_decl::parameter::*): Define here the member functions as part of pimpl-ifying the function_decl::parameter type. (equals): Define the overload for function_decl::parameter here too. (ir_node_visitor::visit(function_decl::parameter*)): Define this. * tests/data/test-abicompat/test0-fn-changed-report-0.txt: Adjust. * tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Adjust. * tests/data/test-diff-dwarf/libtest21-redundant-fn-v0.so: New test input data. * tests/data/test-diff-dwarf/libtest21-redundant-fn-v1.so: Likewise. * tests/data/test-diff-dwarf/test21-redundant-fn-v0.cc: Source code for test input binary above. * tests/data/test-diff-dwarf/test21-redundant-fn-v1.cc: Likewise. * tests/data/test-diff-dwarf/test21-redundant-fn-report-0.txt: New test input data. * tests/data/test-diff-dwarf/libtest22-changed-parm-c-v0.so: New test input data. * tests/data/test-diff-dwarf/libtest22-changed-parm-c-v1.so: Likewise. * tests/data/test-diff-dwarf/test22-changed-parm-c-v0.c: Source code for test input binary above. * tests/data/test-diff-dwarf/test22-changed-parm-c-v1.c: Likewise. * tests/test-diff-dwarf.cc (in_out_spec): Add the new test input data to the vector the test inputs to run this harness over. * tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: New test input data. * tests/data/test-diff-suppr/test8-redundant-fn-report-1.txt: Likewise. * tests/data/test-diff-suppr/libtest8-redundant-fn-v0.so: New test input binary. * tests/data/test-diff-suppr/libtest8-redundant-fn-v1.so: Likewise. * tests/data/test-diff-suppr/test8-redundant-fn-v0.cc: Source code code for binary test input above. * tests/data/test-diff-suppr/test8-redundant-fn-v1.cc: Likewise. * tests/data/test-diff-suppr/test9-changed-parm-c-report-0.txt: New test input data. * tests/data/test-diff-suppr/test9-changed-parm-c-report-1.txt: Likewise. * tests/data/test-diff-suppr/libtest9-changed-parm-c-v0.so: New test input binary. * tests/data/test-diff-suppr/libtest9-changed-parm-c-v1.so: New test input binary. * tests/data/test-diff-suppr/test9-changed-parm-c-v0.c: Source code for binary test input above. * tests/data/test-diff-suppr/test9-changed-parm-c-v1.c: Likewise. * tests/test-diff-suppr.cc (in_out_specs): Add the new test input data to the vector the test inputs to run this harness over. * tests/data/Makefile.am: Add the new files to the source distribution. 2014-12-26 Dodji Seketeli Style fix * src/abg-ir.cc (reference_type_def::get_pointed_to_type): Return a type_base_sptr. * src/abg-comparison.cc (diff::is_filtered_out): Fix a comment. 2014-12-25 Dodji Seketeli Fix pretty printing of pointer_diff node * src/abg-comparison.cc (pointer_diff::get_pretty_representation): Add the missing opening square bracket. 2014-12-17 Sinny Kumari Add new methods in corpus_diff class * include/abg-comparison.h (corpus_diff::added_unrefed_function_symbols): Declare new member function (corpus_diff::added_unrefed_variable_symbols): Declare new member function * src/abg-comparison.cc (corpus_diff::added_unrefed_function_symbols): Define new member function (corpus_diff::added_unrefed_variable_symbols): Define new member function 2014-12-15 Sinny Kumari Add new corpus_diff::added_variables() method * include/abg-comparison.h (corpus_diff::added_variables): Declare new member function * src/abg-comparison.cc (corpus_diff::added_variables): Define new member function 2014-12-12 Dodji Seketeli Extend detection of compatible types to arrays * include/abg-fwd.h (is_array_type): Renamed is_array_type_def() into this for consistency. * src/abg-comparison.cc (type_suppression::suppresses_diff): Adjust. * src/abg-dwarf-reader.cc (build_array_type): Remove useless code that was trying to read a DW_AT_byte_size attribute from the DIE of the array, but then wasn't doing anything with the value. But then if the attribute was not present, the array type wouldn't be built. * src/abg-ir.cc (strip_typedef): Strip typedefs from sub-types of array types too. (is_array_type): Rename is_array_def() to this, for consistency. (var_decl::get_pretty_representation): Adjust. * tests/data/test-diff-filter/libtest24-compatible-vars-v0.so: New test input data. * tests/data/test-diff-filter/libtest24-compatible-vars-v1.so: Likewise. * tests/data/test-diff-filter/test24-compatible-vars-report-0.txt: Likewise. * tests/data/test-diff-filter/test24-compatible-vars-v0.c: Source code for the first binary above. * tests/data/test-diff-filter/test24-compatible-vars-v1.c: Source code for the second binary above. * tests/data/Makefile.am: Add the new test input data to source distribution. * tests/test-diff-filter.cc (in_out_specs): Add the new test input data to the list of input to run this test harness over. 2014-12-12 Dodji Seketeli Improve the doc string for the elf_symbol::get_id_string() method * src/abg-ir.cc (elf_symbol::get_id_string): Improve doc string. Talk about the content of the id string of an elf symbol. 2014-12-11 Dodji Seketeli Better handle pointer-to-void in various places of the pipeline * src/abg-comparison.cc (pointer_diff::report): Handle the case of pointer to void. * src/abg-dwarf-reader.cc (build_pointer_type_def): Assert that the underlying pointer is non-null. * src/abg-ir.cc (pointer_type_def::pointer_type_def): Handle the case of pointer to void. (equals): Likewise in the overload for const pointer_type_def. (pointer_type_def::get_qualified_name): Likewise. 2014-12-11 Dodji Seketeli Try harder to detect a DWARF attribute pointing into alternate DWARF section * src/abg-dwarf-reader.cc (is_die_attribute_resolved_through_gnu_ref_alt): Support the case of the origin function itself having a specification function link. 2014-12-11 Dodji Seketeli Fix accidentally removing the scope of variables when fixing them up * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): During var decl fixup, remove the scope of a variable only when we are sure that we want to re-scope it. 2014-12-11 Dodji Seketeli Fix several aborts while diffing libdw.so * src/abg-corpus.cc (corpus::priv::build_unreferenced_symbols_tables): Fix wrong guestimation of the size of the map of unreferenced symbol table. * src/abg-dwarf-reader.cc (get_version_needed_for_versym): Honour the conditions of breaking out from walking the verneed table. 2014-12-10 Dodji Seketeli Temporarily disable redundant diff report elimination * src/abg-comparison.cc (diff_context::priv::priv): Show redundant changes by default. (categorize_redundancy): Do not categorize redundancy if the diff_context says that we shouldn't. * tools/abicompat.cc (options::show_redundant): New data member. (options::options): Initialize to true. (display_usage): Add new help string for new --no-redundant and --redundant options. (parse_command_line): Parse new --no-redundant and --redundant command line options. (main): Initialize the diff context with respect to the options::show_redundant property. * tools/abidiff.cc (options::options): Initialize the show_redundant_changes data member to true. (display_usage): Show new help string for the new --no-redundant command line option. (parse_command_line): Parse the new --no-redundant command line option. * tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so: New test data input. * tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so: Likewise. * tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt: Likewise. * tests/data/test-diff-filter/test23-redundant-fn-parm-change-v0.c: Source code for the first binary above. * tests/data/test-diff-filter/test23-redundant-fn-parm-change-v1.c: Source code for the second binary above. * tests/data/Makefile.am: Add the new test data input to source distribution. * tests/test-abicompat.cc (in_out_specs): Add --no-redundant to abicompat when we don't want it to show redundant diff reports. * test-diff-filter.cc (in_out_specs): Likewise for abidiff. * test-diff-suppr.cc (in_out_specs): Likewise. 2014-12-10 Jan Engelhardt Fix conditional build wrt zip archives and cx11 * configure.ac: remove (broken) assignment to the ENABLE_ZIP_ARCHIVE_AND_CXX11 variable * Makefile.am: replace variable assignments to ZIP_ARCHIVE_TESTS_FIRST_PART, ZIP_ARCHIVE_TESTS_SECOND_PART by ZIP_ARCHIVE_TESTS using the "+=" automake operator. Likewise for CXX11_TESTS. 2014-12-10 Dodji Seketeli Make determining of compatible types complete * include/abg-fwd.h (is_reference_type, is_function_type) (is_method_type): Declare new predicates. * include/abg-ir.h (class qualified_type_def): Pimpl this class. (qualified_type_def::qualified_type_def): Use the convenience type_base_sptr typedef. (qualified_type_def::{get_cv_quals, set_cv_quals}): Use the qualified_type_def::CV type rather than char. (qualified_type_def::get_underlying_type): Use the convenience type_base_sptr typedef. (pointer_type_def::pointer_type_def): Likewise. (function_decl::parameter::parameter): Add a new constructor. * src/abg-ir.cc (is_reference_type, is_function_type) (is_method_type): Define new predicates. (class qualified_type_def::priv): Define this new private type, for the purpose of Pimpl-ifying the qualified_type_def class. (qualified_type_def::{qualified_type_def, build_name, get_cv_quals_string_prefix, get_underlying_type}): Adjust for the purpose of Pimpl-ifying the qualified_type_def class. (equals): In the qualified_type_def, reference_type_def overloads, trust the fact that we have operator== overload for the type_base_sptr. This avoids crashes for when the (possible) underlying type is null. (pointer_type_def::operator==): Likewise. (strip_typedef): Make this recursively strip typedefs from sub-types. (types_are_compatible): Handle null types. (qualified_type_def::{get_cv_quals, set_cv_quals}): Handle qualified_type_def::CV rather than char. (pointer_type_def::pointer_type_def): Use the convenience type_base_sptr typedef. * include/abg-comparison.h (distinct_diff::compatible_child_diff): Declare new member function. * src/abg-comparison.cc (distinct_diff::compatible_child_diff): Define new member function. (distinct_diff::chain_into_hierarchy): Chain the compatible child diff node that might be present. (distinct_diff::report): Now when a distinct diff carries a compatible change, mention it in the report. * src/abg-comp-filter.cc (is_compatible_change): A compatible change can now involve types that are not typedefs. Only their sub-types need to be involved with typedef-ness. * tests/data/test-diff-dwarf/test{2,4,5}-report.txt: Adjust. * tests/data/test-diff-filter/libtest21-compatible-vars-v0.so: New test data input. * tests/data/test-diff-filter/libtest21-compatible-vars-v1.so: Likewise. * tests/data/test-diff-filter/test21-compatible-vars-report-0.txt Likewise. * tests/data/test-diff-filter/test21-compatible-vars-report-1.txt Likewise. * tests/data/test-diff-filter/test21-compatible-vars-v0.cc: Source code for the first data input binary above. * tests/data/test-diff-filter/test21-compatible-vars-v1.cc: Source code for the second data input binary above. * tests/data/test-diff-filter/libtest22-compatible-fns-v0.so: New test data input. * tests/data/test-diff-filter/libtest22-compatible-fns-v1.so Likewise. * tests/data/test-diff-filter/test22-compatible-fns-report-0.txt: New test data input. * tests/data/test-diff-filter/test22-compatible-fns-report-1.txt: Likewise. * tests/data/test-diff-filter/test22-compatible-fns-v0.c: Source code for the first test data input binary above. * tests/data/test-diff-filter/test22-compatible-fns-v1.c: Source code for the second test data input binary above. * tests/data/Makefile.am: Add the new test input data to source distribution. * tests/test-diff-filter.cc (in_out_specs): Add the new test data input above to the list of test data this harness has to be run over. 2014-12-09 Dodji Seketeli Fix classification of parameter addition in C * src/abg-comp-filter.cc (function_name_changed_but_not_symbol): Compare the fully qualified name of the functions; not their pretty representation. * tests/data/test-diff-dwarf/libtest20-add-fn-parm-v0.so: New test data intput. * tests/data/test-diff-dwarf/libtest20-add-fn-parm-v1.so: Likewise. * tests/data/test-diff-dwarf/test20-add-fn-parm-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test20-add-fn-parm-v0.c: Source code for the first shared library above. * tests/data/test-diff-dwarf/test20-add-fn-parm-v1.c: Source code for the second shared library above. * tests/test-diff-dwarf.cc (in_out_specs): Add the test input data above to the list of test input the harness must run over. * Makefile.am: Add the new files above to source distribution. 2014-12-08 Dodji Seketeli Wire the soname check into abicompat * include/abg-comparison.h (corpus_diff::soname_changed): Declare new member function. * src/abg-comparison.cc (corpus_diff::soname_changed): Define new member function. (corpus_diff::length): Use the new corpus_diff::soname_changed() method. * tests/data/test-abicompat/libtest4-soname-changed-v0.so: New test input data. * tests/data/test-abicompat/libtest4-soname-changed-v1.so: Likewise. * tests/data/test-abicompat/test4-soname-changed-app: Likewise. * tests/data/test-abicompat/test4-soname-changed-report-0.txt: Likewise. * tests/data/test-abicompat/test4-soname-changed-app.cc: Source code for one of the binaries above. * tests/data/test-abicompat/test4-soname-changed-v0.cc: Likewise. * tests/data/test-abicompat/test4-soname-changed-v1.cc: Likewise. * tests/test-abicompat.cc (in_out_specs): Add the new test input data to the list of input data to run this harness over. (main): Take the soname change in account to determine if the change is ABI incompatible. * tests/data/Makefile.am: Add the new test input data above to source distribution. 2014-12-07 Dodji Seketeli Fixup messed up old runtestdiffdwarf input tests * tests/data/test-diff-dwarf/test17-non-refed-syms-report-0.txt: Add this missing reference test output. * tests/data/Makefile.am: Add the new reference test output to source distribution. * tests/data/test-diff-dwarf/test18-alias-sym-report-0.txt: Fix this output to avoid emitting symbol alias information in it. * tests/test-diff-dwarf.cc (in_out_specs): Add two missing test input data to the list of input data this harness is supposed to run over. 2014-12-07 Dodji Seketeli Support reading and comparing soname from ELF files * include/abg-corpus.h (corpus::{get_needed, set_needed, get_soname, set_soname}): Declare new accessors. * src/abg-corpus.cc (corpus::priv::{needed, soname}): New data members. (corpus::{get_needed, set_needed, get_soname, set_soname}): Define new accessors. (corpus::is_empty): Take dt_needed and dt_soname in account in computing empty-ness. * src/abg-dwarf-reader.cc (read_context::{dt_needed_, dt_soname_}): New data members. (read_context::{dt_needed, dt_soname}): New accessors. (read_context::load_dt_soname_and_needed): New member function. (read_corpus_from_elf): Call the new read_context::load_dt_soname_and_needed() to read the dt_soname and dt_needed tags. Set them to the corpus. * include/abg-comparison.h (diff_context::show_soname_change): Declare new accessors. * src/abg-comparison.cc (diff_context::priv::show_soname_change_): New data member. (diff_context::priv::priv): Initialize the new data member diff_context::priv::show_soname_change_. (diff_context::show_soname_change): Define new accessors. (corpus_diff::priv::sonames_equal_): New data member. (corpus_diff::priv::priv): Initialize the new data member corpus_diff::priv::sonames_equal_. (corpus_diff::length): Take the new priv_->sonames_equals_ data member in account. (corpus_diff::{report, priv::emit_diff_stats}): If the sonames changed and we are allowed to report it, then report it. (compute_diff): In the variant for corpus_diff, do not forget to compare the sonames. * src/abg-reader.cc (build_needed, read_elf_needed_from_input): Define new static functions. (read_corpus_from_input): Read the 'soname' attribute from the 'abi-corpus' xml element node. * src/abg-writer.cc (write_elf_needed): Define new static function. (write_corpus_to_native_xml): Write a new 'elf-needed' xml element node that contains one xml 'dependency' element node per dependency to emit. This uses the new write_elf_needed() function above. * tests/data/test-diff-dwarf/libtest19-soname-v0.so: New test input data. * tests/data/test-diff-dwarf/libtest19-soname-v1.so: Likewise. * tests/data/test-diff-dwarf/test19-soname-report-0.txt: Likewise. * tests/data/test-diff-dwarf/test19-soname-v0.c: Source code of the first binary above. * tests/data/test-diff-dwarf/test19-soname-v1.c: Source code of the second binary above. * tests/test-diff-dwarf.cc (in_out_specs): Add the test input above to the list of test input to run this harness on. * tests/data/Makefile.am: Add the new test input data above. * tests/data/test-read-dwarf/test{0,1}.abi: Adjust. * tests/data/test-read-dwarf/test{2,3,4,6,}.so.abi: Adjust. 2014-12-07 Dodji Seketeli Fix some style nits in the native reader and writer * src/abg-reader.cc (read_symbol_db_from_input): Align parameter names. Fix indentation of the first line of the function. * src/abg-writer.cc (write_elf_symbols_table): Align parameter names. 2014-12-07 Dodji Seketeli Fix a crash while writing symbol information * src/abg-corpus.cc (corpus::{get_fun_symbol_map_sptr, get_var_symbol_map_sptr}): Make sure the symbol map is always constructed, even if it's empty. * tests/data/test-read-write/test26.xml: New test input data. * tests/test-read-write.cc (in_out_spec): Add this new test input data to the list of input data to run the harness on. (main): Support reading and writing corpus files alongside translation unit files that we were handling already. * tests/data/Makefile.am: Add the new test input data to source distribution. 2014-12-05 Dodji Seketeli Avoid showing ugly version info in the libabigail online manual * doc/manuals/conf.py: Update copyright mention. Do not show ugly version information. 2014-11-30 Dodji Seketeli Initial implementation of the abicompat tool * 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. 2014-11-30 Dodji Seketeli Support reading undefined symbols from an ELF file * include/abg-corpus.h (corpus::{set_undefined_fun_symbol_map, set_undefined_var_symbol_map, get_undefined_fun_symbol_map_sptr, get_undefined_fun_symbol_map, get_sorted_undefined_fun_symbols, get_undefined_var_symbol_map_sptr, get_undefined_var_symbol_map, get_sorted_undefined_var_symbols}): Declare new methods ... * src/abg-corpus.cc (corpus::{set_undefined_fun_symbol_map, set_undefined_var_symbol_map, get_undefined_fun_symbol_map_sptr, get_undefined_fun_symbol_map, get_sorted_undefined_fun_symbols, get_undefined_var_symbol_map_sptr, get_undefined_var_symbol_map, get_sorted_undefined_var_symbols}): ... and define them. (struct corpus::priv::{undefined_var_symbol_map, sorted_undefined_var_symbols, undefined_fun_symbol_map, sorted_undefined_fun_symbols}): New data members. * src/abg-dwarf-reader.cc (get_symbol_versionning_sections): Also return the SHT_GNU_verneed section. (get_version_needed_for_versym): New static function. (get_version_definition_for_versym): Factorize this function out of .. (get_version_for_symbol): ... this one. Take a flag that says if we want the definition version or the needed version of a symbol. Extend the implementation using the two new function get_version_needed_for_versym() and get_version_definition_for_versym() above. This function now returns the version either for a defined & exported symbol, or for an undefined symbol. (lookup_symbol_from_sysv_hash_tab) (lookup_symbol_from_gnu_hash_tab, lookup_symbol_from_symtab): Adjust for the change of signature of get_version_for_symbol(). (read_context::{undefined_fun_syms_, undefined_var_syms_}): New data members. (read_context::lookup_elf_symbol_from_index): Adjust for invocation of the new signature of get_version_for_symbol(). (read_context::{undefined_fun_syms_sptr, undefined_fun_syms, undefined_var_syms_sptr, undefined_var_syms}): Define new methods. (read_context::load_symbol_maps): Add support for loading undefined symbols and their versions. (read_context::maybe_load_symbol_maps): Take in account the need to load undefined symbols as well. (read_corpus_from_elf): Once the undefined symbols have been read from the ELF file, stuff them into the resulting ABI corpus that has been built. 2014-11-30 Dodji Seketeli Show the pretty representation of deleted variables in the diff output * src/abg-comparison.cc (corpus_diff::report): Show the pretty representation of deleted variables in all cases. 2014-11-30 Dodji Seketeli Fix status checking in abidw * tools/abidw.cc (main): Fix successful status checking. 2014-11-30 Dodji Seketeli Rename elf_symbol::get_is_defined() to elf_symbol::is_defined() * include/abg-ir.h (elf_symbol::get_is_defined): Rename into elf_symbol::is_defined. (elf_symbol::set_is_defined): Rename into elf_symbol::is_defined. * src/abg-ir.cc (elf_symbol::get_is_defined): Likewise, rename this into elf_symbol::is_defined. (elf_symbol::set_is_defined): Likewise, rename this into elf_symbol::is_defined. (elf_symbol::{elf_symbol, is_public}): Adjust. * src/abg-writer.cc (write_elf_symbol): Adjust. 2014-11-30 Dodji Seketeli Update the copyright years of include/abg-corpus.h * include/abg-corpus.h: Update the copyright years of this file. 2014-11-20 Dodji Seketeli Make tests/data directory have its own Makefile * configure.ac(AC_CONFIG_FILE): Generate a new tests/data/Makefile file. * tests/Makefile.am: Link the data/ sub-directory from here. Move the EXTRA_DIST definition to ... * tests/data/Makefile.am: ... this new file here. 2014-11-20 Dodji Seketeli Hmh, finally EXTRA_DIST was just fine * tests/Makefile.am: Put EXTRA_DIST back. 2014-11-19 Dodji Seketeli Make sure we don't try to build test data * tests/Makefile.am: Replace EXTRA_DIST with noinst_DATA. 2014-11-19 Dodji Seketeli Fix manual documentation generation * doc/manuals/Makefile.am: Trigger the manual generation from the html-doc target. Add the source files to the distribution. Fix the clean target. 2014-11-19 Dodji Seketeli Fix apidoc building * doc/Makefile.am: Trigger the building frm the html-doc target. 2014-11-19 Dodji Seketeli Cleanup of configure.ac * configure.ac: Remove useless variables and fix a typo. 2014-11-19 Dodji Seketeli Add loads of forgotten test data files to source distribution * tests/Makefile.am: Add lots of test data file that were forgotten and then revealed by running make distcheck. Also fix some wrong paths to test data files. 2014-11-19 Dodji Seketeli Use DESTDIR in doc/manuals/Makefile.am when creating the manuals * doc/manuals/Makefile.am: Use the DESTDIR variable when addressing the destination directory of the created manuals. 2014-11-19 Dodji Seketeli Fix a thinko in doc/Makefile.am * apidoc-install-html-doxygen: Make sure that the directory $(DESTDIR)$(docdir) does not exist, before trying to create it. 2014-11-19 Dodji Seketeli Add doc/api/libabigail.doxy to source distribution * doc/Makefile.am: Add the file api/libabigail.doxy to source distribution. 2014-11-19 Dodji Seketeli Make the install-html target of apidoc/manual be conditional * configure.ac: add --enable-apidoc and --enable-manual. Add the two ENABLE_APIDOC and ENABLE_MANUAL automake conditional variables. Add the activation of the apidoc and manual into the final package configuration report. * doc/Makefile.am: Make the install-html, install-data-local and uninstall-local targets conditional on the ENABLE_APIDOC conditional variable. * doc/manuals/Makefile.am: Likewise, make the install-html, install-data-local and uninstall-data-local conditional on the ENABLE_MANUAL conditional variable. 2014-11-19 Dodji Seketeli Make the alt dwarf debug file *not* be a symlink * tests/data/test-alt-dwarf-file/test0-debug-dir/.build-id/16/7088580c513b439c9ed95fe6a8b29496495f26.debug: Make this be a real file, no more a symlink to ../../../test0-common-dwz.debug. * tests/data/test-alt-dwarf-file/test0-report.txt: Now that the file above is no more a symlink the message emitted by the test changes. It now says that the file found is the base name of the real file. So change the reference report accordingly. 2014-11-19 Dodji Seketeli Use the POSIX 1003.1-1988 tar format for dist tar * configure.ac: For the tar invocation made by make dist, make sure to use the POSIX 1003.1-1988 tar format that can support file names of more than 99 characters. This is useful for the test-alt-dwarf-file test that has data made of a file which patch has more than 99 characters. 2014-11-19 Dodji Seketeli Nested automake conditionals don't work * configure.ac (ENABLE_ZIP_ARCHIVE_AND_CXX11): Define this automake condition variable that is true if both the zip archive and c++11 features are enabled. This is important to know if the test runtestdot is going to be compiled. That test needs both c++11 and the zip archive features. * tests/Makefile.am: Do not nest automake conditional statements. It does not work. Rather, use the new ENABLE_ZIP_ARCHIVE_AND_CXX11 condition variable. 2014-11-19 Dodji Seketeli INSTALL file is not yet in the distribution * Makefile.am: Do not say that INSTALL file is in the distribution while it is not. 2014-11-19 Dodji Seketeli If c++11 is disable do not execute the runtestdot test * tests/Makefile.am: runtestdot should not be executed if c++11 is disabled. 2014-11-18 Dodji Seketeli make html now generates the apidoc, manual and web site * doc/Makefile.am (html-local): Make the html file generation be triggered by the html-local target, not the html target. The html target is a recursive target that calls the the html-local targets under each directory. (apidoc-html-doxygen): Rename the doc-html-doxygen target into (apidoc-install-html-doxygen): Rename doc-install-html-doxygen into this. this. (DO_HTML, DO_INSTALL_HTML): Adjust. (install-data-local): New target. * doc/manuals/Makefile.am (install-html, install-data-local): New targets. 2014-11-18 Dodji Seketeli Generate the manual html documentation in the proper build directory * doc/manuals/Makefile.am: Renamed doc/manuals/Makefile into this. (BUILDDIR): Make this variable point to $(builddir)/_build as opposed to just _build previously. (SOURCEDIR): New variable that points to the source dir as known by the autotools magic. (ALLSPHINXOPTS): Make the source dir refer to the new $(SOURCEDIR), rather than just '.' as previously. * configure.ac (doc/manuals/Makefile): Generate this now. * doc/Makefile.am: Link the sub-directory doc/manuals. 2014-11-18 Dodji Seketeli Update Makefile.am after the additions related to gen-changelog.py * Makefile.am: Add ChangeLog and COPYING-LGPLV2 to the source distribution. (update-changelog, tag-release-only tag-release): New Makefile targets. 2014-11-18 Dodji Seketeli Added a ChangeLog that is auto-generated by gen-changelog.py * ChangeLog: Add this auto-generated file. 2014-11-18 Dodji Seketeli [gen-changelog] Make subject line always come first * gen-changelog.py (process_commit): In changelog entries with an empty body, make sure the subject line comes first. 2014-11-18 Dodji Seketeli Try harder to remove timezone info from the date * gen-changelog.py (process_commit): The timezone shit can start either with a '+' or a '-'. 2014-11-18 Dodji Seketeli Not all ChangeLog file lines end up with a ':' * gen-changelog.py (process_commit): When trying to recognize the beginning of a ChangeLog entry body, do not expect a line that starts with a '*' to end with a ':' because there can be long file names that end on the next line. 2014-11-18 Dodji Seketeli Allow introductory text in commit log and ignore it when generating ChangeLog * gen-changelog.py (process_commit): Everything that comes between the subject line of the commit and the first \t* sequence is considered to be introductory text. Ignore it when generating the ChangeLog entry. * COMMIT-LOG-GUIDELINES: Update the commit log guidelines to reflect the fact that we can now have introductory text in the commit log. 2014-11-18 Dodji Seketeli Initial import of gen-changelog.py * gen-changelog.py: Copy from https://github.com/GNOME/gnet/blob/master/gen-changelog.py. License it under LGPLV v2+ after asking Edward Hervey's kind permission. Ain't Free Software really great? 2014-11-18 Dodji Seketeli Fix the reference to the IRC channel on the web page * doc/website/mainpage.txt: The IRC server address is irc.oftc.net, not just oftc.net. * include/abg-fwd.h: Likewise. 2014-11-10 Dodji Seketeli Consider enclosing template when comparing template parameters * src/abg-ir.cc (template_parameter::priv::comparison_started_): New data member. (template_parameter::priv::priv): Initialize it. (template_parameter::operator==): Compare the enclosing template too. And avoid infinite recursion. 2014-11-10 Dodji Seketeli Remove mention of libzip from the web page * doc/website/mainpage.txt: Remove mention of libzip from the list of dependencies. 2014-11-10 Dodji Seketeli Cleanup of the web page * doc/website/libabigail-website.doxy: Remove the redundant information that was appearing on the web page. * doc/website/mainpage.txt: Clean-up the text of the web page, add information for the new IRC channel #libabigail on oftc.net, re-organize the content by putting sections where we had paragraphs. Add a table of content. Also add a web form to subscribe/unsubscribe to the mailing list. 2014-11-08 Dodji Seketeli Sort functions by the their qualified name * src/abg-comparison.cc (function_comp::operator()): Sort the functions by only looking at their qualified name, as opposed to their return type name. 2014-11-08 Dodji Seketeli Remove too tight assert from de-mangling code * src/abg-ir.cc (demangle_cplus_mangled_name): The return length can be zero. That means, no de-mangling was done. 2014-11-08 Dodji Seketeli Sort reported changed declarations & types in a given scope * src/abg-comparison.cc (struct changed_type_or_decl_comp, struct changed_vars_comp): New comparison functors. (sort_changed_type_or_decl, sort_changed_vars): New static functions. (scope_diff::report): Use the above to sort changed declarations, and types in a given scope. (corpus_diff::report): Likewise for the changed variables. * tests/data/test-abidiff/test-struct1-report.txt: Adjust. * tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-8.txt: Likewise. 2014-11-08 Dodji Seketeli Sort elf symbols before serializing them * include/abg-corpus.h (corpus::{get_sorted_fun_symbols, get_sorted_var_symbols}): Declare new member functions. * src/abg-corpus.cc (corpus_priv::{sorted_var_symbols, sorted_fun_symbols}): New data members. (struct elf_symbol_comp_functor): Define new comparison functor. (corpus::{get_sorted_fun_symbols, get_sorted_var_symbols}): Define new member functions. * src/abg-writer.cc (write_elf_symbols_table): Take a sorted vector of symbols in parameters, rather than an unsorted map. (write_corpus_to_native_xml): Write a sorted vector of symbols, rather than an unsorted map of symbols. * tests/data/test-read-dwarf/test0.abi: Adjust. * tests/data/test-read-dwarf/test1.abi: Likewise. * tests/data/test-read-dwarf/test2.so.abi: Likewise. * tests/data/test-read-dwarf/test3.so.abi: Likewise. * tests/data/test-read-dwarf/test6.so.abi: Likewise. 2014-11-07 Dodji Seketeli Fix template parameter hashing: make it know about enclosing template * include/abg-ir.h (template_parameter_sptr, template_decl_sptr) (template_decl_wptr): Declare new typedefs. (class template_decl): Make this virtually inherit decl_base and pimpl-ify it. (class template_parameter): Pimpl-ify this. Make the constructor take the enclosing template parameter. (struct template_decl::hash): Declare this here, rather than in src/abg-hash.cc (class type_tparameter, non_type_tparameter, template_tparameter) (class type_composition, function_tdecl, class_tdecl): Pimpl-ify this. * src/abg-hash.cc (template_parameter::hash::operator()): Hash the enclosing template parameter. Avoid infinite recursion due to the loop hash parameter -> hash template -> hash parameter. (template_decl::hash::operator()) Define this here, now that it's declared in abg-ir.h. Also, avoid infinite recursion here; this is complementary to what is done in the hashing for template_parameter. ({type_tparameter, template_tparameter, }::hash::operator()): Cache the calculated hash just as what is done for other types hashed. (template_decl::priv): Define this new type. (template_decl::{add_template_parameter, get_template_parameters, ~template_decl}): Define these here to pimpl-ify template_decl. (template_parameter::priv): Define this new type. (template_parameter::template_parameter): Define this here to pimpl-ify template_parameter. Note also that this now takes the enclosing template decl. (template_parameter::{get_index, get_enclosing_template_decl, get_hashing_has_started, set_hashing_has_started, operator::==}): Define these here to pimpl-ify template_parameter. (type_tparameter::priv): Define this new type. (type_tparameter::type_tparameter): Define this here to pimpl-ify type_tparameter. Also, not that this constructor now takes the enclosing template decl. (class non_type_tparameter::priv): Define new type. (non_type_tparameter::{non_type_tparameter, get_type}): Define these here to pimpl-ify non_type_tparameter. The constructor now takes the enclosing template. (template_tparameter::priv): Define new type. (template_tparameter::template_tparameter): Define this here to pimpl-ify template_tparameter. This constructor now takes the enclosing template. (class type_composition::priv): New type. (type_composition::{type_composition, get_composed_type, set_composed_type}): Define these here to pimpl-ify type_composition. The constructor now takes the enclosing template decl. (class function_tdecl::priv): Define new type. (function_tdecl::{function_tdecl, set_pattern, get_pattern, get_binding}): Define this here to pimpl-ify function_tdecl. (class class_tdecl::priv): Define this new type. (class_tdecl::class_tdecl): Define this here to pimpl-ify class_tdecl. (class_tdecl::set_pattern): Adjust to pimpl-ify. (class_tdecl::get_pattern): Define new pimpl-ified getter. * src/abg-reader.cc (build_function_tdecl, build_class_tdecl): Cleanup. Pass the enclosing template to the template parameters that are built. (build_type_tparameter, build_type_composition) (build_non_type_tparameter, build_template_tparameter) (build_template_parameter): Take the enclosing template declaration and pass it to the template parameter being created. * tests/data/test-read-write/test12.xml: Fix and Adjust. * tests/data/test-read-write/test13.xml: Likewise. 2014-11-06 Dodji Seketeli Style fix * include/abg-ir.h (class location): Remove useless white space. * src/abg-writer.cc (type_has_existing_id): Use type_base_sptr rather than shared_ptr. (write_template_tparameter): Use template_tparameter_sptr rather than shared_ptr. 2014-11-05 Dodji Seketeli Pass -std=gnu++11 to the compiler when --enable-cxx11 for tests * tests/Makefile.am: Pass -std=gnu++11 to the compiler when --enable-cxx11 has been used. 2014-11-05 Dodji Seketeli Make the use of a C++-11 compiler optional * configure.ac: Define a new --enable-cxx11 switch to control the use of the C++-11 compiler. Define a WITH_CXX11 C macro and an automake ENABLE_CXX11 variable. * config.h.in: Initialize the new WITH_CXX11 C macro. * src/Makefile.am: Include the files coded in C++-11 only if the ENABLE_CXX11 automake variable is defined. * tests/Makefile.am: Likewise, build the runtestsvg test program only if C++-11 usage is enabled. * include/abg-diff-utils.h (class d_path_vec): Remove useless usage of the 'typename' keyword. * include/abg-fwd.h (is_enum_type): Renamed is_enum into this, because of a name clash with a tr1 function when not using C++-11. (is_pointer_type): Likewise, renamed is_pointer into this because of a name clash with a tr1 function when not using C++-11. * src/abg-comp-filter.cc (has_harmless_name_change): Adjust for the is_enum -> is_enum_type change. * src/abg-comparison.cc (type_suppression::suppresses_diff): Likewise. (class function_suppression::priv): Add a missing "class" keyword in friend declaration. (diff_context::diff_has_been_traversed) (diff_context::mark_diff_as_traversed): Do not use the C++-11 specific type uintptr_t. * src/abg-dwarf-reader.cc (create_default_dwfl): Do not use designated initializers. Sigh. This is handy though. (expr_result::abs): Cast the argument of std::abs to avoid ambiguous call. (finish_member_function_reading): Adjust for the is_pointer -> is_pointer_type renaming. * src/abg-hash.cc (scope_decl::hash::operator) (class_decl::base_spec::hash::operator) (type_composition::hash::operator): Use std::tr1::hash string, rather than the C++-11 specific std::hash function. * src/abg-ini.cc (read_sections, write_sections): Make std::ifstream constructor take a const char* rather than a string. * src/abg-ir.cc (is_enum_type, is_pointer_type): Renamed is_enum into is_enum_type and is_pointer into is_pointer_type. * src/abg-writer.cc (write_translation_unit): Remove useless typename keyword. Make ofstream take a const char* rather than a string. (write_namespace_decl): Remove useless typename keyword. (write_corpus_to_native_xml_file): Make ofstream take a const char* rather than a string. * tests/test-abidiff.cc (main): Make ofstream take a const char* rather than a string. * tests/test-diff-dwarf.cc (main): Likewise. 2014-11-05 Dodji Seketeli Remove some m4 auto-generated files from version control * m4/ltoptions.m4: Remove from version control. * m4/ltversion.m4: Remove from version control. * m4/lt~obsolete.m4: Remove from version control. 2014-11-03 Dodji Seketeli Add usage examples to the abidiff manual * doc/manuals/abidiff.rst: Add a usage example section along with some small and clean examples. 2014-11-01 Dodji Seketeli Fix the API doc string of the abigail::xml_writer namespace * src/abg-writer.cc: Fix the API doc of the xml_writer namespace. 2014-11-01 Dodji Seketeli Fix an apidoc typo * include/abg-comparison.h (class variable_suppression): Fix a typo in the doc string. 2014-11-01 Dodji Seketeli Update the manual for variable suppression concepts * doc/manuals/libabigail-concepts.rst: Add a section for variable suppression specification in the concepts part of the manual. 2014-11-01 Dodji Seketeli Fix some restructured text doc glitches in the fn suppression manual * doc/manuals/libabigail-concepts.rst: Fix quoting of the syntax of parameter specification string, for the function suppression concepts. 2014-11-01 Dodji Seketeli Cleanup the mainpage of the API doc * include/abg-fwd.h: Cleanup text of the API doc mainpage. 2014-11-01 Dodji Seketeli Make get_binary_load_address static * src/abg-dwarf-reader.cc (get_binary_load_address): Make this function static. 2014-11-01 Dodji Seketeli Initial support for variable suppressions * include/abg-comparison.h (variable_suppression_sptr) (variable_suppressions_type): New convenience typedefs. (class variable_suppression): Declare new type. * src/abg-comparison.cc (is_var_diff): New predicate. (read_variable_suppression): Define new static function. (class variable_suppression::priv): Define type for the private data of the variable_suppression type. (variable_suppression::{variable_suppression, ~variable_suppression, get_name, set_name, get_name_regex_str, set_name_regex_str, get_symbol_name, set_symbol_name, get_symbol_name_regex_str, set_symbol_name_regex_str, get_symbol_version, set_symbol_version, get_symbol_version_regex_str, set_symbol_version_regex_str, get_type_name, set_type_name, get_type_name_regex_str, set_type_name_regex_str, suppresses_diff}): Define new member functions for the variable_suppression type. * tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new test input. * tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-report-8.txt: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise. * tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code for the librairie above. * tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code for the librairie above. * tests/Makefile.am: Add the new test input data to the source distribution. * tests/test-diff-suppr.cc: Update to make this harness to run over the new test input above. 2014-11-01 Dodji Seketeli Update the suppr-doc.txt file for variable suppressions * doc/suppr-doc.txt: Add the suppress_variable section example. 2014-11-01 Dodji Seketeli Make var_diff and function_decl_diff extend decl_diff_base * include/abg-comparison.h (class var_diff, class function_decl_diff): Make these types inherit the decl_diff_base class. This is like the fact that all kinds of diff inherit the type_diff_base class. * src/abg-comparison.cc (var_diff::var_diff) (function_decl_diff::function_decl_diff): Adjust to initialize the sub-object of decl_diff_base; (is_decl_diff): New predicate to know if a diff is about decls. (is_function_decl): New predicate to know if a diff is about function decls. (function_suppression::suppresses_diff): Adjust to use the new is_function_decl. 2014-11-01 Dodji Seketeli Fix logic of type suppression evaluation * include/abg-comparison.cc (type_suppression::suppresses_diff): Try to evaluate the "type_name_regexp" property only if the "type_name" is empty. 2014-11-01 Dodji Seketeli Remove useless functions from the comparison engine * include/abg-comparison.h (read_type_suppression): Remove this function declaration. * src/abg-comparison.cc (read_type_suppressions): Remove this static function definition. (read_function_suppressions): Remove this static function declaration. 2014-11-01 Dodji Seketeli Spit and polish variables presentation in diff report * src/abg-comparison.cc (corpus_diff::report): Show the full representation of the variable, rather than just its name. Also, show the new representation of the variable only if it has changed. * tests/data/test-diff-dwarf/test9-report.txt: Adjust test. * tests/data/test-diff-filter/test15-0-report.txt: Likewise. * tests/data/test-diff-filter/test15-1-report.txt: Likewise. 2014-11-01 Dodji Seketeli Fix various apidoc typos * include/abg-comparison.h (class function_suppression): Fix typo in the doc string. * src/abg-comparison.cc (is_type_diff, read_suppressions) (diff::reported_once, typedef_diff::report): Fix the doc string. 2014-11-01 Dodji Seketeli Fix regexp escaping section of manual * doc/manuals/libabigail-concepts.rst: Re-indent and fix some typos in the regexp escaping section of the manual. 2014-11-01 Dodji Seketeli Doxygen shouldn't extract doc for static functions or private types * doc/api/libabigail.doxy: Do not extract doc for static functions, local classes. 2014-11-01 Dodji Seketeli Update .gitignore * .gitignore: Ignore *~ emacs files. 2014-10-29 Dodji Seketeli Separate alias targets with a comma * src/abg-ir.cc (elf_symbol::get_aliases_id_string): Separate alias targets by a comma. * tests/data/test-diff-dwarf/test18-alias-sym-v1.cc: Update test to add more than one alias to a given symbol. 2014-10-28 Dodji Seketeli Fix a typo in the manual about function suppressions * doc/manuals/libabigail-concepts.rst: Fix a typo. 2014-10-28 Dodji Seketeli Initial support for function suppressions * include/abg-comparison.h (enum visiting_kind): Change the meaning of this. It was to determine if traversal was to be done in a pre or post manner. But with the recent addition of diff_node_visitor::visit_{begin,end}() notifiers, the pre/post handling is taken care of in a different way. So now the meaning of this enum is changed to handle whether diff node children should be visited or not. So the enumerators are now DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's a bit-field. (operator{&,~}): Declare more bit manipulation operators for the enum visiting_kind. (function_suppression_sptr, function_suppressions_type): New typedefs. (function_suppression, function_suppression::parameter_spec): Declare new types. (read_function_suppressions): Declare new function. (diff_node_visitor::diff_node_visitor): Adjust for the enum visiting_kind change. Value-initialize the visiting_kind_ data member. * src/abg-comparison.cc (operator{&,~}): Define these operators for enum visiting_kind. (read_type_suppressions): Forward declare this static function. (read_function_suppression, read_parameter_spec_from_string): Define new static functions. (read_suppressions): Update to read function suppressions too, using the new read_function_suppression function above. (class function_suppression::parameter_spec::priv): Define new type. (function_suppression::parameter_spec::*): Define the member functions of the new function_suppression::parameter_spec type. (class function_suppression::priv): Define new type. (function_suppression::*): Define the member functions of the new function_suppression type. (diff::traverse): There is no more {PRE,POST}_VISITING_KIND enumerator. So nuke the code that was dealing with it. (redundancy_marking_visitor::skip_children_nodes_): New data member flag. (redundancy_marking_visitor::visit_begin): If the current diff node is not be reported (is filtered out), do not bother visit its children nodes for the purpose of marking redundant nodes. So use the new skip_children_nodes_ flag above to know we are in that case. (redundancy_marking_visitor::visit_end): Unset the new skip_children_nodes_ flag above when appropriate. * include/abg-fwd.h (is_function_decl): Declare new function. * include/abg-ir.h (function_type::get_parm_at_index_from_first_non_implicit_parm): Declare new member function. * src/abg-ir.cc (is_function_decl): Define new function. (function_type::get_parm_at_index_from_first_non_implicit_parm): Define new member function. * src/abg-comp-filter.cc (apply_filter): Adjust for the enum visiting_kind change. No need to set it for filters anymore * doc/suppr-doc.txt: Update examples of function suppression. * doc/manuals/libabigail-concepts.rst: Update the manual for the function suppression addition. * tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input. * tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input. * tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input. * tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input. * tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for new test input. * tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for new test input. * tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input. * tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for new test input. * tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for new test input. * tests/data/test-diff-suppr/test6-fn-suppr-version-script: New test input. * tests/Makefile.am: Add the new files above to source the distribution. * tests/test-diff-suppr.cc (in_out_specs): Add the test inputs above to the list of tests to be run by this harness. 2014-10-28 Dodji Seketeli Add missing virtual destructor in comparison engine code * include/abg-comparison.h (type_suppression::~type_suppression): Declare missing virtual destructor. * src/abg-comparison.cc (type_suppression::~type_suppression): Define missing virtual destructor. 2014-10-27 Dodji Seketeli Pimplify abigail::ir::function_type * include/abg-ir.h (function_type::priv_): Declare new data member. (function_type::): Move the inline methods out of line in src/abg-ir.cc. (function_type::{return_type_, parms_}): Move these ... * src/abg-ir.cc (function_type::priv::{return_type_, parms_}): ... Here. (struct function_type::priv): New type for the private data of function_type. (function_type::): Move the previously inline methods of function_type here. Adjust them to tap into priv_->* to get the private data members. 2014-10-27 Dodji Seketeli Light style fix * include/abg-ir.h (function_decl::get_type): Change the return type from shared_ptr to function_type_sptr. 2014-10-27 Dodji Seketeli Allow white spaces in ini file property values * src/abg-ini.cc (read_context::char_is_property_value_char): New member function. (read_context::read_next_char): Fix typos. Allow escaping of '[' and ']'. (read_context::read_property_value): Use the new read_context::char_is_property_value_char above. 2014-10-27 Dodji Seketeli Fix typo in suppression specification manual * doc/manuals/libabigail-concepts.rst: Fix name -> name_regexp. 2014-10-22 Dodji Seketeli Support comparing symbols not referenced by debug info * doc/manuals/abidiff.rst: Adjust intro to mention that w/o debug info, abidiff now works but just report about added/removed symbols. Add documentation about the new --no-unreferenced-symbols option. * include/abg-comparison.h (string_elf_symbol_map): New typedef. (diff_context::show_symbols_unreferenced_by_debug_info): Declare new accessors. * src/abg-comparison.cc (diff_context::priv::show_syms_unreferenced_by_di_): New data member. (diff_context::priv::priv): Adjust. (diff_context::show_symbols_unreferenced_by_debug_info): Implement these accessors. (corpus_diff::priv::{unrefed_fn_syms_edit_script_, unrefed_var_syms_edit_script_, added_unrefed_fn_syms_, deleted_unrefed_fn_syms_, added_unrefed_var_syms_, deleted_unrefed_var_syms_}): New data members. (corpus_diff::priv::diff_stats::{num_func_syms_removed, num_func_syms_added, num_var_syms_removed, num_var_syms_added}): New data members. (corpus_diff::priv::diff_stats::diff_stats): Adjust. (corpus_diff::ensure_lookup_tables_populated): Populate lookup tables for added/removed symbols that are not referenced by any debug info. (corpus_diff::priv::apply_filters_and_compute_diff_stats): Compute stats for the added/removed symbols not referenced by any debug info. (corpus_diff::priv::emit_diff_stats): Emit stats about added/removed symbols that are not referenced by any debug info. (corpus_diff::length): Adjust to take in account added/removed symbols not referenced by any debug info. (show_linkage_name_and_aliases): New static function. (corpus_diff::report): When emitting a symbol name, emit its version too, and tell if it aliases other symbols. Avoid emitted extra new lines. Report added/removed symbols not referenced by any debug info. (compute_diff): In the overload for corpus_sptr, compute the diffs for symbols not referenced by debug info. * include/abg-corpus.h (corpus::get_unreferenced_{function,variable}_symbols): Declare new member functions. * src/abg-corpus.cc (corpus_priv::{unrefed_fun_symbols, unrefed_var_symbols}): New data members. (corpus_priv::build_unreferenced_symbols_tables): Define new member function. (struct comp_elf_symbols_functor): New functor. (corpus::is_empty): Adjust to take in account added/removed symbols not referenced by debug info. (corpus::{get_unreferenced_function_symbols, corpus::get_unreferenced_variable_symbols}): Define these accessors. * include/abg-dwarf-reader.h (enum status): Transform this into bitfields. Add a STATUS_UNKNOWN value that has the value 0. (operator|(status, status), operator&(status, status)) (operator|=(status&, status), operator&=(status, status)): New bit-wise operators to manipulate instances of the status bit-field. * src/abg-dwarf-reader.cc (get_version_for_symbol): Fix this to avoid returning garbage version sometimes. (read_debug_info_into_corpus): Fix this to return a non-null but empty corpus_sptr when there is no debug info available. (operator|(status, status), operator&(status, status)) (operator|=(status&, status), operator&=(status, status)): Define these new bitwise operators to manipulate instances of the status bit-field. (read_corpus_from_elf): Now that the abigail::dwarf_reader::status is a bit-field, set it to reflect if debug info and/or symbol tables have been found. Do not bail out if debug info hasn't been found. Rather, keep going, and go look for symbols-only; this is a kind of operating in degraded mode. * include/abg-ir.h (elf_symbol::get_aliases_id_string): Add a flag that says if the current instance of elf_symbol should be included in the list of aliases or not. * src/abg-ir.cc (elf_symbol::get_aliases_id_string): Define it. * tests/data/test-diff-dwarf/test16-syms-only-v{0,1}.o: New test input. * tools/abidiff.cc (options::show_symbols_not_referenced_by_debug_info): New data member. (options:options): Adjust. (display_usage): Add an info string for the new --no-unreferenced-symbols command line option. (parse_command_line): Parse the new --no-unreferenced-symbols command line. (set_diff_context_from_opts): Set the diff_context according to the presence of --no-unreferenced-symbols. (main): Adjust for the fact that abigail::dwarf_reader::status is now a bit-field. * tools/abilint.cc (main): Adjust for the fact that abigail::dwarf_reader::status is now a bit-field.. (): * tests/data/test-diff-dwarf/test16-syms-only-report.txt: New test reference output. * tests/data/test-diff-dwarf/test16-syms-only-v{0,1}.cc: Source code for new test input. * tests/data/test-diff-dwarf/test17-non-refed-syms-v{0,1}.o: New test input. * tests/data/test-diff-dwarf/test17-non-refed-syms-v{0,1}.cc: New source code for test input. * tests/data/test-diff-dwarf/libtest18-alias-sym-v{0,1}.so: New test input. * tests/data/test-diff-dwarf/test18-alias-sym-report-0.txt: Reference output for new test input. * tests/data/test-diff-dwarf/test18-alias-sym-v{0,1}.cc: Source code for new test input. * tests/data/test-diff-dwarf/test18-alias-sym-version-script: Source code for new test input. * tests/Makefile.am: Add the new test materials to the source distribution. * tests/test-diff-dwarf.cc(in_out_specs): Add the new input tests above to the array of tests to run by this harness. (main): Emit empty reports for empty resulting diffs. * tests/data/test-diff-dwarf/test{0,8,9,12,14-inline-report,}-report.txt: Adjust. * tests/data/test-diff-filter/test{0,01,2,4,5,7,8,9,10,12,13,15-0,15-1}-report.txt: Likewise. * tests/data/test-diff-filter/test{19-enum,20-inline,}-report-0.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-report-{1,2}.txt: Likewise. * tests/data/test-diff-suppr/test{1,2}-typedef-suppr-report-1.txt: Likewise. 2014-10-22 Dodji Seketeli Allow comparison of shared_ptr of things * include/abg-diff-utils.h: Adjust copyright years. (deep_ptr_eq_functor::operator()(const shared_ptr, const shared_ptr)): New comparison operator. 2014-10-17 Dodji Seketeli Use the "standard" equality operator when comparing variables * src/abg-comparison.cc (compute_diff): In the overload for corpus_sptr, use the diff_utils::deep_ptr_eq_functor that is used to compare functions too, rather than the ad-hoc early struct var_eq_type we were using until now. 2014-10-16 Dodji Seketeli Yet another fix to the DWARF method "static-ness" detection heuristic * include/abg-fwd.h (is_pointer, is_qualified_type): Declare new functions. * src/abg-ir.cc (is_pointer, is_qualified_type): Implement these new functions. * src/abg-dwarf-reader.cc (finish_member_function_reading): Sometimes, the this pointer of a non-static method can point to a *qualified* version of its containing type. I am seeing that when comparing libstdc++.so from RHEL 6.5 and RHEL 7. Take that in account when trying to detect that the first parameter of a member function is the this pointer, and thus detect that the function is a non static member function. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi: New test input. * tests/data/test-read-dwarf/test8-qualified-this-pointer.so: New test input. * tests/data/test-read-dwarf/test8-qualified-this-pointer.cc: Source code of new test input. * tests/test-read-dwarf.cc: Update copyright year. (in_out_spec): Add the new test inputs to this array, so that this test harness runs on them. * tests/Makefile.am: Add the new test inputs to the source distribution. 2014-10-16 Dodji Seketeli Avoid infinite loops in the comparison code for classes * src/abg-ir.cc (equals): In the overload for classes, make sure to store the name of the lhs of the class and the rhs into the lhs. Also, when we bail out because we detect that there is a comparison underway, do *not* unmark the current class as not being involved in the comparison. Also, break at the first lhs virtual member function that is different from the rhs counter part. 2014-10-15 Dodji Seketeli Update the manual for the suppression specification initial work * doc/manuals/abidiff.rst: Add documentation for the new --suppressions command line switch. (--harmless, --harmful): Refer to the new "concepts" section below, where harmful/harmless concepts are now explained. (Notes): Move the content of the notes section where harmful/harmless concepts were explained, to the newly created 'Concepts' section. * doc/manuals/index.rst: Limit the depth of the table of content to 2. Add the new libabigail-concepts.rst stuff in here. Adjust for the renaming of tools.rst to libabigail-tools.rst. * doc/manuals/libabigail-concepts.rst: New file. 2014-10-13 Dodji Seketeli Properly propagate {REDUNDANT, SUPPRESSED}_CATEGORY wrt local changes * src/abg-comparison.cc (suppression_categorization_visitor::visit_end): If a diff node carries local changes, then, even if all of its children node have been suppressed, this diff node shall not be categorized as suppressed by way of propagation. (redundancy_marking_visitor::visit_end): If a diff node carries local changes, then, even if all of its children nodes are redundant, this diff node shall not be categorized as being redundant by way of propagation. * tests/data/test-diff-suppr/libtest4-local-suppr-v{0,1}.so: New test inputs. * tests/data/test-diff-suppr/test4-local-suppr-0.suppr: Likewise. * tests/data/test-diff-suppr/test4-local-suppr-report-{0,1}.txt: Likewise. * tests/data/test-diff-suppr/test4-local-suppr-v{0,1}.{c,h}: Source code of the new tests inputs. * tests/Makefile.am: Add the new test material to the source distribution. * tests/test-diff-suppr.cc (in_out_spec): Run this test harness over the new test input above. 2014-10-13 Dodji Seketeli Gain ability know if a diff node has local changes * include/abg-comparison.h (diff::has_local_changes): Add new pure interface. ({decl_diff_base, type_diff_base, distinct_type_diff, var_diff, pointer_diff, reference_diff, array_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, function_decl_diff, type_decl_diff, typedef_diff, translation_unit_diff}::has_local_changes): Declare the implementation of the pure interface above. * src/abg-comparison.cc ({decl_diff_base, type_diff_base, distinct_type_diff, var_diff, pointer_diff, reference_diff, array_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, function_decl_diff, type_decl_diff, typedef_diff, translation_unit_diff}::has_local_changes): Define the implementation of the pure interface above. 2014-10-13 Dodji Seketeli Write comparison functions that hint at the kind of changes they see * include/abg-ir.h (enum change_kind): Declare new enum. (operator|(change_kind, change_kind), operator&(change_kind, change_kind), operator|=(change_kind&, change_kind)): Declare new bit-wise operators for the new enum change_kind. (equals): Declare this new comparison function for decl_base, scope_decl, type_base, type_decl, scope_type_decl, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, function_type, class_decl, and class_decl::base_spec. (class_decl::base_spec::operator(const decl_base&)): Declare new equality operator. * src/abg-ir.cc (operator|(change_kind l, change_kind r)) (operator&(change_kind l, change_kind r), operator|=(change_kind& l, change_kind r), operator&=(change_kind& l, change_kind r)): Define these new operators. (equals): Define this new comparison function for decl_base, scope_decl, type_base, type_decl, scope_type_decl, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, function_type, class_decl, and class_decl::base_spec. ({decl_base, scope_decl, type_base, type_decl, scope_type_decl, qualified_type_def, pointer_type_def, reference_type_def, array_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, function_type, class_decl, class_decl::base_spec}::operator==): Re-write these comparison operators in terms of their relevant equal() functions. 2014-09-22 Dodji Seketeli Fix struct type kind suppression support * src/abg-comparison.cc (type_suppression::suppresses_diff): Do not crash on diff nodes that are not about struct/classes, when "type_kind = struct" has been specified. * tests/data/test-diff-suppr/test2-struct-suppr-{0,1}.suppr: New test input. * tests/data/test-diff-suppr/test2-struct-suppr-report-{0,1}.txt: Likewise. * tests/data/test-diff-suppr/test2-struct-suppr-v{0,1}.o: Likewise * tests/data/test-diff-suppr/test2-struct-suppr-v{1,0}.cc: Source code for binary test input. * tests/test-diff-suppr.cc (in_out_spec): Run this harness on the new test input above. * tests/Makefile.am: Add the new test input files to source distribution. 2014-09-22 Dodji Seketeli Replace is_typedef by type_kind property in type suppressions * doc/suppr-doc.txt: Add type_kind property "documentation" in the type suppression. * include/abg-comparison.h (type_suppression::type_kind): New enum. (type_suppression::{get_consider_typedefness, set_consider_typedefness, get_is_typedef, set_is_typedef}): Remove. (type_suppression::{get_consider_type_kind, set_consider_type_kind, get_type_kind, set_type_kind}): Declare new methods. * Include/abg-fwd.h (is_type_decl): Declare new function. (is_enum): Declare new overload that takes a type_base_sptr. * src/abg-comparison.cc (type_suppression::priv::{consider_typedefness_, is_typedef_}): Remove these data members. (type_suppression::priv::{consider_type_kind_, type_kind_}): New data members. (type_suppression::priv::priv): Adjust. (type_suppression::{get_consider_typedefness, set_consider_typedefness, get_is_typedef, set_is_typedef}): Remove these member functions. (type_suppression::{get_consider_type_kind, set_consider_type_kind, get_type_kind, set_type_kind}): Define these new member functions. (type_suppression::suppresses_diff): Adjust to consider the kind of types more generally than just considering typedef-ness. (read_type_kind_string): New static function. (read_type_suppression): Use the above to parse the value of the new type_kind property. Adjust the creation of the resulting type_suppression object. * src/abg-ir.cc (is_type_decl): Define new function. * tests/data/test-diff-suppr/test1-typedef-suppr-0.suppr: Adjust. * tests/data/test-diff-suppr/test1-typedef-suppr-1.suppr: Adjust. 2014-09-19 Dodji Seketeli Initial support for type suppressions * include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY): New enumerator. (diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY, VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for these. (diff::EVERYTHING_CATEGORY): Adjust. (suppression_base, type_suppression): Declare new types. (suppression_ptr, suppressions_type, type_suppression_sptr) (type_suppressions_type): New typedefs. (read_type_suppressions, read_suppressions): Declare new functions. (diff_context::{suppressions, add_suppression, add_suppressions}): Declare new methods. (diff::is_suppressed): Declare new member function. (apply_suppressions): Declare new function & overloads. * src/abg-comparison.cc (is_type_diff): Define new static function. ({suppression_base, type_suppression}::priv): Define new types. ({suppression_base, type_suppression}::*): Define the methods of the new suppression_base, type_suppressions types. (read_type_suppression, read_type_suppressions, read_suppressions) (read_type_suppressions): Define new static functions. (diff_context::priv::supprssions_): New data member. (diff_context::{suppressions, add_suppression, add_suppressions}): New methods. (diff::is_filtered_out): Consider that a diff node that is in the SUPPRESSED_CATEGORY is filtered out. (diff::is_suppressed): Define new member function. (operator<<(ostream& o, diff_category c)): Support the SUPPRESSED_CATEGORY category. (corpus_diff::report): Apply suppressions before reporting anything. (category_propagation_visitor::visit_end): Do not propagate SUPPRESSED_CATEGORY. This is just like what we do for REDUNDANT_CATEGORY. (struct suppression_categorization_visitor): New visitor. (apply_suppressions): Define function & overloads. * include/abg-ini.h (config::section::find_property): New method. (config::section): Fix end of class comment. * src/abg-ini.cc (config::section::find_property): Define new method. * tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New test input files. * tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise. * tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code for new test input. * tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test input files. * tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code for new test input files. * tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise * tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New test input files. * tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise. * tests/test-diff-suppr.cc: New test harness to run type suppression tests using the input files above. * tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input. * tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise. * tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise. * tests/Makefile.am: Build the new runtestdiffsuppr test harness from the test-diff-filter.cc file. Add the new test files to the build system and source distribution. * tools/bidiff.cc (options::suppressions): New data member. (display_usage): Add a help string for the new --suppressions command line switch. (parse_command_line): Parse the --suppressions command line switch. (set_diff_context_from_opts): Read the suppressions provided by the --suppression command line switch and stuff them into the diff context. 2014-09-19 Dodji Seketeli Make all type diff types extend new type_diff_base type * include/abg-comparison.h (type_diff_base, decl_diff_base): New types. (type_diff_base_sptr): New typedef. (pointer_diff, reference_diff, array_diff, qualified_type_diff) (enum_diff, class_diff, type_decl_diff, typedef_diff): Make this extend the new type_diff_base. * src/abg-comparison.cc (type_diff_base::priv, type_diff_base): Define these new types and their methods. (pointer_diff::pointer_diff, array_diff::array_diff) (reference_diff::reference_diff) (qualified_type_diff::qualified_type_diff, enum_diff::enum_diff) (class_diff::class_diff, type_decl_diff::type_decl_diff) (typedef_diff::typedef_diff): Adjust. 2014-09-18 Dodji Seketeli Rename abigail::ini::config::section_vector to sections_type * include/abg-ini.h (abigail::ini::config::sections_type): Renamed section_vector into this. (config::{get_sections, set_sections, read_sections, write_sections}): Adjust. * src/abg-ini.cc (config::priv::sections_): Adjust. (config::priv::priv): Likewise. (config::{config, get_sections}): Likewise. (read_sections, read_config, write_sections): Likewise. 2014-09-08 Dodji Seketeli Implement the abigail::ini::config abstraction * include/abg-ini.h (config::config): Add an overload that take a path and sections. (config::{get,set}_sections): New accessors. (read_sections): Rename the previous read_config() functions into these. (read_config): Add these function declarations to really act on instances of abigail::ini::config. (write_section): Rename the previous write_config functions into these. (write_config): Add these function declarations to really act on instances of abigail::ini::config. * src/abg-ini.cc (class config::priv): Implement this. (config::{config, ~config, get_path, set_path, get_sections, set_sections}): Define these new methods. (read_sections): Rename the former read_config into this. (read_config): Add this function definitions to really act on instances of abigail::ini::config. (write_sections): Rename the former write_config into this. (write_config):: Add this function definitions to really act on instances of abigail::ini::config. * tools/binilint.cc (main): Adjust. 2014-09-05 Dodji Seketeli Initial support of ini-style file parsing * include/abg-ini.h: New file. * include/Makefile.am: Add include/abg-ini.h to the source distribution. * src/abg-ini.cc: New file. * src/Makefile.am: Add src/abg-ini.cc to the source distribution. * tools/binilint.cc: New testing tool. * tools/Makefile.am: Add tools/binilint.cc to the source distribution. 2014-09-03 Dodji Seketeli Initial examples of suppression list specifications * doc/suppr-doc.txt: New file. 2014-10-11 Dodji Seketeli Put IR artifacts in the abigail::ir namespace * include/abg-fwd.h: Wrap IR artifacts into abigail::ir namespace. Inject that new abigail::ir namespace into the abigail namespace. * include/abg-ir.h: Wrap IR artifacts into abigail::ir namespace. (function_decl::parameter::get_type_name): Adjust the call to abigail::get_type_name. It's now a call to abigail::ir::get_type_name. * src/abg-ir.cc: Wrap IR artifacts into abigail::ir namespace. * include/abg-traverse.h: Wrap the ir traversing artifact into the abigail::ir namespace too. * src/abg-traverse.cc: Adjust. * include/abg-corpus.h: Wrap corpus type stuff into abigail::ir. * include/abg-dwarf-reader.h: Inject namespace abigail::ir stuff into the abigail::dwarf_reader namespace. * include/abg-reader.h: Inject namespace abigail::ir stuff into the abigail::xml_reader namespace. * src/abg-reader.cc: Adjust. * include/abg-writer.h: Inject namespace abigail::ir stuff into the abigail::xml_writer namespace. * src/abg-writer.cc: Inject namespace abigail::ir stuff into abigail namespace here too. * src/abg-hash.cc: Inject the abigail::ir namespace into the abigail namespace. * tools/abg-tools-utils.cc: Adjust for the injection of abigail::function_decl. It's now abigail::ir::function_decl. 2014-10-13 Dodji Seketeli Misc style cleanups * src/abg-comparison.cc: ({pointer_diff, reference_diff}::length): Add some vertical spaces here. 2014-10-13 Dodji Seketeli constify dm_context_rel::operator== * include/abg-ir.h (dm_context_rel::operator==): Make this const. 2014-10-13 Dodji Seketeli A distinct_diff node has no children node * src/abg-comparison.cc (distinct_diff::chain_into_hierarchy): Do not append any children node here. 2014-10-13 Dodji Seketeli Remove useless redundant_filter * include/abg-comp-filter.h (class redundant_filter): Remove this now useless type declaration * src/abg-comparison.cc (filtering::redundant_filter::visit): Remove this useless member function definition. 2014-10-10 Dodji Seketeli Sort diff reports about function parameters by their indexes * include/abg-comparison.h (changed_parms_type): New convenience typedef. * src/abg-comparison.cc (struct changed_parm_comp): New comparison functor. (sort_changed_parm_map): New sorting function. (function_decl_diff::report): Use the new sort_changed_parm_map to sort the diffs for function parameters by their indexes. 2014-10-10 Dodji Seketeli Don't be too eager to use distinct_diff * src/abg-comparison.cc (try_to_diff): For this to actually select a diff kind, the two diff subject must be of type 'DiffType'. (compute_diff_for_types, compute_diff_for_decls): Use distinct_diff in last resort. 2014-10-10 Dodji Seketeli Implement generic diff tree walking and port categorization over it * include/abg-comp-filter.h (apply_filter): Declare new overload that takes a corpus_diff_sptr ... * src/abg-comp-filter.cc (apply_filter): ... and define it. On the existing overload for diff_sptr, make sure to traverse all diff nodes, even those that have already been traversed. * include/abg-comparison.h (enum diff_category): Remove NOT_REDUNDANT_CATEGORY, add REDUNDANT_CATEGORY. (operator&=, +operator<<): Declare new operators for enum diff_category. (diff_context::{forbid_traversing_a_node_twice, traversing_a_node_twice_is_forbidden): (diff_context::categorizing_redundancy): Remove this declaration. (diff_context::maybe_apply_filters): Declare a new overload that takes a corpus_diff_sptr. And a take a new flag that says if it should visit all nodes including those that have already been visited. (diff::priv_): Make this data member protected. (diff::{begin_traversing, is_traversing, end_traversing, finish_diff_type, children_nodes, append_child_node, get_pretty_representation, chain_into_hierarchy, traverse}): Declare new member functions. (distinct_diff::{finish_diff_type, get_pretty_representation, chain_into_hierarchy}): Likewise. (distinct_diff::traverse): Remove. (pointer_diff::pointer_diff): Take the underlying type diff in parameter. (pointer_diff::{finish_diff_type, get_pretty_representation, chain_into_hierarchy}): Declare new member functions. (pointer_diff::traverse): Remove. (reference_type_def::reference_type_def): Take the underlying type diff in parameter. ({array_type_def, reference_type_def}::{finish_diff_type, get_pretty_representation, chain_into_hierarchy}): Declare new member functions. ({array_type_diff, reference_type_def}::traverse): Remove. (qualified_type_diff::qualified_type_diff): Take the underlying type diff in parameter. ({enum_diff, qualified_type_diff, class_diff}::{finish_diff_type, get_pretty_representation, chain_into_hierarchy}): Declare new member functions. ({enum_diff, qualified_type_diff, class_diff}::traverse): Remove. (is_class_diff): Declare new function. (base_diff::base_diff): Take the underlying type diff in parameter. ({scope_diff, base_diff}::{finish_diff_type, get_pretty_representation, chain_into_hierarchy}): Declare new member functions. ({scope_diff, base_diff}::traverse): Remove. (function_decl_diff::function_decl_diff): Take the return type diff as parameter. ({function_decl_diff, type_decl_diff}::{finish_diff_type, get_pretty_representation, chain_into_hierarchy}): Declare new member functions. ({function_decl_diff, type_decl_diff}::traverse): Remove. (typedef_diff::typedef_diff): Take the underlying type diff as parameter. (typedef::{finish_diff_type, get_pretty_representation, chain_into_hierarchy}): Declare new member functions. ({typedef, translation_unit_diff}::traverse): Remove member function. (corpus_diff::{finish_diff_type, children_nodes, append_child_node, changed_variables, get_pretty_representation, chain_into_hierarchy}): Declare new member functions. (class diff_node_visitor::{visit_begin, visit_end}): Declare new member functions. (propagate_categories, print_diff_tree, categorizing_redundancy) (clear_redundancy_categorization, apply_filters): New functions and function overloads. * src/abg-comparison.cc (TRY_PRE_VISIT, TRY_PRE_VISIT_CLASS_DIFF) (TRY_POST_VISIT, TRY_POST_VISIT_CLASS_DIFF) (CATEGORIZE_REDUNDANCY_FROM_CHILD_NODE) (UPDATE_REDUNDANCY_CATEGORIZATION_FROM_NODE_SUBTREE) (TRAVERSE_DIFF_NODE_AND_PROPAGATE_CATEGORY) (TRAVERSE_MEM_DIFF_NODE_AND_PROPAGATE_CATEGORY) (TRAVERSE_MEM_FN_DIFF_NODE_AND_PROPAGATE_CATEGORY) (ENSURE_DIFF_NODE_TRAVERSED_ONCE) (ENSURE_MEM_DIFF_NODE_TRAVERSED_ONCE): Remove these macros. Hurrah. (diff_context::priv::categorizing_redundancy_): Remove. (diff_context::priv::forbid_traversing_a_node_twice_): Add new data member. (diff_context::priv::priv): Adjust. (diff_context::{forbid_traversing_a_node_twice, traversing_a_node_twice_is_forbidden}): Define new member functions. (diff_context::maybe_apply_filters): Once filters are applied (and categories are set to the relevant diff tree nodes, run a pass over the diff tree to propagate the categories to the relevant diff tree parent nodes. Add an overload for corpus_diff_sptr. (diff_context::categorizing_redundancy): Remove member function. (diff_context::maybe_apply_filters): Define a new overload for corpus_diff_sptr (struct diff::priv::{finished_, traversing_, children_, pretty_representation_}): New data members. (diff::priv::priv): Adjust. (diff::{begin_traversing, is_traversing, end_traversing, finish_diff_type, children_nodes, append_child_node, traverse, set_category, get_pretty_representation, chain_into_hierarchy}): Define new member functions. (diff::is_filtered_out): Do not refer to NOT_REDUNDANT_CATEGORY anymore. Rather, use the new REDUNDANT_CATEGORY. ({distinct_diff, var_diff, pointer_diff, array_diff, reference_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, function_decl_diff, type_decl_diff, typedef_diff}::{get_pretty_representation, chain_into_hierarchy, finish_diff_type}): Define new member functions. ({distinct_diff, var_diff, pointer_diff, array_diff, reference_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, function_decl_diff, type_decl_diff, typedef_diff, translation_unit_diff}::traverse): Remove member functions. (operator&=, operator<<): Define new operators for diff_category. ({function_decl_diff, typedef_diff}::priv::priv): Add a new constructor. (pointer_diff::{priv::priv, pointer_diff}) (reference_diff::{priv::priv, reference_diff}) (qualified_type_diff::{priv::priv, qualified_type_diff}) (enum_diff::{priv::priv, enum_diff}, base_diff::{priv::priv, base_diff}, function_decl_diff::function_decl_diff): Take the underlying type diff in parameter. (compute_diff): Adjust the pointer_diff, reference_diff, qualified_type_diff, base_diff, function_decl_diff overloads. (class_diff::priv::{count_filtered_bases, count_filtered_subtype_changed_dm, count_filtered_changed_dm, count_filtered_changed_mem_fns, count_filtered_inserted_mem_fns, count_filtered_deleted_mem_fns}): Adjust for the call to diff_context::maybe_apply_filters. (corpus_diff::priv::{finished_, pretty_representation_}): New data member. (corpus_diff::priv::priv): New constructor. (corpus_diff::priv::clear_redundancy_categorization): Define new member function. (corpus_diff::priv::apply_filters_and_compute_diff_stats): Adjust for call to diff_context::maybe_apply_filters. Also, call clear_redundancy_categorization at the end. (corpus_diff::priv::categorize_redundant_changed_sub_nodes): Revisit logic. (corpus_diff::{chain_into_hierarchy, finish_diff_type, children_nodes, append_child_node, changed_variables, get_pretty_representation}): Define new member functions. (corpus_diff::report): Categorize redundancy for every top level function/variable diff. (corpus_diff::traverse): Adjust to the new traversing interface. (diff_node_visitor::{visit_begin, visit_end}): Define new member functions. (struct category_propagation_visitor, struct diff_node_printer) (struct redundancy_marking_visitor, struct redundancy_clearing_visitor): New diff tree node visitors. (propagate_categories, print_diff_tree, categorize_redundancy) (clear_redundancy_categorization, apply_filters): Define new functions. * tests/Makefile.am: Add the new tests/print-diff-tree.cc to the source distribution. Build it into a tests/printdifftree binary. * tools/abidiff.cc (print_diff_tree): Add debugging functions to call from within the debugger. By default, this function and its overloads are not compiled. 2014-10-10 Dodji Seketeli Update copyright notice for tests/test-diff2.cc * tests/test-diff2.cc: Update copyright year. 2014-10-09 Dodji Seketeli Do not crash on function_decl_diff for fns that have no symbol * src/abg-comparison.cc (function_decl_diff::report): If a function decl has no associated elf symbol, do not crash while trying to report about its elf symbol aliases. 2014-10-09 Dodji Seketeli Avoid broken output for virtual member fns w/o symbols * src/abg-comparison.cc (represent): When a virtual member function has no associated elf symbol, do not emit garbage in lieu of the linkage name. Just emit no linkage name; * tests/data/test-abidiff/test-struct1-report.txt: Adjust. 2014-10-02 Dodji Seketeli Sort added/removed/changed functions reported by the comparison engine * src/abg-comparison.cc (struct function_comp, struct changed_function_ptr_comp): New comparison functors. (sort_string_function_ptr_map) (sort_string_changed_function_ptr_map): Define new static functions. (corpus_diff::report): Sort the added/removed/changed functions that are reported. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. * tests/data/test-diff-filter/test01-report.txt: Adjust. * tests/data/test-diff-filter/test2-report.txt: Adjust. * tests/data/test-diff-filter/test9-report.txt: Adjust. 2014-10-02 Dodji Seketeli Mention virtual-ness of member function in their pretty representation * include/abg-fwd.h (get_member_function_is_virtual): Declare new overload for pointers. * src/abg-ir.cc (get_member_function_is_virtual): Define it. (function_decl::get_pretty_representation): Print virtual-ness of the function_decl being pretty printed. 2014-10-02 Dodji Seketeli Do not crash when reporting diffs about virtual member fns that have no symbol * src/abg-comparison.cc (represent): If a virtual member function has no symbol do not crash. 2014-10-02 Dodji Seketeli Fixup member functions which virtual-ness has just been set * include/abg-ir.h (fixup_virtual_member_function): Declare new function. (class_decl): Declare fixup_virtual_member_function() as a member. * src/abg-ir.cc (set_member_function_is_virtual): Ensure that the member function that has seen its virtualness set is also put correctly put in the vector of virtual member functions of its class. 2014-10-02 Dodji Seketeli Assert that only decls with elf symbols are part of comparison * src/abg-corpus.cc (corpus::priv::build_public_decl_table): Assert that when read from DWARF, only decls with elf symbols are part of the public decls table. 2014-10-02 Dodji Seketeli Emit all virtual member functions in group * src/abg-writer.cc (write_class_decl): Emit virtual member functions contiguously. 2014-10-02 Dodji Seketeli Always emit vtable offset for virtual member function * src/abg-writer.cc (write_voffset): Emit the vtable offset of virtual function even when the offset is zero. 2014-10-02 Dodji Seketeli Do not forget priv_->in_pub_sym_tab_ when copying decl_base * src/abg-ir.cc (decl_base::decl_base(const decl_base& d)): Do not forget to copy priv_->in_pub_sym_tab_. 2014-10-01 Dodji Seketeli Fix reading several clones of the same member function from DWARF * include/abg-fwd.h (set_member_function_is_ctor) (set_member_function_is_dtor, set_member_function_is_const) (set_member_function_vtable_offset): Declare new functions. * include/abg-ir.h (class_decl::sort_virtual_mem_fns): Declare new member function. (mem_fn_context_rel::{vtable_offset, is_constructor is_destructor, is_const}): Add these setters. (set_member_function_is_ctor, set_member_function_is_dtor) (set_member_function_is_static, set_member_function_is_const) (set_member_function_vtable_offset) (set_member_function_is_virtual): Declare these new friend function to class class_decl::method_decl. * src/abg-dwarf-reader.cc (finish_member_function_reading): Split this out from build_class_type_and_add_to_ir. Use the new setters for member functions properties introduced above. (build_class_type_and_add_to_ir): Factorize the creation of member function by using build_ir_node_from_die. Once that function has created the member function in a rather generic way, use the new finish_member_function_reading to set the remaining specific properties for member functions. (build_function_decl): When called to read additional properties of a function_decl, allow this to read and update the elf symbol properties too. This is useful for building a clone of a function that already has an elf symbol. (build_ir_node_from_die): When building a function decl, consider the case of a DIE that has both DW_AT_specification and DW_AT_abstract_origin set. That is, DW_AT_abstract_origin is set, and the origin has DW_AT_specification set. This is basically a clone of a function that implements an interface (this happens for destructors, for instance). In this case, really do the cloning of the interface implementation. If the cloned function happens to be member function, use finish_member_function_reading to read the properties relevant to its method-ness. * src/abg-ir.cc (set_member_function_is_ctor) (set_member_function_is_dtor, set_member_function_is_const) (set_member_function_vtable_offset) (class_decl::sort_virtual_mem_fns): Define new functions. (sort_virtual_member_functions): Define new static function. (struct virtual_member_function_less_than): New functor. (class_decl::add_member_function): Keep virtual member functions vector sorted. * data/test-read-dwarf/test1.abi: Adjust. Now, both the cdtor specification and all the clones that implements the different are emitted. * data/test-read-dwarf/test2.so.abi: Likewise. 2014-10-01 Dodji Seketeli Do not crash when comparing functions that have no symbol * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Just skip functions that have no ELF symbol. 2014-09-30 Dodji Seketeli Rename member_function_is_virtual to get_member_function_is_virtual * include/abg-fwd.h (get_member_function_is_virtual): Renamed the declaration of member_function_is_virtual into this. * src/abg-ir.cc (get_member_function_is_virtual): Likewise for its definition. * include/abg-ir.h (class decl_base): Adjust the friend function member_function_is_virtual references. * src/abg-comp-filter.cc (has_virtual_mem_fn_change) (has_non_virtual_mem_fn_change): Adjust. * src/abg-comparison.cc (represent) (SKIP_MEM_FN_IF_VIRTUALITY_DISALLOWED, class_diff::report): Likewise. * src/abg-hash.cc (class_decl::hash::operator()): Likewise. (function_decl::clone, class_decl::add_member_function): Adjust. 2014-09-30 Dodji Seketeli Factorize a no-op deleter for shared pointer * include/abg-sptr-utils.h (struct noop_deleter): Move this here from ... * src/abg-comparison.cc (struct noop_deleter): ... here. 2014-09-30 Dodji Seketeli Link manuals from the main web page * doc/website/mainpage.txt: Add a link to the manuals. 2014-09-26 Dodji Seketeli Initial documentation for libabigail * doc/manuals/Makefile: New file, generated by sphinx-quickstart. * doc/manuals/abidiff.rst: New manual for abidiff. * doc/manuals/abidw.rst: New manual for abidw. * doc/manuals/abilint.rst: New manual for abilint. * doc/manuals/conf.py: New configuration file generated by sphinx-quickstart. * doc/manuals/index.rst: The root of the this documentation. * doc/manuals/libabigail-overview.rst: The overview of libabigail. * doc/manuals/tools.rst: The root of the tools manuals. 2014-09-26 Dodji Seketeli Do not install the abisym program * tools/Makefile.am: Do not install abisym. It's really there just for testing purposes and is of almost no use for generic users. 2014-09-26 Dodji Seketeli Rename bi* tools to abi* tools * tests/data/test-bidiff: Rename this directory to tests/data/test-abidiff. * tests/test-bidiff.cc: Renamed this to tests/test-abidiff.cc. * tools/biar.cc: Renamed to tools/abiar.cc * tools/bidiff.cc: Renamed to tools/abidiff.cc * tools/bidw.cc: Renamed to tools/abidw.cc * tools/bilint.cc: Renamed to tools/abilint.cc * tools/bisym.cc: Renamed to tools/abisym.cc * tests/test-alt-dwarf-file.cc: Renamed references to bidw* to abidw*. * tests/test-diff-filter.cc: Renamed references to bidiff to abidiff. * tests/test-lookup-syms.cc: Renamed references to bisym to abisym. * tools/Makefile.am: Adjust. * tests/Makefile.am: Likewise. 2014-09-19 Dodji Seketeli Light cleanup in abg-corpus.cc * src/abg-corpus.cc (symtab_build_visitor_type::regex_fns_suppress): use sptr_utils::build_sptr, rather than building the shared_ptr of regex_t by hand. 2014-09-18 Dodji Seketeli Pimplify abigail::comparison::diff type * include/abg-comparison.h (diff::{priv, sptr}): New types. (diff::priv_): New member. (diff::*): Remove all the other previous data members and transform the inline member function definition into declarations only. * src/abg-comparison.cc (class diff::priv): New private data type. (diff::*): Define the previous inline member functions as out-of-line here. 2014-09-18 Dodji Seketeli Rename shared_ptr into regex_t_sptr * include/abg-sptr-utils.h (build_sptr()): Rename the return type from shared_ptr to regex_t_sptr. 2014-09-19 Dodji Seketeli Fix a comment in abg-comparison.h * include/abg-comparison.h (class base_diff): Fix comment. 2014-09-05 Dodji Seketeli Light style cleanup in tools/bidiff.cc * tools/bidiff.cc (display_usage): Remove useless space before '&'. 2014-09-05 Dodji Seketeli src/Makefile.am cleanup * src/Makefile.am: Remove the unused 'headers' variable. 2014-09-16 Dodji Seketeli Emit reports about not-yet categorized diff nodes * include/abg-comparison.h (NO_CHANGE_CATEGORY): Better comment this enumerator. * src/abg-comparison.cc (diff::is_filtered_out): Not-yet categorized changes are not filtered out anymore. (distinct_diff::report): Avoid extraneous new line here. 2014-09-16 Dodji Seketeli Better support for inline related diffs * include/abg-comparison.h (diff_category::HARMLESS_SYMBOL_ALIAS_CHANGE_CATEORY): New enumerator. (diff_category::EVERYTHING_CATEGORY): Adjust. * include/abg-ir.h (elf_symbol::get_aliases_id_string) (elf_symbol::does_alias, elf_symbols_alias) (compute_aliases_for_elf_symbol): Declare new functions ... * src/abg-ir.cc (elf_symbol::get_aliases_id_string) (elf_symbol::does_alias, elf_symbols_alias) (compute_aliases_for_elf_symbol): ... and define them. (function_decl::operator==): Take in account elf symbol aliases. * src/abg-comp-filter.cc (function_name_changed_but_not_symbol): Define new static functions. (harmless_filter::visit): Categorize function name changes that n doesn't impact underlying elf symbols (or the fact that two symbols were aliases and are not anymore) as harmless. * src/abg-comparison.cc (function_decl_diff::report): Properly report function name changes, or symbol aliases changes for that matter. Also report inline-ness declaration changes. * src/abg-dwarf-reader.cc (die_is_declared_inline): New static function. (build_function_decl): Use the above. * tools/bidiff.cc (set_diff_context_from_opts): Add abigail::comparison::HARMLESS_SYMBOL_ALIAS_CHANGE_CATEORY into the harmless change camp. * tests/data/test-diff-dwarf/test14-inline-report.txt: New test input. * tests/data/test-diff-dwarf/test14-inline-v0.o: Likewise. * tests/data/test-diff-dwarf/test14-inline-v1.o: Likewise. * tests/data/test-diff-dwarf/test14-inline-v0.cc: Source code for test input. * tests/data/test-diff-dwarf/test14-inline-v1.cc: Source code for test input. * tests/test-diff-dwarf.cc: Run this test harness over the new input above. * tests/data/test-diff-filter/test20-inline-report-0.txt: Likewise. * tests/data/test-diff-filter/test20-inline-report-1.txt: Likewise. * tests/data/test-diff-filter/test20-inline-v0.o: New test input. * tests/data/test-diff-filter/test20-inline-v1.o: New test input. * tests/data/test-diff-filter/test20-inline-v0.cc: Source code for test input. * tests/data/test-diff-filter/test20-inline-v1.cc: Likewise. * tests/test-diff-filter.cc: Run this test harness over the new input above. 2014-09-16 Dodji Seketeli Better support for enum diffs * include/abg-comparison.h (changed_enumerator_type): New typedef. (diff_category::{HARMLESS_ENUM_CHANGE_CATEGORY}): New enumerator. * src/abg-comp-filter.cc (has_type_size_change) (has_enumerator_insertion, has_enumerator_removal_or_change) (has_harmful_enum_change): New functions. (harmless_filter::visit): Categorize enumerator insertions that don't change the size of the type into HARMLESS_ENUM_CHANGE_CATEGORY. (harmful_filter::visit): Categorize enumerator removal or any enum change that changes the size of the type into SIZE_OR_OFFSET_CHANGE_CATEGORY. * src/abg-comparison.cc (enumerator_value_comp) (changed_enumerator_comp): New types. (sort_enumerators, sort_changed_enumerators): New static functions. (enum_diff::report): Sort enum related reports by the value of the enumerators. * src/abg-dwarf-reader.cc (build_enum_type): Name anonymous enums as __anonymous_enum__. * tools/bidiff.cc (set_diff_context_from_opts): Add abigail::comparison::HARMLESS_ENUM_CHANGE_CATEGORY into the harmless stuff camp. * tests/data/test-diff-dwarf/test15-enum-report.txt: New test input. * tests/data/test-diff-dwarf/test15-enum-v1.o: Likewise. * tests/data/test-diff-dwarf/test15-enum-v0.o: Likewise. * tests/data/test-diff-dwarf/test15-enum-v0.cc: Source code for test input. * tests/data/test-diff-dwarf/test15-enum-v1.cc: Likewise. * tests/data/test-diff-filter/test19-enum-report-0.txt: New test input. * tests/data/test-diff-filter/test19-enum-report-1.txt: Likewise. * tests/data/test-diff-filter/test19-enum-v0.o: Likewise. * tests/data/test-diff-filter/test19-enum-v1.o: Likewise. * tests/data/test-diff-filter/test19-enum-v0.cc: Source code for test input. * tests/data/test-diff-filter/test19-enum-v1.cc: Likewise. * tests/test-diff-dwarf.cc: Run this test harness on the new test inputs above. * tests/test-diff-filter.cc: Likewise. * tests/Makefile.am: Add the new files above to the source distribution. 2014-09-16 Dodji Seketeli Add constness to elf_symbol::operator== * include/abg-ir.h (elf_symbol::operator==): Add a const to the declaration ... * src/abg-ir.cc (elf_symbol::operator==): ... and to the definition. 2014-09-15 Dodji Seketeli Misc style cleanups * src/abg-comparison.cc (ChangedDataMemberComp): Rename this to changed_data_member_comp (sort_changed_data_members): Adjust. (DataMemberComp): Rename this to data_member_comp. (sort_data_members): Adjust. 2014-09-15 Dodji Seketeli Constify some function parameters in abg-comp-filter.cc * src/abg-comp-filter.cc (type_size_changed): Now take const parameters. 2014-09-09 Jan Engelhardt Add .gitignore files. * .gitignore: Add new file. * m4/.gitignore: Likewise. * tools/.gitignore: Likewise. 2014-09-09 Jan Engelhardt Place -L/-l flags into *_LIBADD/*_LDADD * src/Makefile.am: -L and -l ought to be in LIBADD/LDADD because that is the only place guaranteed to be in the right spot. So add Them to libabigail_la_LIBADD. * tools/Makefile.am: Likewise. 2014-09-09 Jan Engelhardt Add libelf to libabigail.la's linker line * configure.ac: Check for the existence of libelf at configure time by looking at the presence of the elf_end symbol. Add the libelf to the link command line. 2014-09-09 Jan Engelhardt Drop hardcoded substitutions * doc/Makefile.am: Do not use @docdir@. It's indeed replaced at configure time. But there is no need for this limitation with automake, as $(docdir) is available and replaceable anytime. * src/Makefile.am: Likewise for @DEPS_LIBS@ and @DEPS_CFLAGS@. 2014-09-09 Jan Engelhardt Replace indirect variable assignments * configure.ac(DEVEL_CFLAGS, DEVEL_CXXFLAGS): Remove these useless variables. (CFLAGS, CXXFLAGS): Set these variables directly. * include/Makefile.am (pkginclude_HEADERS): Use this predefined variable. (publicheaders_DATA, publicheadersdir): Remove these. 2014-09-09 Jan Engelhardt Remove empty and autogenerated files from git repository * ChangeLog: Remove this empty file for now. It'll be added back right before the first release by automatic generation from the commit logs. * INSTALL: Remove this empty file for now. * NEWS: Remove this empty file for now. It'll be added back right before the first release. * configure.ac (AM_INIT_AUTOMAKE): As the mandatory but empty files above are being removed for now, let's put in the 'foreign' mode of automake for the moment. We'll likely remove it at release time. 2014-09-09 Jan Engelhardt Set automake options globally * configure.ac(AM_INIT_AUTOMAKE): Set the subdir-object option here .. * src/Makefile.am: ... not here. * tests/Makefile.am: Likewise. * tools/Makefile.am: Likewise. 2014-09-09 Jan Engelhardt Stash some autogenerated tools in build-aux/ * configure.ac: Reduce the pollution in the top-level directory a bit. 2014-09-10 Dodji Seketeli Fix memory leaks due to cycles in types ownership * include/abg-fwd.h (std::tr1::weak_ptr): Inject this type in the abigail namespace. * include/abg-ir.h: Write a memory management guideline for the IR artifacts. (Type_base_wptr, function_type_wptr) (class_decl_wptr): New typedefs. (translation_unit::get_canonical_function_type): Declare new member function. (qualified_type_def::underlying_type_) (reference_type_def::pointed_to_type_) (typedef_decl::underlying_type_, function_decl::parameter::type_) (function_type::return_type_, method_type::class_type_) (non_type_tparameter::type_, type_composition::type_): Make this a weak pointer. (qualified_type_def::get_pointed_to_type) (reference_type_def::get_pointed_to_type) (array_type::get_element_type, typedef_decl::get_underlying_type) (var_decl::get_type, function_decl::parameter::get_type) (function_type::get_return_type, method_type::get_class_type) (non_type_tparameter::get_type) (type_composition::get_composed_type): Adjust to make this return a shared pointer initialized with the content of the weak pointer. (function_decl::function_decl, method_decl::method_decl): Remove the overload that doesn't take a type. This is because now, function types need to be registered to their containing translation unit. (struct function_type::hash): Declare here. * src/abg-hash.cc (struct function_type::hash): Declare this in abg-ir.h and just define the methods here. * src/abg-ir.cc (fn_type_ptr_map): New typedef. (translation_unit::priv::canonical_types_): Remove this unused member. (translation_unit::priv::canonical_function_types_): New member. (translation_unit::get_canonical_function_type): Define this function. (array_type_def::priv::element_type_, var_decl::priv::type_) (function_decl::priv::type_): Make this a weak pointer. (qualified_type_def::get_underlying_type) (pointer_type_def::get_pointed_to_type) (reference_type_def::get_pointed_to_type) (array_type_def::get_element_type) (typedef_decl::get_underlying_type, var_decl::get_type) (function_decl::get_type): Adjust to make this return a shared pointer initialized with the content of the weak pointer. (qualified_type_def::build_name) (pointer_type_def::get_qualified_name) (reference_type_def::get_qualified_name): Adjust. (method_type::set_class_type): Cleanup the logic. (function_decl::priv::priv): Remove the overload that takes a bare pointer to a type. This should not be used now that we need the function type to registered with the translation unit. (function_decl::function_decl): Remove the overload that doesn't take a type. This is because now, function types need to be registered to their containing translation unit. * src/abg-dwarf-reader.cc (build_function_decl): Register the function type within its translation type and use its canonical version. This complies with the new memory management rules. * src/abg-reader.cc (build_function_decl): Likewise. 2014-09-10 Dodji Seketeli Compare class names when comparing methods * src/abg-ir.cc: 2014-09-10 Dodji Seketeli Slight white space fix * src/abg-hash.cc (method_type::hash::operator()(const method_type&)): White space fix. 2014-09-10 Dodji Seketeli Update copyright notice * include/abg-ir.h: Update year of copyright notice. 2014-07-05 Ondrej Oprala Unite help output for tools * tools/biar.cc (std::ostream): Add a using directive. (display_usage): Make it take a string reference and an ostream as parameters. Use the ostream argument as an output stream instead of a hard-coded cout. Prettify output. (main): Call display_usage with new parameters. * tools/bidiff.cc (display_usage): Declare it static. Prettify output. * tools/bidw.cc (display_usage): Prettify output. * tools/bilint.cc (display_usage): Declare it static. Prettify output. * tools/bisym.cc (std::cerr): Add a using directive. (prog_name): Rename progname into this. (display_usage): Rename show_help into this. Add an ostream as a parameter. Use the ostream argument as output stream insted of a hard-coded cout. 2014-09-03 Dodji Seketeli Adjust copyright year * tests/test-diff-dwarf.cc: Adjust year in copyright notice. 2014-09-03 Dodji Seketeli Sort reported changed data members by increasing offset * include/abg-comparison.h (changed_type_or_decl_vector): New typedef. * include/abg-fwd.h (is_data_member): Change the overload that takes a decl_base_sptr to make it return the real var_decl_sptr rather than just a bool. * src/abg-comparison.cc (ChangedDataMemberComp, DataMemberComp): New comparison functors. (sort_changed_data_members, sort_data_members): Sorting functions for changed data members and data members. (class_diff::report): Sort reports for deleted, inserted and change data members by the increasing value of the offsets of said data members. * src/abg-ir.cc (is_data_member): Change the overload that takes a decl_base_sptr to make it return the real var_decl_sptr rather than just a bool. * tests/data/test-bidiff/test-struct1-report.txt: Adjust. * tests/data/test-diff-dwarf/test13-report.txt: New test input. * tests/data/test-diff-dwarf/test13-v0.cc: Source code for new test input. * tests/data/test-diff-dwarf/test13-v0.o: New test input. * tests/data/test-diff-dwarf/test13-v1.cc: Source code for new test input. * tests/data/test-diff-dwarf/test13-v1.o: New test input. * tests/Makefile.am: Add the new test inputs above to the source distribution. * tests/test-diff-dwarf.cc: Run this test harness on the new test input. 2014-09-03 Dodji Seketeli Do not filter out diff nodes that are only in NOT_REDUNDANT_CATEGORY * src/abg-comparison.cc (diff::is_filtered_out): If a diff not is only in the NOT_REDUNDANT_CATEGORY category consider it as not being filtered. * tests/data/test-diff-filter/test18-report.txt: New test input. * tests/data/test-diff-filter/test18-v0.cc: Source code for new test input. * tests/data/test-diff-filter/test18-v0.o: New test input. * tests/data/test-diff-filter/test18-v1.cc: Source code for new test input. * tests/data/test-diff-filter/test18-v1.o: New test input. * tests/Makefile.am: Add the new test inputs to the source distribution. * tests/test-diff-filter.cc: Run this test harness on the new test input above. 2014-09-03 Dodji Seketeli White space cleanup * src/abg-ir.cc (get_data_member_offset): Remove useless horizontal white space. 2014-09-03 Dodji Seketeli Add some comments in the comparison engine * src/abg-comparison.cc: Add a comment for the file. (struct class_diff::priv::{subtype_changed_dm_,changed_dm_}): Add comment for these data members. 2014-09-02 Dodji Seketeli Remove useless new line from comparison engine's report * src/abg-comparison.cc (class_diff::report): Do not emit new lines after reporting about inserted data members. * tests/data/test-bidiff/test-qual-type0-report.txt: Adjust. * tests/data/test-bidiff/test-struct0-report.txt: Adjust. * tests/data/test-bidiff/test-struct1-report.txt: Adjust. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. * tests/data/test-diff-dwarf/test1-report.txt: Adjust. * tests/data/test-diff-dwarf/test3-report.txt: Adjust. * tests/data/test-diff-dwarf/test7-report.txt: Adjust. * tests/data/test-diff-filter/test0-report.txt: Adjust. * tests/data/test-diff-filter/test01-report.txt: Adjust. * tests/data/test-diff-filter/test1-report.txt: Adjust. * tests/data/test-diff-filter/test11-report.txt: Adjust. * tests/data/test-diff-filter/test14-0-report.txt: Adjust. * tests/data/test-diff-filter/test14-1-report.txt: Adjust. * tests/data/test-diff-filter/test15-0-report.txt: Adjust. * tests/data/test-diff-filter/test15-1-report.txt: Adjust. * tests/data/test-diff-filter/test16-report.txt: Adjust. * tests/data/test-diff-filter/test17-0-report.txt: Adjust. * tests/data/test-diff-filter/test17-1-report.txt: Adjust. * tests/data/test-diff-filter/test2-report.txt: Adjust. * tests/data/test-diff-filter/test3-report.txt: Adjust. * tests/data/test-diff-filter/test9-report.txt: Adjust. 2014-09-01 Dodji Seketeli Adjust copyright years * src/abg-corpus.cc: Adjust copyright years. * src/abg-libzip-utils.cc: Likewise. * src/abg-writer.cc: Likewise. 2014-09-01 Dodji Seketeli Factorize basic redundancy detection in diff report * src/abg-comparison.cc (RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER) (RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER{2,3}): New macros. ({pointer_diff, array_diff, reference_diff, qualified_type_diff, class_diff, typedef_diff}::report): Use the new macros above. * tests/data/test-bidiff/test-qual-type0-report.txt: Adjust because type pretty representation are now always quoted. * tests/data/test-bidiff/test-struct1-report.txt: Adjust likewise. 2014-08-31 Dodji Seketeli Display package configuration at the end of configure * configure.ac: Display the configure of the package at the end of the configure script. 2014-08-31 Dodji Seketeli Make zip archive support optional * configure.ac: Support a new --enable-zip-archive option. By default its value is set to the 'auto', meaning that if libzip is installed, that turns the option on -- just like if --enable-zip-archive was called with the value 'yes'; if libzip is not installed, that turns the option off -- just like if --enable-zip-archive was called with the value 'no'. If libzip is detected, the pre-processor macro HAVE_LIBZIP is set to 1. If --enable-zip-archive is turned on, the pre-processor macro WITH_ZIP_ARCHIVE is set to 1. * config.h.in (HAVE_LIBZIP, WITH_ZIP): New define. * src/abg-corpus.cc: Include config.h. Guard the inclusion of abg-libzip-utils.h with the WITH_ZIP_ARCHIVE macro. Likewise for the use of declarations coming from abg-libzip-utils.h. * src/abg-libzip-utils.cc: Include config.h. Guard the file's content with the WITH_ZIP_ARCHIVE macro. * src/abg-reader.cc: Include config.h. Guard the inclusion of abg-libzip-utils.h with the WITH_ZIP_ARCHIVE. Likewise for the use of declarations coming from abg-libzip-utils.h. * src/abg-writer.cc: Likewise. * tests/Makefile.am: Build runtestwritereadarchive and runtestdot only if zip archives are supported. * tools/Makefile.am: The biar program is built only if zip archives are supported. * tools/bidiff.cc: Handle zip archives only if the WITH_ZIP_ARCHIVE macros is defined. * tools/bilint.cc: Likewise. 2014-08-28 Dodji Seketeli Tell bidiff --help, wrong options and missing argument apart * tools/bidiff.cc (options::{display_usage,missing_operand}): New data members. (options::options): Initialize them. (parse_command_line): Flag missing operands. Return false only when an option could not be parsed. Flag when the user wants us to display help. (main): Tell --help, wrong options and missing argument apart and give an appropriate message on stderr. The help string goes to stdout though. Just like what GNU diff does. 2014-08-28 Dodji Seketeli In bidiff, don't emit a report when the binaries have the same ABI * tools/bidiff.cc (main): For differences of zero length, do not emit any report. 2014-08-29 Dodji Seketeli Take variables in account in corpus changes detection * src/abg-comparison.cc (corpus_diff::length): Take changes about variables into account. 2014-08-28 Dodji Seketeli During redundancy marking start with the current node as non redundant * src/abg-comparison.cc (ENSURE_DIFF_NODE_TRAVERSED_ONCE): If the diff node is being traversed for the first time, mark it as being in the NOT_REDUNDANT_CATEGORY. I don't know why I was doing this only for classes and basic types. Update comments. * tests/data/test-diff-filter/test16-report.txt: New test input. * tests/data/test-diff-filter/test16-v0.cc: Source code of new test input. * tests/data/test-diff-filter/test16-v0.o: New test input. * tests/data/test-diff-filter/test16-v1.cc: Source code of new test input. * tests/data/test-diff-filter/test16-v1.o: New test input. * tests/data/test-diff-filter/test17-0-report.txt: Likewise. * tests/data/test-diff-filter/test17-1-report.txt: Likewise. * tests/data/test-diff-filter/test17-v0.cc: Source code of new test input. * tests/data/test-diff-filter/test17-v0.o: Likewise. * tests/data/test-diff-filter/test17-v1.cc: Source code of new test input. * tests/data/test-diff-filter/test17-v1.o: Likewise. * tests/Makefile.am: Add the new files to the source distribution. * tests/test-diff-filter.cc (in_out_spec): Run this test harness over the new test inputs. 2014-08-28 Dodji Seketeli Give anonymous struct the name "__anonymous_struct__" * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Set the name of anonymous structs to '__anonymous_struct_'. 2014-08-28 Dodji Seketeli Style fix in the comparison engine * src/abg-comparison.cc (represent): Remove useless white space. 2014-08-27 Dodji Seketeli In bidiff, change --no-linkage-names to --no-linkage-name * tools/bidiff.cc (display_usage): Change--no-linkage-names -o --no-linkage-name in the help string. (parse_command_line): Adjust the command line parsing accordingly. * tests/test-diff-filter.cc (in_out_specs): Adjust. 2014-08-27 Dodji Seketeli In diff reports, show symbol version info in linkage names * src/abg-comparison.cc (represent, corpus_diff::report): show symbol version info in linkage name info. 2014-08-27 Dodji Seketeli In diff reports, fns & members add/remove at the top, changes later. * src/abg-comparison.cc (class_diff::report): Put virtual member function adding/removal/change first, then data members add/removal, then the rest (including data members changes). (corpus_diff::report): Put function adding/removal first, then function changes. Likewise for variables. * tests/data/test-bidiff/test-struct0-report.txt: Adjust. * tests/data/test-bidiff/test-struct1-report.txt: Adjust. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. * tests/data/test-diff-dwarf/test1-report.txt: Adjust. * tests/data/test-diff-dwarf/test12-report.txt: Adjust. * tests/data/test-diff-dwarf/test8-report.txt: Adjust. * tests/data/test-diff-dwarf/test9-report.txt: Adjust. * tests/data/test-diff-filter/test0-report.txt: Adjust. * tests/data/test-diff-filter/test01-report.txt: Adjust. * tests/data/test-diff-filter/test1-report.txt: Adjust. * tests/data/test-diff-filter/test13-report.txt: Adjust. * tests/data/test-diff-filter/test2-report.txt: Adjust. * tests/data/test-diff-filter/test3-report.txt: Adjust. * tests/data/test-diff-filter/test9-report.txt: Adjust. 2014-08-27 Dodji Seketeli Consider symbol versions' public-ness during comparison * src/abg-ir.cc (elf_symbol::operator==): Rather than comparing bindings, compare public-ness here. That is, if two symbol versions' differ because one is GLOBAL and the other one is WEAK, they should still be considered equal, from an ABI standpoint. 2014-08-27 Dodji Seketeli Lookup proper names of symbol during determination of deleted/added decls * src/abg-comparison.cc ({class,corpus}_diff::ensure_lookup_tables_populated): Now that in the intermediate maps we store symbol *ids* rather than symbol names, make sure to really refer to symbol names for symbol lookups, rather than (wrongly) referring to symbol ids. 2014-08-26 Dodji Seketeli Cleanup bidiff help string some more * tools/bidiff.cc (display_usage): Add help strings for --harmless and --no-harmful. (main): Emit the help string to stdout, not stderr. 2014-08-26 Dodji Seketeli bidiff --no-harmless is no more * tools/bidiff.cc (display_usage): Remove the help string for the --no-harmless option that doesn't exist anymore, as it's on by default. 2014-08-26 Dodji Seketeli During comparison use symbol name + version as decl ID * include/abg-ir.h ({var,function}_decl::get_id): New member function declarations. * src/abg-ir.cc ({var,function}_decl::get_id): New member function definitions. * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): Use the ::get_id() function to get an identifier for the function or variable. * src/abg-corpus.cc (symtab_build_visitor_type::build_id): Use the get_id of the function/variable. 2014-08-26 Dodji Seketeli Fix access to alternate die -> decl map * src/abg-dwarf-reader.cc (read_context::alternate_die_decl_map): Return the real alternate die decl map, rather than what we was doing previously b/c of a stupid copy/paste. Oh well. 2014-08-25 Dodji Seketeli Take symbol versions in account when computing added/removed decls * include/abg-corpus.h (corpus::lookup_{function,variable}_symbol): Add an overload declaration that takes the version of the symbol to lookup. * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): So when looking up the corpora for symbols, take their versions in account. * src/abg-corpus.cc (corpus::lookup_{function,variable}_symbol): Add an overload definition that takes the version of the symbol to lookup. (symtab_build_visitor_type::build_id): New member functions. (corpus::priv::build_public_decl_table): Use the new member functions above. * src/abg-ir.cc (elf_symbol::version::operator==): Do not take the is_default flag in account when comparing two symbol versions. * libtest12-v{0,1}.so: New test input files. * libtest12-v{0,1}.c: Source code for the test input files. * test12-version-script: Version script to build the files above. * test12-report.txt: Test input file. * tests/Makefile.am: Add the new test input files above to the source distribution. * tests/test-diff-dwarf.cc (in_out_specs[]): Add an entry to this table for the new test input files. 2014-08-25 Dodji Seketeli Misc style cleanups * include/abg-corpus.h (corpus::lookup_function_symbol) (corpus::lookup_variable_symbol): Add the name of the function parameter in the declaration. * include/abg-ir.h (elf_symbol::version::version): Properly indent this constructor declaration. * src/abg-corpus.cc (symtab_build_visitor_type::symtab_build_visitor_type): Properly indent constructor parameters. * src/abg-ir.cc (function_decl::operator==): Fix typo in comments. 2014-08-25 Dodji Seketeli bidiff --harmful is not supported anymore * tools/bidiff.cc (display_usage): remove the '--harmful' line from the help string as this option is now activated by default. It's --harmless that exists now. 2014-08-22 Dodji Seketeli A builtin type name change is not harmless - fix that * include/abg-comp-filter.h (has_harmless_name_change): New function declaration. * include/abg-comparison.h (diff_category::DECL_NAME_CHANGE_CATEGORY): Renamed this into HARMLESS_DECL_NAME_CHANGE_CATEGORY. (diff_category::EVERYTHING_CATEGORY): Update. * include/abg-fwd.h (is_enum): New function declaration. (is_var_decl): Return the shared_ptr rather than a bool. (is_data_member): New overload that takes a shared_ptr. * src/abg-comp-filter.cc (decl_name_changed): Consider the qualified name here. (has_harmless_name_change): Define new function declaration. (harmless_filter::visit): Use the new has_harmless_name_change function. * src/abg-comparison.cc (represent) (report_name_size_and_alignment_changes, enum_diff::report) (typedef_diff::report, is_data_member): Use the new filtering::has_harmless_name_change function to simplify logic of emitting the name change related diff * tools/bidiff.cc (set_diff_context_from_opts): Adjust DECL_NAME_CHANGE_CATEGORY -> HARMLESS_DECL_NAME_CHANGE_CATEGORY. * src/abg-ir.cc (is_data_member, is_enum): New function definitions. (is_var_decl): Return the var_decl_sptr rather than just a bool. * tests/data/test-diff-filter/test13-report.txt: Adjust. * tests/data/test-diff-filter/test6-report.txt: Adjust. 2014-08-18 Ondrej Oprala Support C and C++ array type. * include/abg-comparison.h (array_diff): Declare new class. (array_diff_sptr): Shared pointer to type array_diff. (compute_diff): Overload the function to take type array_diff_sptr as the first two arguments. * include/abg-fwd.h (array_type_def): Declare new class. (subrange_type): Likewise. (is_array_def): Declare new function. * include/abg-ir.h (array_type_def_sptr): Shared pointer to type array_type_def. (array_type_def): Declare new class. (ir_node_visitor::visit): Declare a new virtual function taking a pointer to type array_type_def as an argument. * src/abg-comparison.cc (compute_diff_for_types): Add try_to_diff for two instances of type array_type_def. (array_diff::priv): declare struct for holding private members of type array_diff. (array_diff::array_diff): Define constructor. (array_diff::{first,second}_array):Define new member functions. (array_diff::element_type_diff): Likewise. (array_diff::{length,report,traverse}): Likewise. (compute_diff): Define function overloaded in include/abg-comparison.h. * src/abg-dwarf-reader.cc (build_array_type): Define new function. Handle DW_TAG_array_type and DW_TAG_subrange type. (build_ir_node_from_die): Amend case DW_TAG_array_type with a call to build_array_type. * src/abg-hash.cc (array_type_def::hash): Declare new struct. (type_base::dynamic_hash::operator()): Attempt to dynamic_cast the argument to type array_type_def as well. (array_type_def::hash): Declare new struct. * src/abg-ir.cc (array_type_def::array_type_def): Define constructors. (array_type_def::priv): declare struct for holding private members of type array_type_def. (array_type_def::operator==(const decl_base&): Define new operator. (array_type_def::operator==(const type_base&): Likewise. (array_type_def::append_subrange{,s}): Define new functions. (array_type_def::{set,get}_size_in_bits): Likewise. (array_type_def::get_dimension_count): Likewise. (array_type_def::get_qualified_name): Likewise. (array_type_def::get_pretty_representation): Likewise. (array_type_def::get_subrange_representation): Likewise. (array_type_def::traverse): Likewise. (array_type_def::get_{element_type,location,subranges}): Likewise. (array_type_def::is_infinite): Likewise. (array_type_def::~array_type_def): Define destructor. (ir_node_visitor::visit): Define function, taking pointer to array_type_def as an argument. * src/abg-reader.cc (map_id_and_node): Check if node is an array. (is_array_def): Check if object is an array. (handle_element_node): Handle array_type_def as well. (build_subrange_type): Define new function. (build_array_type_def): Likewise. (build_type): Build type array_type_def as well. (build_type_composition): Likewise. (handle_array_type_def): Define new function. * src/abg-writer.cc: (write_decl): Output arrays as well. (write_member_type): Likewise. (write_type_composition): Likewise. (write_array_type_def): Define new function. * tests/data/test-diff-dwarf/test{10,11}-v{0,1}.{cc,o}: New test source files * tests/data/test-diff-dwarf/test{10,11}-report.txt: Likewise. * tests/data/test-diff-dwarf/test10-report.txt: New test input. * tests/data/test-read-dwarf/test7.cc: New test source file. * tests/data/test-read-dwarf/test7.so: New input binary to read. * tests/data/test-read-dwarf/test7.so.abi: New reference test to compare against. * tests/data/test-read-write/test25.xml: New test source file. * tests/test-diff-dwarf.cc: Adjust to launch the new test. * tests/test-read-dwarf.cc: Likewise. * tests/test-read-write.cc: Likewise. * test/Makefile.am: Add the new test inputs to the source distribution. 2014-08-19 Dodji Seketeli Ignore variables which type couldn't be read from DWARF * src/abg-dwarf-reader.cc (build_var_decl): Drop the var on the floor if its type couldn't be built. 2014-08-19 Dodji Seketeli Support TLS variables * src/abg-ir.cc (elf_symbol::is_variable): Accept TLS objects as variables too. * src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr) (die_location_address): Add an output parameter to say if the resulting constant value is a tls address or not. (lookup_public_variable_symbol_from_elf): Use the proper elf_symbol::is_variable() method, rather than trying to figure out the low levels of what a variable is here. Also, cleanup the condition. (read_context::load_symbol_maps): Consider symbols of type STT_TLS, when loading symbols for variables. Also, to avoir symbols that are for versions, filter out symbols of type STT_OBJECT and with a SHN_ABS section index. (read_context::get_variable_address): If the address is for a tls variable, do no try to adjust the address to arrange for things like prelink. As that doesn't seem to affect TLS variables. (dwarf_expr_eval_context::set_tls_addr): New data member. (dwarf_expr_eval_context::dwarf_expr_eval_context): Initialize it. (dwarf_expr_eval_context::set_tls_address): New accessors. (dwarf_expr_eval_context::op_manipulates_stack): Handle DW_OP_GNU_push_tls_address, a bit like DW_OP_form_tls_address, but then, its result is a constant. Set the dwarf_expr_eval_context::set_tls_addr flag when these two OPs are run. (die_member_offset): Adjust to the new signature of eval_last_constant_dwarf_sub_expr. * tests/data/test-diff-dwarf/libtest9-v0.so: New test input. * tests/data/test-diff-dwarf/libtest9-v1.so: Likewise. * tests/data/test-diff-dwarf/test9-report.txt: Likewise * tests/data/test-diff-dwarf/test9-v0.cc: Source code for the first input. * tests/data/test-diff-dwarf/test9-v1.cc: Source code for the second input. * tests/test-diff-dwarf.cc: Run this harness on the two new inputs above. * tests/Makefile.am: Add the new inputs to the source distribution. 2014-08-18 Dodji Seketeli Update copyright for abg-dwarf-reader.cc * src/abg-dwarf-reader.cc: Update copyright year. 2014-08-18 Dodji Seketeli Make the link to the alt debug info file relative * tests/data/test-alt-dwarf-file/test0-debug-dir/.build-id/16/7088580c513b439c9ed95fe6a8b29496495f26.debug: Make this link be relative. 2014-08-15 Dodji Seketeli White space fix * tests/test-lookup-syms.cc: Remove useless white space. 2014-08-15 Dodji Seketeli Update copyright notice * tests/test-lookup-syms.cc: Update year in copyright notice. * tools/bidw.cc: Likewise. 2014-08-15 Dodji Seketeli Support alternate debug info sections * include/abg-dwarf-reader.h (class read_context) (typedef read_context_sptr, create_read_context) (has_alt_debug_info): Declare these. (read_corpus_from_elf): Declare new overload. * src/abg-dwarf-reader.cc (find_alt_debug_info) (is_die_attribute_resolved_through_gnu_ref_alt) (build_primary_die_parent_relations_under) (build_alternate_die_parent_relations_under): Define new static functions. (read_context::{alt_dwarf_, alt_debug_info_path_, alternate_die_decl_map_, alternate_die_parent_map_}): New data members. (read_context::{alt_dwarf, alt_debug_info_path, alternate_die_decl_map, associate_die_to_decl_primary, associate_die_to_decl_alternate, associate_die_to_decl, lookup_decl_from_die_offset_primary, lookup_decl_from_die_offset_alternate, lookup_decl_from_die_offset, alternate_die_parent_map}): New member functions. (read_context::load_debug_info): Painfully Get a handle on the alternate debug info section too. We shouldn't have to do all this work; we could use the new dwarf_getalt() function from libdw, but we cannot as we want to support supports that predate that api. When a version of elfutils gets released with that api though, we should conditionally use that instead. (build_ir_node_from_die, get_parent_die, get_scope_for_die) (build_namespace_decl_and_add_to_ir) (build_class_type_and_add_to_ir, build_qualified_type) (build_pointer_type_def, build_reference_type, build_typedef_type) (build_var_decl, build_function_decl): Take a new parameter that tells if the input DIE is from alternate debug info. Adjust their code accordingly. (die_die_attribute): Take a new output parameter that tells if the resolved DIE is from alternate debug info. Also take a new parameter that tells if the input DIE is from alternate debug info sections. (build_die_parent_relations_under): Take the DIE -> parent map to act upon. Also, add a new overload that takes a flag saying if the DIE is from alternate debug info or not, and act upon that. (build_die_parent_maps): Renamed build_die_parent_map into this and make it build DIE -> parent DIE relationship for the alternate debug info file as well. (find_last_import_unit_point_before_die, ): Adjust to use the information about if the relevant DIEs are in alternate debug info or not. (build_translation_unit_and_add_to_ir): Clear the alternate DIE -> decl map, that is per TU just as the primary DIE -> decl map. Adjust to use the information about if the relevant DIEs are in alternate debug info or not. (read_debug_info_into_corpus): Build the two DIE -> DIE parent maps (one for the primary debug info and one for the alternate debug info). (create_read_context, has_alt_debug_info): Define new public entry points. (read_corpus_from_elf): New entry point overload that takes a read_context. * tools/bidw.cc (options::{check_alt_debug_info_path, show_base_name_alt_debug_info_path}): New data members. (display_usage): Update for the two new options --check-alternate-debug-info and check-alternate-debug-info-base-name. (parse_command_line): Parse the two options above. (main) Handle the two new options above. * tests/Makefile.am: Build the new runtestaltdwarf test. Add the new data/test-alt-dwarf-file/* files to the build system. * tests/test-alt-dwarf-file.cc: New test driver. * tests/data/test-alt-dwarf-file/test0-common.cc: New test input files. * tests/data/test-alt-dwarf-file/libtest0-common.so: Likewise. * tests/data/test-alt-dwarf-file/test0.cc: Likewise. * tests/data/test-alt-dwarf-file/libtest0.so: Likewise. * tests/data/test-alt-dwarf-file/test0.h: Likewise. * tests/data/test-alt-dwarf-file/test0-common-dwz.debug: Likewise. * tests/data/test-alt-dwarf-file/test0-debug-dir/.build-id/16/7088580c513b439c9ed95fe6a8b29496495f26.debug: Likewise. * tests/data/test-alt-dwarf-file/test0-debug-dir/test0-common-dwz.debug: Likewise. * tests/data/test-read-dwarf/test1.abi: Adjust. bidw doesn't emit an abstract constructor/destructor anymore. It emits just the functions matching the cdtor symbols found in the binary. * tests/data/test-read-dwarf/test2.so.abi: Likewise. 2014-07-26 Dodji Seketeli Better handle corner cases of void* DWARF parsing * src/abg-dwarf-reader.cc (build_pointer_type_def): Better support cases where the underlying type of the pointer is not know. In that case, the pointer should not be created. 2014-07-20 Dodji Seketeli Support finding symbols with bias wrt DWARF references * src/abg-dwarf-reader.cc (get_binary_load_address): New function definition. (read_context::elf_handle): Add comment. (read_context::{dwarf_elf_handle, dwarf_is_splitted, maybe_adjust_address_for_exec_or_dyn}): New method definitions. (maybe_adjust_fn_sym_address) (maybe_adjust_var_sym_address): Move these so they become members of read_context. Also, For shared libraries and executable (that could have been e.g prelinked), consider their loading address when trying to find which symbol resides at a given place in memory. (read_context::{get_function_address, get_variable_address): Adjust. (build_translation_unit_and_add_to_ir): Fix comment. 2014-07-20 Dodji Seketeli Reset the scope of void_type_decl for each new translation unit * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): Clear the void_type_decl on new translation units. 2014-07-18 Dodji Seketeli Update INSTALL file * INSTALL: Adjust the copyright year information because autotools 2.69 did. 2014-07-18 Dodji Seketeli Correctly write the name of a const reference type * src/abg-dwarf-reader.cc (maybe_strip_qualification): Define new function. (build_ir_node_from_die): Use the maybe_strip_qualification when building a qualified type. * src/abg-ir.cc (qualified_type_def::build_name): Fix the representation of the name of a reference that is const. * tests/data/test-read-dwarf/test1.abi: Adjust. * tests/data/test-diff-dwarf/test0-report.txt: Likewise. * tests/data/test-diff-dwarf/test1-report.txt: Likewise. * tests/data/test-diff-dwarf/test6-report.txt: Likewise. * tests/data/test-diff-dwarf/test7-report.txt: Likewise. * tests/data/test-diff-dwarf/test8-report.txt: Likewise. * tests/data/test-diff-filter/test0-report.txt: Likewise. * tests/data/test-diff-filter/test01-report.txt: Likewise. * tests/data/test-diff-filter/test2-report.txt: Likewise. * tests/data/test-diff-filter/test3-report.txt: Likewise. * tests/data/test-diff-filter/test9-report.txt: Likewise. * tests/data/test-diff-filter/test10-report.txt: Likewise. * tests/data/test-diff-filter/test13-report.txt: Likewise. * tests/data/test-diff-filter/test14-0-report.txt: Likewise. * tests/data/test-diff-filter/test14-1-report.txt: Likewise. 2014-07-01 Sinny Kumari Consider symbols with STB_GNU_UNIQUE binding as public * src/abg-ir.cc (is_public): Change in function to consider symbols with STB_GNU_UNIQUE binding as public * tests/data/test-read-dwarf/test6.cc: Test file to generate STB_GNU_UNIQUE binding symbols * tests/data/test-read-dwarf/test6.so: Test shared library having STB_GNU_UNIQUE binding symbols * tests/data/test-read-dwarf/test6.so.abi: XML file containing dwarf information from test6.so * tests/test-read-dwarf.cc (in_out_specs): Add the new test above * tests/Makefile.am: Add tests/data/test-read-dwarf/test6.cc, tests/data/test-read-dwarf/test6.so and tests/data/test-read-dwarf/test6.so.abi to the distribution 2014-07-01 Dodji Seketeli Add comment to test-read-write.cc * tests/test-read-write.cc: Update copyright notice and add a meaningful comment for the file. 2014-06-23 Dodji Seketeli Support reading void* type from DWARF * include/abg-ir.h (type_decl::get_void_type_decl): Declare new static method. * src/abg-ir.cc (type_decl::get_void_type_decl): Define it. * src/abg-dwarf-reader.cc (build_ir_node_for_void_type): Define new static function. (build_pointer_type_def): Support void* type nodes here. * tests/data/test-read-dwarf/test5.cc: Source code for new test input. * tests/data/test-read-dwarf/test5.o: New test input. * tests/data/test-read-dwarf/test5.o.abi: Likewise. * tests/Makefile.am: Add the above to the source distribution. 2014-06-23 Dodji Seketeli Update a comment in abg-dwarf-reader.cc * src/abg-dwarf-reader.cc (build_ir_node_from_die): Update a comment here. 2014-06-23 Mark Wielaard Handle C99 restrict qualifier and DWARFv3 DW_TAG_restrict_type. * src/abg-dwarf-reader.cc (build_qualified_type): Handle DW_TAG_restrict_type by adding CV_RESTRICT. (build_ir_node_from_die): Call build_qualified_type for DW_TAG_restrict_type. * src/abg-reader.cc (build_qualified_type_decl): Handle "restrict" attribute by adding CV_RESTRICT. * src/abg-writer.cc (write_qualified_type_def): Output "restrict" attribute for CV_RESTRICT. * tests/data/test-read-dwarf/test4.c: New test file. * tests/data/test-read-dwarf/test4.so: Likewise. * tests/data/test-read-dwarf/test4.so.abi: Likewise. * tests/data/test-read-write/test24.xml: Likewise. * tests/test-read-dwarf.cc (in_out_specs): Add test4. * tests/test-read-write.cc (in_out_specs): Add test24.xml. 2014-06-23 Dodji Seketeli Add subdir-objects automake option where it is needed * src/Makefile.am: Add the subdir-object automake option here. Do not specify absolute paths for the input files as Automake now takes care of that just fine. * tests/Makefile.am: Likewise. * tools/Makefile.am: Likewise. 2014-06-23 Dodji Seketeli Remove autotools artifacts from the repository * config.guess: Remove from revision control system. * config.sub: Likewise. * depcomp: Likewise. * m4/libtool.m4: Likewise. * missing: Likewise. 2014-06-23 Dodji Seketeli Avoid reporting diff nodes that have already been reported * include/abg-comp-filter.h (class harmful_filter): Update comment. (class redundant_filter): Declare new filter. * include/abg-comparison.h (enum diff_category::NOT_REDUNDANT_CATEGORY): New category. Update the values of the other enumerators. (diff_context::{add_diff, diff_has_been_traversed}): New overloads. (diff_context::{categorizing_redundancy, show_redundant_changes}): Declare new methods. (diff_context::remove_from_category): Define new inline method. * src/abg-comparison.cc (noop_deleter::operator()): Constify the parameter. (CATEGORIZE_REDUNDANCY_FROM_CHILD_NODE) (UPDATE_REDUNDANCY_CATEGORIZATION_FROM_NODE_SUBTREE): New macros. (TRAVERSE_DIFF_NODE_AND_PROPAGATE_CATEGORY) (TRAVERSE_MEM_DIFF_NODE_AND_PROPAGATE_CATEGORY) (TRAVERSE_MEM_FN_DIFF_NODE_AND_PROPAGATE_CATEGORY): Use the new CATEGORIZE_REDUNDANCY_FROM_CHILD_NODE and UPDATE_REDUNDANCY_CATEGORIZATION_FROM_NODE_SUBTREE macros above. (ENSURE_DIFF_NODE_TRAVERSED_ONCE) (ENSURE_MEM_DIFF_NODE_TRAVERSED_ONCE): If the (type_decl or class) node hasn't been yet traversed, mark it as non-redundant. (diff_context::priv::categorizing_redundancy): New member. (diff_context::priv::priv): Initialize it. (diff_context::{add_diff, diff_has_been_traversed): Define new overloads. (diff_context::mark_diff_as_traversed): Intern a diff node that is marked as being traversed. (diff_context::{categorizing_redundancy, show_redundant_changes}): Define new methods. (diff::is_filtered_out): A redundant function or top-level variable is considered filtered-out. Otherwise, the new NOT_REDUNDANT_CATEGORY doesn't play any role when comparing allowed categories with the set of categories a diff node belongs to. (corpus::priv::categorize_redundant_changed_sub_nodes): Define new member function. (corpus_diff::priv::apply_filters_and_compute_diff_stats): Change this to first walk the changed functions and variables to apply filters, then categorize redundant changed functions, and then walk the changed functions and variables again to count filtered-out diff nodes. (filtering::redundant_filter::visit): Define new member function. * tools/bidiff.cc (options::show_redundant_changes): New data member. (options::options): Initialize it. (display_usage): Add help string for the --redundant command line option. (parse_command_line): Add support for the --redundant command line option. (set_diff_context_from_opts): Take the --redundant command line option in account. * tests/test-diff-filter.cc: Update this to add new test inputs. * tests/data/test-diff-filter/test14-0-report.txt: New test input. * tests/data/test-diff-filter/test14-1-report.txt: Likewise. * tests/data/test-diff-filter/test14-v0.cc: Likewise. * tests/data/test-diff-filter/test14-v0.o: Likewise. * tests/data/test-diff-filter/test14-v1.cc: Likewise. * tests/data/test-diff-filter/test14-v1.o: Likewise. * tests/data/test-diff-filter/test15-0-report.txt: Likewise. * tests/data/test-diff-filter/test15-1-report.txt: Likewise. * tests/data/test-diff-filter/test15-v0.cc: Likewise. * tests/data/test-diff-filter/test15-v0.o: Likewise. * tests/data/test-diff-filter/test15-v1.cc: Likewise. * tests/data/test-diff-filter/test15-v1.o: Likewise. * tests/Makefile.am: Add the above to the build system. 2014-06-23 Dodji Seketeli A name that couldn't be demangled remains the same * src/abg-ir.cc (demangle_cplus_mangled_name): When the demangler fails to demangle a name, just return the input name as-is. 2014-06-23 Dodji Seketeli Update copyright notice for a bunch of files * include/abg-comp-filter.h: Update copyright notice. * include/abg-comparison.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-ir.cc: Likewise. * tools/bidiff.cc: Likewise. * tests/test-diff-filter.cc: Likewise. 2014-06-19 Sinny Kumari Keep symbol's multiple aliases within single attribute separated by comma * src/abg-writer.cc (write_elf_symbol_aliases): Changing function to keep multiple symbol aliases within one alias attribute * src/abg-reader.cc (build_elf_symbol_db): Changing function to read symbol's alias attribute and split if multiple alias exist with comma(,) asi a delimiter and add all aliases to main symbol * tests/data/test-read-dwarf/test3.c: Test file to generate multiple aliases * tests/data/test-read-dwarf/test3.so: Test shared library having multiple aliases of a symbol * tests/data/test-read-dwarf/test3.so.abi: XML file containing dwarf information from test3.so * tests/test-read-dwarf.cc (in_out_specs): Add the new test above * tests/Makefile.am: Add tests/data/test-read-dwarf/test3.c, tests/data/test-read-dwarf/test3.so and tests/data/test-read-dwarf/test3.so.abi to the distribution 2014-06-18 Mark Wielaard DW_TAG_mutable_type doesn't exist. * src/abg-dwarf-reader.cc (is_type_tag): Remove DW_TAG_mutable_type. (build_ir_node_from_die): Likewise. 2014-06-05 Dodji Seketeli Look at first parm type and artificial-ness to detect static-ness * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): To tell if a member function is static, look if the first parm is a pointer to the type of the enclosing class, and if it's artificial. Don't bother trying to be smart by looking at the non-presence of DW_AT_object_pointer b/c that attribute wasn't emitted by GCC 4_4. 2014-06-04 Dodji Seketeli Harden debug info path management & better error reporting * include/abg-dwarf-reader.h (enum status): New enum. (read_corpus_from_elf): Return an instance of status above, and return the corpus by parameter. * src/abg-dwarf-reader.cc (create_default_dwfl): Add a comment about elfutils wanting the Dwfl_Callbacks::debuginfo_path to be an absolute path. (read_corpus_from_elf): Return an instance of status above, and return the corpus by parameter. * tools/abg-tools-utils.h (make_path_absolute): Declare new function. * tools/abg-tools-utils.cc (make_path_absolute): New implementation. * tools/bidiff.cc (options::di_root_path[12]): Make these be shared pointers. (parse_command_line): ensure the debug info root paths are absolute. (main): Adjust. Give meaningful errors when the debug info or symbol files couldn't be read. * tools/bidw.cc (options::di_root_path): Make this be a shared pointer. (parse_command_line): Ensure the debug info root path is absolute. (main): Adjust. Give meaningful errors when the debug info or symbol files couldn't be read. * tools/bilint.cc (options::di_root_path): Make this be a shared pointer. (parse_command_line): Ensure the debug info root path is absolute. (main): Adjust. Give meaningful errors when the debug info or symbol file couldn't be read. * tests/test-diff-dwarf.cc (main): Adjust. * tests/test-read-dwarf.cc (main): Likewise. 2014-06-02 Dodji Seketeli Do not choke on AR archives * tools/abg-tools-utils.h (file_type::FILE_TYPE_AR): New enumerator. * tools/abg-tools-utils.cc (guess_file_type): Recognize AR archive files. * tools/bidiff.cc (main): Support AR archives. * tools/bidw.cc (main): Likewise. * tools/bilint.cc (main): Likewise. 2014-05-30 Dodji Seketeli Honor linkage name showing when displaying added/removed member functions * src/abg-comparison.cc (represent): Take a diff_context. If instructed to show linkage names, show the linkage name of the member function. (class_diff::report): Adjust for the new signature of represent(). 2014-05-30 Dodji Seketeli Make bidiff filter output and display symbol names by default * tools/bidiff.cc (options::options): Initialize options::show_linkage_names to true and options::show_harmful_changes to false. (parse_command_line): Change --linkage-names into --no-linkage-names as the linkage names are now displayed by default. Change --no-harmless into --harmless as harmless changes are now filtered by default. (display_usage): Update help string for the --linkage-names -> --no-linkage-names and --no-harmful -> --harmful change. * tests/test-diff-filter.cc: Adjust. 2014-05-29 Dodji Seketeli Ensure added/removed member functions have their symbols added/removed * include/abg-comparison.h (diff_context::{set_corpora, get_first_corpus, get_second_corpus}): Declare new member functions. * src/abg-comparison.cc (diff_context::{set_corpora, get_first_corpus, get_second_corpus}): Define them. (compute_diff): In the overload for corpus_sptr stick the corpora being compared, into the diff context. (class_diff::ensure_lookup_tables_populated): If a member function is allegedly removed, check that its underlying symbol is removed from the corpus as well. Otherwise, consider that the member function hasn't been removed. Likewise, if a member function is allegedly added, check that its underlying symbol has been added to the corpus as well. Otherwise, consider that the member function hasn't been added. The symbols can now be accessed through the two corpora that are now present in the diff context. 2014-05-29 Dodji Seketeli Fix scope for DIEs with specification or abstract_origin attributes * src/abg-dwarf-reader.cc (get_scope_for_die): If the DIE has a DW_AT_specification or DW_AT_abstract_origin attribute, get the scope of the referred-to DIE. (build_ir_node_from_die): For a variable DIE that has a DW_AT_{specification,abstract_origin} attribute, do not add the built variable IR node to its scope because it is already in a scope. It's in a scope because that built variable is for the DIE that is referred-to by the DW_AT_{specification,abstract_origin} attribute. Likewise for member functions. Also, now, get_scope_for_die can return a class for a function DIE because get_scope_for_die now returns the *logical* scope of the DIE; that is, it follows DW_AT_{specification,abstract_origin} attributes. * tests/data/test-read-dwarf/test1.abi: Adjust. 2014-05-28 Dodji Seketeli Add a symbol database to the ABI Corpus & support symbol aliases * include/abg-corpus.h (corpus::{g,s}et_{fun,var}_symbol_map{_sptr}): Declare new accessors. (corpus::lookup_{variable,function}_symbol): Declare new member functions. * src/abg-corpus.cc (corpus::{g,s}et_{fun,var}_symbol_map{_sptr}): Define new accessors. (corpus::lookup_{variable,function}_symbol): Define new member functions. * include/abg-ir.h (string_elf_symbol_sptr_map_type) (string_elf_symbol_sptr_map_sptr, elf_symbols) (string_elf_symbols_map_type, string_elf_symbols_map_sptr): New convenience typedefs. (elf_symbol::{get_main_symbol, is_main_symbol, get_next_alias, has_aliases, add_alias, get_id_string, get_name_and_version_from_id, operator=}): Declare new member functions. * src/abg-ir.cc (elf_symbol::{get_main_symbol, is_main_symbol, get_next_alias, has_aliases, add_alias, get_id_string, get_name_and_version_from_id, operator=}): Define new member functions. * include/abg-reader.h (read_corpus_from_file): Take a shared pointer to corpus. * src/abg-reader.cc (read_context::{g,s}et_corpus): Define these. (build_elf_symbol_db, build_elf_symbol_from_reference) (read_symbol_db_from_input): Define new functions. (read_corpus_from_input): Adjust. Make it read symbol databases. (build_elf_symbol): Harden this. (build_{var,function}_decl): Read the symbol reference. Do not read the local symbol serialization anymore. (read_corpus_from_archive): Adjust. (read_corpus_from_file): Take a reference to a shared pointer to corpus, rather than a reference to the corpus. (read_corpus_from_native_xml): Only keep the overload that returns a corpus. Set the current context with the corpus. * src/abg-dwarf-reader.cc (addr_elf_symbol_sptr_map_type) (addr_elf_symbol_sptr_map_sptr): New convenience typedefs. (read_context::{fun_sym_addr_sym_index_map_, var_sym_addr_sym_index_map_): Remove. (read_context::{fun,var}_addr_sym_map_): New. Replace the above that got removed. (read_context::{var,fun}_syms_): New. (read_context::lookup_elf_{fn,var}_symbol_from_address): Adjust. (read_context::{fun,var}_addr_sym_map{_sptr}): New. (read_context::{fun,var}_syms{_sptr}): New. (read_context::load_symbol_maps): Replace read_context::load_symbol_addr_to_index_maps. Adjust to load all the new maps. (read_context::maybe_load_symbol_maps): New. (read_debug_info_into_corpus): Renamed build_corpus into this. Update to load symbol maps and set it to the corpus. * src/abg-writer.cc (write_context::get_fun_symbol_map): New accessor. (write_elf_symbol_aliases, write_elf_symbol_reference) (write_elf_symbols_table): Define new static functions. (write_var_decl): Write the reference to the underlying symbol of the variable. Do not write the full symbol here anymore. (write_function_decl): Likewise, write the reference to the underlying symbol of the function. Do not write the full symbol here anymore. (write_corpus_to_native_xml): Write the symbol databases at the beginning of the corpus document. * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): Now that the corpus has symbols, check if a the symbol of an allegedly deleted function (resp. variable) is deleted; if not, then do not report the function (resp. variable) as deleted. Similarly, check if the symbol of an allegedly added function (resp. variable) is added. if not, the do not report the function (resp. variable) as added. * tests/test-write-read-archive.cc (main): Adjust. * tools/biar.cc (extract_tus_from_archive): Likewise. * tests/data/test-diff-filter/test9-report.txt: Adjust. * tests/data/test-read-dwarf/test0.abi: Likewise. * tests/data/test-read-dwarf/test1.abi: Likewise. * tests/data/test-read-dwarf/test2.so.abi: Likewise. 2014-05-21 Dodji Seketeli Rename 'symbol' in fn names to 'public decl' in abg-corpus.{cc,h} * src/abg-corpus.cc (lots of places): Rename references to 'symbol' in function & variable names to 'public_decl'. 2014-05-22 Dodji Seketeli Support debug info files being outside the expected system directories * include/abg-dwarf-reader.h (read_corpus_from_elf): Take a debug_info_root_path parameter. src/abg-dwarf-reader.cc (create_default_dwfl): Take a debug_info_root_path. Use that to initialize the Dwfl_Callbacks structure used by dwfl_begin. (create_default_dwfl_sptr, read_corpus_from_elf): Likewise, Take a debug_info_root_path parameter. * tests/test-diff-dwarf.cc (main): Adjust. * tests/test-read-dwarf.cc (main): Likewise. * tools/bidiff.cc (options::dir_root_path[12]): New member. (options::options): Initialize it. (display_usage): Add help string for the --debug-info-dir[12] options. (parse_command_line): Handle the new --debug-info-dir[12] options. (main): Pass the debug info directories to read_corpus_from_elf. * bidw.cc (options::::di_root_path): New member. (options::options): Initialize it. (display_usage): Add help string for the new --debug-info-dir option. (parse_command_line): Handle the new --debug-info-dir. (main): Pass the debug info root path to read_corpus_from_elf. * tools/bilint.cc (options::di_root_path): New member. (options::options): Initialize it. (display_usage): Add help string for the new --debug-info-dir. (parse_command_line): Handle --debug-info-dir command line option. (main): Pass the debug info root path to read_corpus_from_elf. 2014-05-21 Dodji Seketeli Fix detection of destructors * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Simply detect that the destructor starts with a '~'. 2014-05-21 Dodji Seketeli Add clone in the scope of the cloned decl they logically belong to * src/abg-dwarf-reader.cc (build_ir_node_from_die): Do not try to add the cloned function/variable to the current scope because cloning should have added the decl into the scope of the cloned target. * src/abg-ir.cc ({var,function}_decl::clone): Insert the clone decl into the scope of the cloned decl. My understanding is that it's where they belong. * tests/data/test-read-dwarf/test1.abi: Update this to incorporate all the abstract constructors/destructors *and* their clones into the classes where they belong. * tests/data/test-read-dwarf/test1.abi: Adjust for the abstract cdtor being added to the class, as well as their cloned concrete instances. * tests/data/test-read-dwarf/test2.so.abi: Likewise. 2014-05-20 Dodji Seketeli Support decl cloning when seeing DW_AT_abstract_origin * include/abg-ir.h ({var,function}_decl::clone): New method. * src/abg-dwarf-reader.cc (die_die_attribute): Add a flag to avoid looking through DW_AT_abstract_origin attribute here. (build_function_decl): Set the linkage name from DW_AT_linkage_name if it's not set yet. (build_ir_node_from_die): For DW_TAG_{variable,subprogram}, when we see DW_AT_abstract_origin, clone the decl they refer to. Also, avoid dropping the DIE on the floor just because it doesn't have die_is_artificial here. * src/abg-ir.cc ({var,function}_decl::clone): Implement this. 2014-05-19 Dodji Seketeli Don't share types across TUs when DW_TAG_partial_unit are involved * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): Clear the part of the context that needs to be per TU. (build_ir_node_from_die): Assert that this should not be called for partial and imported unit because for now our practical assumption is that DIEs under partial unit are lazily read only when referenced by DIEs that are under DW_TAG_compile_unit. * tests/Makefile.am: Add the new test files to the build system. * tests/data/test-read-dwarf/test2.so.abi: Fix the reference output here to avoid sharing types across TUs, making the output valid for bilint. 2014-05-19 Dodji Seketeli Initial support for DW_TAG_partial_unit * src/abg-dwarf-reader.cc (read_context::cur_tu_die_): New member. (read_context::read_context): Initialize the new member. (read_context::cur_tu_die): New accessors. (find_last_import_unit_point_before_die): New static function. (get_parent_die): Take a logical current die offset parameter. If the die we want the parent for is a partial unit, then find the last DW_TAG_imported_unit that imports that partial unit before the logical current die and return the parent of that DW_TAG_imported_unit die. (get_scope_for_die): Take a logical current die offset parameter. Adjust. (build_translation_unit_and_add_to_ir): Set/unset the current translation unit DIE in the context. Adjust. (build_namespace_decl_and_add_to_ir) (build_class_type_and_add_to_ir, build_qualified_type) (build_pointer_type_def, build_reference_type, build_typedef_type) (build_var_decl, build_function_decl, build_ir_node_from_die): Take a logical current die offset parameter. Adjust. (build_corpus): Accept that we can have DIE that are not DW_TAG_compile_unit at the top level, because, well, we can now have DW_TAG_partial_unit too. * tests/data/test-read-dwarf/test2-{0,1}.cc: New test source files. * tests/data/test-read-dwarf/test2.h: Likewise. * tests/data/test-read-dwarf/test2.so: New input binary to read. * tests/data/test-read-dwarf/test2.so.abi: New reference test to compare against. * tests/test-read-dwarf.cc: Adjust to launch the new test. 2014-05-14 Dodji Seketeli Re-build a test input file with debug info * tests/data/test-lookup-syms/test1.so: Rebuild this with debug info. 2014-05-14 Dodji Seketeli Serialize and de-serialize elf symbols for var & function decls * abg-ir.h (string_to_elf_symbol_type, string_to_elf_symbol_binding): Declare new entry points. * src/abg-ir.cc (string_to_elf_symbol_type) (string_to_elf_symbol_binding): Define new entry points. * include/abg-libxml-utils.h (xml_char_sptr_to_string): Declare new entry points. * src/abg-libxml-utils.cc (xml_char_sptr_to_string): Define new entry points. * src/abg-reader.cc (read_elf_symbol_type) (read_elf_symbol_binding, build_elf_symbol): Define new static functions. (build_function_decl, build_var_decl): Use the new build_elf_symbol and set the symbol to the function. Flag the function as having a public symbol in the symbol table if the symbol is public. * src/abg-writer.cc (write_elf_symbol_type) (write_elf_symbol_binding, write_elf_symbol): Define new static functions. (write_var_decl, write_function_decl): Use the new write_elf_symbol to serialize the symbol for the decl. * tests/data/test-read-dwarf/test[01].abi: Adjust. 2014-05-14 Dodji Seketeli Don't crash when de-serializing an empty function parm xml node * src/abg-reader.cc (build_function_parameter): Do not crash if the xml node is NULL. 2014-05-14 Dodji Seketeli Fix a typo in serializing a decl_base::binding * src/abg-ir.cc (operator<<(std::ostream&, decl_base::binding)): Fix a typo here. 2014-05-14 Dodji Seketeli Add a help string for the --no-absolute-path option of bisym * tools/bisym.cc (show_help): Add a missing help string. 2014-05-13 Dodji Seketeli Do not try to use ELF hash tables in demangling lookup mode * src/abg-dwarf-reader.cc (lookup_symbol_from_elf): If in demangling mode, do not use ELF hash tables. 2014-05-13 Dodji Seketeli Use the proper symbol table for and set linkage_name to symbol name * src/abg-dwarf-reader.cc (find_symbol_table_section): Return the .symtab if we are looking at an executable or relocatable file and .dynsym if we are looking at a DSO. (find_symbol_table_section_index): Likewise. Implement this in terms of find_symbol_table_section. (build_{function,var}_decl): Set the linkage_name to the symbol name, if the symbol name is not empty. * tests/data/test-diff-filter/test9-report.txt: Adjust. 2014-05-13 Dodji Seketeli Remove redundant "'" around linkage names in diff reports * src/abg-comparison.cc (corpus_diff::report): Remove the redundant "'" from the linkage names in the diff. 2014-05-08 Dodji Seketeli Initial support for elf symbol (versionning) during decl comparison * include/abg-fwd.h (get_linkage_name): Remove. * include/abg-dwarf-reader.h (enum symbol_type) (enum symbol_binding): Move these into abg-ir.h. (lookup_symbol_from_elf, lookup_public_function_symbol_from_elf): Adjust. * src/abg-dwarf-reader.cc (eval_last_constant_dwarf_sub_expr): Declare this before using it. (die_address_attribute, die_location_address) (stt_to_elf_symbol_type, stb_to_elf_symbol_binding) (find_hash_table_section_index, find_symbol_table_section) (find_symbol_table_section_index, find_text_section) (find_bss_section, compare_symbol_name) (get_symbol_versionning_sections get_version_for_symbol) (lookup_symbol_from_sysv_hash_tab) (lookup_symbol_from_gnu_hash_tab, get_elf_class_size_in_bytes) (bloom_word_at, setup_gnu_ht, lookup_symbol_from_elf_hash_tab) (lookup_symbol_from_symtab, maybe_adjust_fn_sym_address) (maybe_adjust_var_sym_address): New static functions. (enum hash_table_kind): New enum. (struct gnu_ht): New struct. (read_context::var_decls_to_add_): Renamed var_decls_to_add into this. (read_context::{fun, var}_sym_addr_sym_index_map_): New member. (read_context::{lookup_symbol_from_elf, lookup_elf_symbol_from_index, lookup_elf_fn_symbol_from_address, lookup_elf_var_symbol_from_address, fun_sym_addr_sym_index_map, var_sym_addr_sym_index_map, load_symbol_addr_to_index_maps, get_function_address, get_variable_address}): New member functions. (read_context::lookup_public_{variable, function}_symbol_from_elf): Adjust. (op_pushes_constant_value): Fix a bug here. (lookup_symbol_from_elf): Adjust. Support cases where there is no elf hash table, e.g, for relocatable files. (lookup_public_function_symbol_from_elf) (lookup_public_variable_symbol_from_elf): Adjust. (build_var_decl): Allow updating the var_decl to associate it with its underlying symbol. In that case, if the linkage name is not set, set it to the symbol name. (build_function_decl): Likewise for function_decl. (operator<<(std::ostream&, symbol_type)): (operator<<(std::ostream&, symbol_binding)): Move these do abg-ir.cc. * include/abg-ir.h (class elf_symbol): Declare new class. Move enum symbol_binding and enum symbol_type (from abg-dwarf-reader.h) to elf_symbol::binding and elf_symbol::type here. (operator<<(std::ostream&, elf_symbol::type)) (operator<<(std::ostream&, elf_symbol::binding)) (operator==(const elf_symbol_sptr, const elf_symbol_sptr)): New operators. (class elf_symbol::version): Declare new class. (class var_decl): Make this pimpl, and add ... (var_decl::{g,s}et_symbol): ... new member functions. (class function_decl): Likewise, make this pimpl and add ... (function_decl::{g,s}et_symbol): ... new member functions. * src/abg-ir.cc (struct elf_symbol, elf_symbol::priv): New types. (elf_symbol::*): Lots of new members and member functions. (operator==(const elf_symbol_sptr, const elf_symbol_sptr)): New. (operator<<(std::ostream&, elf_symbol::type)): New. (operator<<(std::ostream&, elf_symbol::binding)): New. (elf_symbol::version::priv): New type. (elf_symbol::version::*): Lots of member functions. (get_linkage_name): Removed. (var_decl::priv): New type. Pimplify the thing. (var_decl::{s,g}et_symbol): New. (var_decl::operator==): Take symbols in account in the comparison. (function_decl::priv): New type. (function_decl::*): Pimplify. (function_decl::{s,g}et_symbol): New. (function_decl::operator==): Take symbols in account in the comparison. * include/abg-comparison.h (diff_context::show_linkage_name): New member function. * src/abg-comparison.cc (diff_context::priv::show_linkage_name_): New member. (diff_context::priv::priv): Initialize it. (diff_context::show_linkage_names): New member function. (corpus_diff::report): If the user used --show-linkage-names, display the linkage name after the name of the functions. Add missing "'" in the some spots. * tools/bidiff.cc (options.show_linkage_names): New member. (display_usage, parse_command_line): Support --linkage-names. * tools/bisym.cc (show_help): Add '\n' at the end of help string for --demangle. Add --no-absolute-path option. (parse_command_line): Support --no-absolute-path. (main): Adjust for symbol (versionning) support. Consider that the program successfully completed even when the symbol wasn't found. Support --no-absolute-path. * tests/data/test-lookup-syms/test0-report.txt: New. * tests/data/test-lookup-syms/test01-report.txt: New. * tests/data/test-lookup-syms/test02-report.txt: New. * tests/data/test-read-dwarf/test0.abi: Adjust. * tests/data/test-read-dwarf/test1.abi: Adjust. * tests/data/test-diff-dwarf/test7-report.txt: Adjust. * tests/data/test-diff-filter/test10-report.txt: Adjust. * tests/data/test-diff-filter/test12-report.txt: Adjust. * tests/data/test-lookup-syms/test1-[123]-report.txt: New. * tests/data/test-lookup-syms/test1.c: New. * tests/data/test-lookup-syms/test1.version-script: New. * tests/test-lookup-syms.cc: Adjust for new tests. * test/Makefile.am: Adjust makefile. 2014-05-07 Dodji Seketeli Rename decl_base::get_mangled_name into decl_base::get_linkage_name * include/abg-ir.h (decl_base::get_linkage_name): Renamed decl_base::get_mangled_name into this. * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated) (function_decl_diff::report, type_decl_diff::report) (corpus_diff::priv::ensure_lookup_tables_populated) (corpus_diff::report, compute_diff): Adjust. * src/abg-corpus.cc ({var_comp, func_comp}::operator()): Likewise. (corpus::priv::build_symbol_table): Likewise. * src/abg-dwarf-reader.cc (die_linkage_name): Renamed die_mangled_name into this. (die_loc_and_name, build_translation_unit_and_add_to_ir) (build_namespace_decl_and_add_to_ir, build_type_decl) (build_enum_type, build_class_type_and_add_to_ir) (build_typedef_type, build_var_decl, build_function_decl, ): Adjust. * src/abg-hash.cc (decl_base::hash::operator()): Likewise. * src/abg-ir.cc (decl_base::priv::linkage_name_): Renamed decl_base::priv::mangled_name_ into this. (decl_base::priv::priv, decl_base::{decl_base, operator==}) (get_linkage_name, typedef_decl::typedef_decl, var_decl::var_decl) (function_decl::function_decl, class_decl::base_spec::base_spec) (class_decl::method_decl::method_decl): Adjust. (decl_base::{g,s}et_linkage_name): Renamed decl_base::{g,s}et_mangled_name into this. * src/abg-writer.cc (write_decl, write_typedef_decl) (write_var_decl, write_function_decl, dump): Adjust. 2014-04-21 Dodji Seketeli Drop symbols not global in a symtab from corpus symtab * src/abg-corpus.cc (corpus_priv::build_symbol_table): If a function or variable symbol is not public (global or weak) and present in an elf symbol table, drop it from the corpus symbol table. As a result functions are variables (not present in the elf symbol tables) that we were previously taking in account are not dropped on the floor, leading to much less noise. * tests/data/test-diff-dwarf/test0-v0.cc: Update to avoid generating inline functions. * tests/data/test-diff-dwarf/test0-v0.o: Likewise. * tests/data/test-diff-dwarf/test0-v1.cc: Likewise. * tests/data/test-diff-dwarf/test0-v1.o: Likewise. * tests/data/test-diff-dwarf/test7-v0.o: Likewise. * tests/data/test-diff-dwarf/test7-v1.cc: Likewise. * tests/data/test-diff-dwarf/test7-v1.o: Likewise. * tests/data/test-diff-dwarf/test8-v0.cc: Likewise. * tests/data/test-diff-dwarf/test8-v0.o: Likewise. * tests/data/test-diff-dwarf/test8-v1.cc: Likewise. * tests/data/test-diff-dwarf/test8-v1.o: Likewise. * tests/data/test-diff-filter/test0-v0.cc: Likewise. * tests/data/test-diff-filter/test0-v0.o: Likewise. * tests/data/test-diff-filter/test0-v1.cc: Likewise. * tests/data/test-diff-filter/test0-v1.o: Likewise. * tests/data/test-diff-filter/test10-v0.cc: Likewise. * tests/data/test-diff-filter/test10-v0.o: Likewise. * tests/data/test-diff-filter/test10-report.txt: Likewise. * tests/data/test-diff-filter/test10-v1.o: Likewise. * tests/data/test-diff-filter/test13-v0.cc: Likewise. * tests/data/test-diff-filter/test13-v0.o: Likewise. * tests/data/test-diff-filter/test13-v1.cc: Likewise. * tests/data/test-diff-filter/test13-v1.o: Likewise. * tests/data/test-diff-filter/test2-v0.cc: Likewise. * tests/data/test-diff-filter/test2-v0.o: Likewise. * tests/data/test-diff-filter/test2-v1.cc: Likewise. * tests/data/test-diff-filter/test2-v1.o: Likewise. * tests/data/test-diff-filter/test4-v0.cc: Likewise. * tests/data/test-diff-filter/test4-v0.o: Likewise. * tests/data/test-diff-filter/test4-v1.cc: Likewise. * tests/data/test-diff-filter/test4-v1.o: Likewise. * tests/data/test-diff-filter/test9-v0.o: Likewise. * tests/data/test-diff-filter/test9-v1.cc: Likewise. * tests/data/test-diff-filter/test9-v1.o: Likewise. 2014-04-21 Dodji Seketeli Fix mangled name setting for static data members from DWARF * src/abg-dwarf-reader.cc (build_var_decl): Support adding properties to an existing var_decl. For now just add mangled name. (build_ir_node_from_die): Accept DW_TAG_member too. This helps for when this function is used to add additional properties to an existing DW_TAG_member representing a static data member. Then, use build_var_decl to really add the value of the additional mangled name property. 2014-04-21 Dodji Seketeli Always show pretty representation of variables in report * src/abg-comparison.cc (corpus_diff::report): Display the pretty representation of the variable, no matter what. 2014-04-21 Dodji Seketeli Set "is_in_public_symbol_table" property for vars & fns * src/abg-dwarf-reader.cc (build_var_decl, build_function_decl): Set the "is_in_public_symbol_table" property for the variable or function decl. 2014-04-21 Dodji Seketeli Support symbol lookups from ELF * include/abg-dwarf-reader.h (symbol_type, symbol_binding): New enums. (operator<<): Declare new overloads for the new enums above. (lookup_symbol_from_elf, lookup_public_function_symbol_from_elf): Declare new entry points. * src/abg-dwarf-reader.cc (lookup_symbol_from_elf) (lookup_public_function_symbol_from_elf) (lookup_public_variable_symbol_from_elf): Define new static functions. (read_context::elf_{module_, handle}_): New data members. (read_context::{elf_module, elf_handle}): New accessors. (read_context::load_debug_info): Store the elf module into read_context::_elf_module_. Adjust. (read_context::{lookup_symbol_from_elf, lookup_public_function_symbol_from_elf, lookup_public_variable_symbol_from_elf}): New member functions. (lookup_symbol_from_elf, lookup_public_function_symbol_from_elf) (operator<<): Define public entry points. * tools/bisym.cc: New tool to lookup a symbol in an elf file. * tools/Makefile.am: Add the bisym.cc source file to the distribution and arrange to compile it into a 'bisym' executable. * tests/test-lookup-syms.cc: New test harness. * tests/data/test-lookup-syms/test0-report.txt: New test input for the harness above. * tests/data/test-lookup-syms/test0.cc: Likewise. * tests/data/test-lookup-syms/test0.o: Likewise * tests/data/test-lookup-syms/test01-report.txt: Likewise. * tests/data/test-lookup-syms/test02-report.txt: Likewise. * tests/Makefile.am: Build the new runtestlookupsyms test and add the new files to the distribution. 2014-04-21 Dodji Seketeli Add corpus::{s,g}et_origin accessors * include/abg-corpus.h (enum corpus::origin): New enum. (corpus::{g,s}et_origin): New accessors. * src/abg-corpus.cc (corpus::priv::origin): New data member. (corpus::priv::is_symbol_table_built): Move this up. (corpus::priv::priv): Adjust. (corpus::{g,s}et_origin): Define accessors. * src/abg-dwarf-reader.cc (read_corpus_from_elf): Set the corpus origin. Also set the path. Oops. * src/abg-reader.cc (read_corpus_from_input) (read_corpus_from_archive): Set the corpus origin. 2014-04-21 Dodji Seketeli Add a get_linkage_name function. * include/abg-fwd.h (is_at_global_scope): Declare a new overload. (get_linkage_name): Declare ... * src/abg-ir.cc (get_linkage_name): ... these new entry points. (is_at_global_scope): Define these new overloads useful for the new get_linkage_name. 2014-04-21 Dodji Seketeli Pimplify decl_base and add decl_base::{s,g}et_is_in_public_symbol_table * include/abg-ir.h (struct decl_base::priv): New pimpl type. (decl_base::priv_): New pimpl. (decl_base::{hashing_started, peek_hash_value, peek_qualified_name, set_qualified_name}): Declare new protected methods. (decl_base::{get_context_rel, set_qualified_name, get_location, set_location, set_name, set_mangled_name, get_visibility, set_visibility}): Move these out-of-line. (decl_base::{g,s}et_is_public_symbol_table): (class_decl::hashing_started): Remove this as we now have decl_base::hashing_started. (decl_base::{hash_, hashing_started, location_, context_, name_, qualified_parent_name_, qualified_name_, mangled_name_, visibility_}): Move all these members into the new ... * src/abg-ir.cc (struct decl_base::priv): ... pimpl type. (decl_base::decl_base): Move these out-of-line here. Adjust the other overloads. (decl_base::{hashing_started, peek_hash_value, peek_qualified_name, set_qualified_name}): Define these new protected methods. (decl_base::{get_context_rel, set_context_rel, get_location, set_location, set_name, get_mangled_name, set_mangled_name, get_visibility, set_visibility}): Define these out-of-line here. (decl_base::{get_hash, set_hash, get_scope, get_qualified_parent_name, get_qualified_name, operator==, set_scope}): Adjust. (qualified_type_def::get_qualified_name): Likewise. (pointer_type_def::get_qualified_name): Likewise. (reference_type_def::get_qualified_name): Likewise. (var_decl::set_scope): Likewise. (class_decl::base_spec): Likewise. (class_decl::method_decl::set_scope): Likewise. (decl_base::{g,s}et_is_in_public_symbol_table): Define new accessors. * src/abg-hash.cc ({decl_base, type_decl, scope_decl, scope_type_decl, qualified_type_def, pointer_type_def, reference_type_def, enum_type_decl, typedef_decl, var_decl, class_decl}::hash::operator): Adjust. 2014-04-17 Dodji Seketeli Categorize base class changes as SIZE_OR_OFFSET_CHANGE_CATEGORY * include/abg-comparison.h (class_diff::{deleted, inserted, changed}_bases): Declare new member functions ... * src/abg-comparison.cc ((class_diff::{deleted, inserted, changed}_bases)): ... and define them. * src/abg-comp-filter.cc (base_classes_added_or_removed): Define new static functions. (harmless_filter): Categorize base classes added or removed. * tests/data/test-diff-dwarf/test8-report.txt: New test input. * tests/data/test-diff-dwarf/test8-v0.cc: Likewise. * tests/data/test-diff-dwarf/test8-v0.o: Likewise. * tests/data/test-diff-dwarf/test8-v1.cc: Likewise. * tests/data/test-diff-dwarf/test8-v1.o: Likewise. * tests/data/test-diff-filter/test13-report.txt: New test input. * tests/data/test-diff-filter/test13-v0.cc: Likewise. * tests/data/test-diff-filter/test13-v0.o: Likewise. * tests/data/test-diff-filter/test13-v1.cc: Likewise. * tests/data/test-diff-filter/test13-v1.o: Likewise. * tests/Makefile.am: Add the new files above to the source distribution. * tests/test-diff-dwarf.cc: Use the new relevant input above to run more tests. * tests/test-diff-filter.cc: Likewise. 2014-04-17 Dodji Seketeli Fix class diff reporting issues for base classes * src/abg-comparison.cc (class_diff::report): For base classes, report their pretty representation. Do not try to report a the diff of a changed base class that got filtered out. Avoid emitting too many vertical white spaces. 2014-04-17 Dodji Seketeli Simplify SIZE_OR_OFFSET_CHANGE_CATEGORY categorizing * src/abg-comp-filter.cc (harmful_filter::visit): Now that type_size_changed is correctly geared to not be fulled by decl-only classes, there is no need for its caller to handle that case. And data_member_offset_changed ain't affected by decl-only classes anyway. So the code is now much simpler. 2014-04-17 Dodji Seketeli Fix API doc for static_data_member_type_size_changed * src/abg-comp-filter.cc (static_data_member_type_size_changed): Fix API doc comment. 2014-04-17 Dodji Seketeli Don't blindly drop DIEs defined in the scope of a function * src/abg-dwarf-reader.cc (get_scope_for_die): Do not drop a DIE on the floor just because it is in the scope of a function. We were dropping a function parameter because its type is a typedef defined right before the parameter, in the scope of the function. Urgh. So with this change, that function parameter is not dropped anymore. I have seen that happening in a DWARF generated by GCC 4.7.1 on libstdc++.so. Hard to come up with a regression test case for this one. 2014-04-17 Dodji Seketeli Useless code killing * src/abg-comparison.cc (decls_equal::operator()(const decls_type, const decls_type)): Kill dead code. Note that there is a proper equality operator for decl_base_sptr already. 2014-04-17 Dodji Seketeli File static data member changes in STATIC_DATA_MEMBER_CHANGE_CATEGORY * include/abg-comparison.h (diff_category::STATIC_DATA_MEMBER_CHANGE_CATEGORY): New category. (diff_category::EVERYTHING_CATEGORY): Update * src/abg-comp-filter.cc (static_data_member_type_size_changed) (static_data_member_added_or_removed): Define new static functions. (harmless_filter::visit): Categorize changes to static data members as STATIC_DATA_MEMBER_CHANGE_CATEGORY. * tools/bidiff.cc (set_diff_context_from_opts): STATIC_DATA_MEMBER_CHANGE_CATEGORY is falls into the harmless group. * tests/data/test-diff-filter/test12-report.txt: New test input. * tests/data/test-diff-filter/test12-v0.cc: Likewise. * tests/data/test-diff-filter/test12-v0.o: Likewise. * tests/data/test-diff-filter/test12-v1.cc: Likewise. * tests/data/test-diff-filter/test12-v1.o: Likewise. * tools/bidiff.cc: Run this test with the additional input data above. * tests/Makefile.am: Adjust. 2014-04-17 Dodji Seketeli Fix typo in comments * include/abg-comparison.h (diff_category::NON_VIRT_MEM_FUN_CHANGE_CATEGORY): Fix typo in comments. 2014-04-17 Dodji Seketeli Only non-static data member changes are SIZE_OR_OFFSET_CHANGE_CATEGORY * src/abg-comp-filter.cc (non_static_data_member_type_size_changed): Renamed data_member_offset_changed into this. Make sure the test detects changes on *non-static* data members only. (non_static_data_member_added_or_removed): Likewise for data_member_offset_changed that got renamed into this. (harmful_filter::visit): Adjust. 2014-04-17 Dodji Seketeli Fix comments in categorization code * src/abg-comp-filter.cc (data_member_added_or_removed): Fix comments. 2014-04-16 Dodji Seketeli Really detect static-ness of data members. Oops. * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Let's consider that a data member being not laid out (i.e, not having a data_member_location) is is a static data member. Otherwise, we were not detecting static data members at all. Well we were only inferring their presence from seeing the static variable definition later on. That means we were missing most of the static variables. Woops. * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): Now that we are really seeing static data members, let's be prepare to the fact that we can the same static data member being declared several times in a corpus. * tests/data/test-diff-dwarf/test7-report.txt: New test input file. * tests/data/test-diff-dwarf/test7-v0.cc: Likewise. * tests/data/test-diff-dwarf/test7-v0.o: Likewise. * tests/data/test-diff-dwarf/test7-v1.cc: Likewise. * tests/data/test-diff-dwarf/test7-v1.o: Likewise. * tests/test-diff-dwarf.cc: Update this to consume the new test input files. * tests/Makefile.am: Update this to add the missing test files to the source distribution. 2014-04-16 Dodji Seketeli Add dumping routines for declaration location * include/abg-fwd.h (get_global_scope()): New overload for const decl_base&. Move the other overloads up in the file. (get_translation_unit): Add an overload for decl_base&. Constify the others. (dump_decl_location): Declare new functions. * src/abg-ir.cc (get_global_scope): Define the overload for const decl_base&. Write the other overloads in terms of this one. (get_translation_unit): Likewise, define the overload for const decl_base&. Write the other overloads in terms of this one. (dump_decl_location): Define these new overloads. 2014-04-16 Dodji Seketeli Fix dumping function to make them use generic ostream * src/abg-writer.cc (dump(const decl_base_sptr, std::ostream&)): Do not dump the content to cerr here. Rather dump to the output stream given in parameter. Oops. (dump(const translation_unit&, std::ostream&)): Likewise. 2014-04-16 Dodji Seketeli Misc style fixes * src/abg-ir.cc (get_translation_unit): Remove useless vertical white space. (is_global_scope): Add missing API doc. 2014-04-16 Dodji Seketeli A virt mem fn deleted and added to the same offset is not harmful * src/abg-comp-filter.cc (has_virtual_mem_fn_change): A virtual member that gets deleted and added back again to the same vtable offset is not considered as being a virtual member function change suitable for VIRTUAL_MEMBER_CHANGE_CATEGORY. Likewise for a function sub-type change not involving a change in the vtable offset. 2014-04-16 Dodji Seketeli Do not categorize size/offset changes when a decl-only class is involved * src/abg-comp-filter.cc (there_is_a_decl_only_class) (diff_involves_decl_only_class): New static functions. (type_size_changed, data_member_added_or_removed) (has_virtual_mem_fn_change, has_non_virtual_mem_fn_change): Bail out if one of the types involved is a decl-only class. 2014-04-16 Dodji Seketeli Work around "mangled name vanishing from one version of mem fn decl" bug * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): If the first version of the member function decl doesn't have a mangled name while the second has it, try the lookups using the pretty representation of the function. 2014-04-16 Dodji Seketeli Do not try to represent the offset for a static data member * src/abg-comparison.cc (represent_data_member(var_decl_sptr, ostream&)): If the data member is static, do not try to represent its offset. 2014-04-16 Dodji Seketeli A static data member shouldn't be checked for having been laid out * src/abg-comparison.cc (represent_data_member(var_decl_sptr, ostream&)): If the data member is static do not check for it having been laid out. 2014-04-16 Dodji Seketeli Prefix pretty representation of static data members with 'static' * src/abg-ir.cc (var_decl::get_pretty_representation): Prefix pretty representation of static data members with 'static'. 2014-04-16 Dodji Seketeli Provide a robust way of getting the size of a qualified type * include/abg-ir.h (qualified_type_def::get_size_in_bits): Declare new member function ... * src/abg-ir.cc (qualified_type_def::get_size_in_bits): ... and define it. Keep in mind that some times the size of the underlying type can change between the moment the qualified type is created and the end of its life time. That is because a subsequent DIE (from DWARF) can alter the size of the underlying type. This overload allows the user to always query the size of the underlying type and keep the size of the qualified type in sync with it. 2014-04-16 Dodji Seketeli Add an assert to the pointer diff reporting code * src/abg-comparison.cc (pointer_diff::report): If the pointer diff node is deemed to be reported then the underlying diff node should be reported as well. 2014-04-16 Dodji Seketeli Little style adjustment in diff node categorization code * src/abg-comp-filter.cc (harmful_filter::visit): Factorize the categorization into SIZE_OR_OFFSET_CHANGE_CATEGORY for data member adding or removal and for data member type size change. 2014-04-15 Dodji Seketeli If a diff node is in NO_CHANGE_CATEGORY do not report it anymore * src/abg-comparison.cc (diff::is_filtered_out): Now that we seem to be flagging every changes to a class into a category, we do not need to dive into reporting a diff not that is categorized as NO_CHANGE_CATEGORY anymore. So let's have the implementation that one would expect for this function. 2014-04-15 Dodji Seketeli Categorize changes to virt mem fncts as VIRTUAL_MEMBER_CHANGE_CATEGORY * src/abg-comp-filter.cc (has_virtual_mem_fn_change): New static function. (harmful_filter): Categorize changes to virtual member functions into VIRTUAL_MEMBER_CHANGE_CATEGORY. * src/abg-comparison.cc (class_diff::priv::count_filtered_changed_dm): Move this up, right after class_diff::priv::count_filtered_subtype_changed_dm. (SKIP_MEM_FN_IF_VIRTUALITY_DISALLOWED): New macro. (class_diff::priv::count_filtered_{changed, inserted, deleted}_mem_fns): Modify these to properly take member function virtual-ness in account. 2014-04-15 Dodji Seketeli Do not hash non-virtual member functions when hashing a class * src/abg-hash.cc (class_decl::hash::operator): Do not hash non-virtual member functions. 2014-04-15 Dodji Seketeli Fix a missing new line in the reports * src/abg-comparison.cc (represent(class_decl::method_decl_sptr, ostream&)): Add a missing new line. * tests/data/test-bidiff/test-struct1-report.txt: Adjust. 2014-04-14 Dodji Seketeli Add more pretty printing facilities * include/abg-comparison.h (get_pretty_representation(diff*)): Declare new function. * include/abg-fwd.h (get_pretty_representation): Declare functions for decl_base*, type_base*, decl_base_sptr and type_base_sptr. * src/abg-comparison.cc (get_pretty_representation): Implement this for diff*. * src/abg-ir.cc (get_pretty_representation): Define implementations for decl_base*, type_base*, decl_base_sptr and type_base_sptr. 2014-04-14 Dodji Seketeli Don't compare non-virtual member functions in class comparison * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Use the virtual member functions here, not the member functions in general. (compute_diff): Consider virtual member functions only, not non-virtual ones. * src/abg-ir.cc (class_decl::operator==): Do not compare non-virtual member functions. Only compare virtual member functions. * tests/data/test-bidiff/test-struct1-report.txt: New test input. * tests/data/test-diff-dwarf/test0-report.txt: New test input. * tests/data/test-diff-filter/test0-report.txt: New test input. * tests/data/test-diff-filter/test01-report.txt: New test input. * tests/data/test-diff-filter/test10-report.txt: New test input. * tests/data/test-diff-filter/test11-report.txt: New test input. * tests/data/test-diff-filter/test2-report.txt: New test input. * tests/data/test-diff-filter/test9-report.txt: New test input. 2014-04-14 Dodji Seketeli Recognize virtual member functions better and store them appart * include/abg-fwd.h (set_member_function_is_virtual): Declare new function. * include/abg-ir.h (class class_decl): Declare set_member_function_is_virtual and member_function_is_virtual as friends of class_decl. (class_decl::add_member_function): Take an is_virtual flag. (class_decl::get_num_virtual_functions): Remove. (class_decl::get_virtual_mem_fns): New member function. (mem_fn_context_rel::is_virtual_): New member. (mem_fn_context_rel::mem_fn_context_rel): Adjust to initialize the new is_virtual_ member. (mem_fn_context_rel::is_virtual): New member functions. * src/abg-comparison.cc (represent): Adjust. * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Adjust. * src/abg-ir.cc (member_function_is_virtual): Change this to use mem_fn_context_rel::is_virtual. (set_member_function_is_virtual): Define this new function. (class_decl::priv::virtual_mem_fns_): New member to hold virtual member functions. (class_decl::get_virtual_mem_fns): Implement this member function. (class_decl::get_num_virtual_functions): Remove. (class_decl::add_member_function): Take a new is_virtual flag. Add virtual member functions to class_decl::priv::virtual_mem_fns_. * src/abg-reader.cc (build_class_decl): Adjust. 2014-04-13 Dodji Seketeli Filter non-virtual member fns insertions/deletions from class changes * include/abg-fwd.h (member_function_is_virtual): Declare new function. * include/abg-comparison.h (diff_category::{NON_VIRT_MEM_FUN_CHANGE_CATEGORY, VIRTUAL_MEMBER_CHANGE_CATEGORY}): New enumerators. (diff_category::EVERYTHING_CATEGORY): Adjust. (class_diff::{changed, deleted, inserted}_member_fns): Declare new member functions. * src/abg-comp-filter.cc (data_member_added_or_removed): Add missing comments. (has_non_virtual_mem_fn_change): New static predicate function. (harmless_filter::visit): Categorize non-virtual member function changes in a diff into NON_VIRT_MEM_FUN_CHANGE_CATEGORY. * src/abg-comparison.cc (TRAVERSE_MEM_FN_DIFF_NODE_AND_PROPAGATE_CATEGORY): New macro. (report_mem_header): Count filtered functions for added/deleted functions as well. (class_diff::priv::count_filtered_changed_mem_fns): Renamed priv::count_filtered_member_functions into this. Filter out changes to non-virtual member functions here. (class_diff::priv::count_filtered_{inserted, deleted}_mem_fns): New member functions. (class_diff::{deleted, inserted, changed}_member_fns): Define new member functions. (class_diff::report): Adjust count for filtered inserted/deleted member functions. Do not report NON_VIRT_MEM_FUN_CHANGE_CATEGORY if it's disallowed. (class_diff::traverse): Propagate only VIRTUAL_MEMBER_CHANGE_CATEGORY from member functions to their enclosing class. * src/abg-ir.cc (member_function_is_virtual): Define new functions. * tools/bidiff.cc (set_diff_context_from_opts): Adjust to add NON_VIRT_MEM_FUN_CHANGE_CATEGORY into the harmless group and VIRTUAL_MEMBER_CHANGE_CATEGORY into the harmful one. * tests/data/test-diff-filter/test0-report.txt: New test input. * tests/data/test-diff-filter/test10-report.txt: Likewise. * tests/data/test-diff-filter/test10-v0.cc: Likewise. * tests/data/test-diff-filter/test10-v0.o: Likewise. * tests/data/test-diff-filter/test10-v1.cc: Likewise. * tests/data/test-diff-filter/test10-v1.o: Likewise. * tests/data/test-diff-filter/test11-report.txt: Likewise. * tests/data/test-diff-filter/test11-v0.cc: Likewise. * tests/data/test-diff-filter/test11-v0.o: Likewise. * tests/data/test-diff-filter/test11-v1.cc: Likewise. * tests/data/test-diff-filter/test11-v1.o: Likewise. * tests/data/test-diff-filter/test2-report.txt: Likewise. * tests/data/test-diff-filter/test9-report.txt: Likewise. * tests/data/test-diff-filter/test9-v0.cc: Likewise. * tests/data/test-diff-filter/test9-v0.o: Likewise. * tests/data/test-diff-filter/test9-v1.cc: Likewise. * tests/data/test-diff-filter/test9-v1.o: Likewise. * tests/test-diff-filter.cc: Consume the test input above to run more tests. 2014-04-13 Dodji Seketeli Make class_decl pimpl and harden comparison infloop prevention * include/abg-ir.h (class_decl::{priv}): New private data member. (class_decl::{get_is_declaration_only, set_is_declaration_only, is_struct, get_definition_of_declaration, get_earlier_declaration, add_base_specifier, get_base_specifiers, get_member_types, get_data_members, get_member_functions, get_member_function_templates, get_member_class_templates}): Move these methods out-of-line. (class_decl::{comparison_started_, declaration_,is_declaration_only_, definition_of_declaration, is_struct_, bases_, member_types_, data_members_, member_functions_, member_function_template, member_class_templates_}): Move these data members into the pimpl in ... * src/abg-ir.cc (class_decl::priv::{declaration_,is_declaration_only_, definition_of_declaration, is_struct_, bases_, member_types_, data_members_, member_functions_, member_function_template, member_class_templates_}): ... here. (class_decl::priv::classes_being_compared_): New data member. (class_decl::priv::priv): Initialize the data members. (class_decl::priv::{mark_as_being_compared, unmark_as_being_compared, comparison_started): New methods. (class_decl::{get_is_declaration_only, set_is_declaration_only, is_struct, get_definition_of_declaration, add_base_specifier, get_base_specifiers, get_member_types, get_data_members, get_member_functions, get_member_function_templates, get_member_class_templates}): Move these out-of-line in here. (class_decl::{class_decl, set_definition_of_declaration, set_earlier_declaration, insert_member_type, add_member_type, add_data_member, add_member_function, add_member_function_template, add_member_class_template, has_no_base_nor_member}): Adjust. (class_decl::operator==): Harden inf-loop prevention during class comparison using the new priv::mark/unmark_as_being_compared() functions. Now comparison of a class really compares member functions again. And it is *slooow*. I should probably change this to compare only virtual member functions. But at least this should be correct and robust for now. * tests/data/test-diff-filter/test0-report.txt: Adjust. * test01-report.txt: Adjust. 2014-04-11 Dodji Seketeli Remove the parent member of the diff node * include/abg-comparison.h (diff::parent_): Remove. (diff::diff): Adjust. (diff::{get, set}_parent): Remove. * src/abg-comp-filter.cc (harmless_filter::visit): Remove category propagation to the parent. 2014-04-11 Dodji Seketeli Update the decl_base copy constructor for forgotten members * src/abg-ir.cc (decl_base::decl_base): Copy forgotten decl_base members hashing_started_, qualified_parent_name_, qualified_name_. 2014-04-11 Dodji Seketeli Comment fix in filtering code * src/abg-comp-filter.cc (harmful_filter::visit): Fix comment typos. 2014-04-11 Dodji Seketeli Put data member type size changes in SIZE_OR_OFFSET_CHANGE_CATEGORY * src/abg-comp-filter.cc (type_size_changed): New overload for type_base_sptr. (data_member_type_size_changed): New predicate. (harmful_filter::visit): Use the new predicate to categorize data member type size changes into the SIZE_OR_OFFSET_CHANGE_CATEGORY. 2014-04-11 Dodji Seketeli Represent a removed+added data member at a given offset as changed * include/abg-fwd.h (get_data_member_offset): Declare new overload for decl_base_sptr. * include/abg-comparison.h (unsigned_decl_base_sptr_map) (unsigned_changed_type_or_decl_map): New typedefs. * src/abg-ir.cc (get_data_member_offset): Define new overload for decl_base_sptr. * src/abg-comparison.cc (diff_kind::subtype_change_kind): New enumerator for a change about a type or sub-type of a member of a structure/enum. (report_mem_header): Handle the new enumerator above. (class_diff::priv::{deleted_dm_by_offset_, inserted_dm_by_offset_, changed_dm_}): New data members. (class_diff::priv::subtype_changed_dm_): Renamed class_diff::priv::changed_data_members_ into this. (class_diff::priv::subtype_changed_dm): Renamed class_diff::priv::data_member_has_changed into this. Adjust. (class_diff::count_filtered_subtype_changed_dm): Renamed count_filtered_data_members into this. Adjust. (class_diff::priv::count_filtered_changed_dm): New member function. (class_diff::lookup_tables_empty): Adjust. (class_diff::ensure_lookup_tables_populated): Adjust. Detect when a data member is deleted and added back to offset N, and be prepared to present that as a change of data member at offset N. (class_diff::report): Adjust. Report data members of a given offset that have changed. * tests/data/test-diff-dwarf/test6-report.txt: New reference report for new test input. * tests/data/test-diff-dwarf/test6-v0.cc: Source code for new test input binary. * tests/data/test-diff-dwarf/test6-v0.o: New test input binary. * tests/data/test-diff-dwarf/test6-v1.cc: Source code for new test input binary. * tests/data/test-diff-dwarf/test6-v1.o: New test input binary. * tests/test-diff-dwarf.cc: Adjust to include the new test inputs above. 2014-04-11 Dodji Seketeli Unmark class_diff node as being traversed once traversal is finished * src/abg-comparison.cc (class_diff:traverse): Unmark class_diff node as being traversed once traversal is finished 2014-04-11 Dodji Seketeli Do not use the parent diff node link for category propagation * src/abg-comparison.cc (class_diff::traverse): Use the new TRAVERSE_MEM_DIFF_NODE_AND_PROPAGATE_CATEGORY macro to propagate categorization from the children diff nodes to the current one for bases, data members and member functions. (scope_diff::traverse): Likewise, use the TRAVERSE_DIFF_NODE_AND_PROPAGATE_CATEGORY to propagate categorization from the children diff nodes to the current one. 2014-04-11 Dodji Seketeli Ensure that each diff node is traversed just once * include/abg-comparison.cc (pointer_map): New typedef. (diff_context::{has_diff_for}): New overload for diff*. (diff_context::{diff_has_been_traversed, mark_diff_as_traversed, forget_traversed_diffs}): Declare new methods. * src/abg-comparison.cc (ENSURE_DIFF_NODE_TRAVERSED_ONCE) (ENSURE_MEM_DIFF_NODE_TRAVERSED_ONCE): Define new macros. (diff_context::priv::traversed_diff_nodes_): New data member. (diff_context::has_diff_for): New overload for diff* (diff_context::{diff_has_been_traversed, mark_diff_as_traversed, forget_traversed_diffs}): Define new member functions. (diff_context::maybe_apply_filters): Forget the traversed diffs before applying a filter. ({distinct_diff, var_diff, pointer_diff, reference_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, function_decl_diff, type_decl_diff, typedef_diff, translation_unit_diff}::traverse): Ensure that the diff node is traversed only once. 2014-04-11 Dodji Seketeli Factorize diff sub-tree traversal and category propagation code * src/abg-comparison.cc (TRAVERSE_DIFF_NODE_AND_PROPAGATE_CATEGORY) (TRAVERSE_MEM_DIFF_NODE_AND_PROPAGATE_CATEGORY): New macros. ({distinct_diff, pointer_diff, reference_diff, qualified_type_diff, enum_diff, base_diff, function_decl_diff, typedef_diff}::traverse): Use the new macro above in lieu of the duplicated sub-tree traversal code in there. 2014-04-11 Dodji Seketeli Style fixes in the diff nodes traversing code * src/abg-comparison.cc (TRY_{PRE, PRO}_VISIT, TRY_{PRE, PRO}_VISIT_CLASS_DIFF, ): Add a white space. 2014-04-10 Dodji Seketeli Supporting reporting data member name change * src/abg-comparison.cc (represent): Support reporting data member name change. 2014-04-10 Dodji Seketeli Consider added/removed data members as changing size or offset * src/abg-comp-filter.cc (data_member_added_or_removed): New static function. (harmless_filter::visit): Re-organize logic. Categorize data member addition/removal into SIZE_OR_OFFSET_CHANGE_CATEGORY. 2014-04-10 Dodji Seketeli Add missing comment * src/abg-ir.cc (non_type_tparameter::get_hash): Add missing api doc. 2014-04-09 Dodji Seketeli Fix and add missing hashing through the virtual decl_base::get_hash * include/abg-ir.h (struct {scope_decl, non_type_tparameter, type_composition, class_decl}::hash): Declare hashers. ({scope_decl, var_decl, non_type_tparameter, type_composition, class_decl}::get_hash): Provide new overloads of the get_hash. * src/abg-hash.cc ({type_decl, scope_type_decl, qualified_type_def, pointer_type_def, reference_type_def, enum_type_decl, typedef_decl, var_decl, function_decl}::hash::operator()): If the hash is being calculated, do not use the not-yet fully calculated hash value. Rather, calculate the hash, cache it and return the value. ({class_decl, non_type_tparameter}::hash::operator()): Moved the {class_decl, non_type_tparameter}::hash declaration out of here and stick it in include/abg-ir.h. Keep the definition of the hashing operators here though. (type_composition::hash::operator()): New operator definition. * src/abg-ir.cc ({scope_decl, var_decl, class_decl, non_type_tparameter, type_composition}::get_hash): Define new virtual overload. 2014-04-08 Dodji Seketeli Fix mis-hashing of base specifiers and function_decl during comparison * include/abg-ir.h (function_decl::get_hash): Declare new virtual overload. * src/abg-hash.cc (class_decl::base_spec::hash::operator()): Properly hash the base specifier so that it doesn't collide with hashing a class. * src/abg-ir.cc (decl_base::get_hash): Abort if we detect a missing overload for this; (function_decl::get_hash() const): Implement this missing overload, allowing using the virtual decl_base::get_hash for function_decl. 2014-04-08 Dodji Seketeli Properly place opening quote and add missing closing quote in report * src/abg-comparison.cc (corpus_diff::report): Move the [{A,D}] marker before the opening quote. And add a closing quote. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. * tests/data/test-diff-filter/test0-report.txt: Adjust. * tests/data/test-diff-filter/test01-report.txt: Adjust. * tests/data/test-diff-filter/test2-report.txt: Adjust. 2014-04-08 Dodji Seketeli Drive-by indentation fix * src/abg-dwarf-reader.cc (build_ir_node_from_die): Fix indentation. 2014-04-08 Dodji Seketeli Drop ABI artifacts that are local to a function * src/abg-dwarf-reader.cc (get_scope_for_die): If the parent die is DW_TAG_subprogram then just drop the whole thing on the floor. (build_ir_node_from_die): When the scope is NULL, just drop the whole thing on the floor. 2014-04-08 Dodji Seketeli Fix the static data member recognition hack * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir): When trying to recognize the global var_decl as being definition variables for static data members, lookup the declaration for the data member in the relevant class. If found, then just flag the var_decl for the data member as being static; no need to add a var_decl as data member in that case, that would duplicate the data member. 2014-04-08 Dodji Seketeli Fix looking up a node inside a class * src/abg-ir.cc (lookup_node_in_scope): Do not forget to actually look at the class members. Sigh. 2014-04-07 Dodji Seketeli Work around old dwarf producers forgetting mangled names for functions * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): If lookup using mangled name for a deleted function yields nada, try the lookup with the pretty representation for the function. 2014-04-07 Dodji Seketeli Make type_base::get_{size,alignment}_in_bits virtual * include/abg-ir.h (type_base::get_{size,alignment}_in_bits): Make this virtual. (typedef_decl::get_{size,alignment}_in_bits): Add new member functions. Get the size,alignment from the underlying type and update the current size/alignment if they differ. Keep in mind that the size of an underlying class_decl can change over its lifetime, given how the dwarf reader reads the type information, i.e, there can be a DIE for a class type with no size information that will lead to the creation of a class_decl with size zero. Later during the DWARF reading process, another DIE will supplement the type information, adding size information to that class_decl. In between, a typedef_decl might have been created with the first version of the class_decl that has a zero size. I guess this should be extended to the other type constructs that have an underlying type (qualified types, references and pointers). 2014-04-07 Dodji Seketeli Look through typedefs when setting SIZE_OR_OFFSET_CHANGE_CATEGORY * include/abg-fwd.h (is_class_type): Declare new functions. * src/abg-comp-filter.cc (harmful_filter::visit): Use the above to convert a type into a class. * src/abg-ir.cc (is_class_type): Define the new function. 2014-04-06 Dodji Seketeli Add a new DECL_NAME_CHANGE_CATEGORY change category * include/abg-comparison.h (enum diff_category::DECL_NAME_CHANGE_CATEGORY): New enumerator. * src/abg-comparison.cc (report_name_size_and_alignment_changes) ({enum, typedef}_diff::report): Adjust to avoid emitting name change report if the DECL_NAME_CHANGE_CATEGORY category of change is currently disallowed. * abg-comp-filter.cc (decl_name_changed): New static function. (harmless_filter::visit): Detect that the decl name changed and put the current diff node (and its parents) into the DECL_NAME_CHANGE_CATEGORY category. * tools/bidiff.cc (set_diff_context_from_opts): Set the new DECL_NAME_CHANGE_CATEGORY category into the harmless_changes group of categories. * tests/data/test-diff-filter/test6-report.txt: New test input file. * tests/data/test-diff-filter/test6-v0.cc: Likewise. * tests/data/test-diff-filter/test6-v0.o: Likewise. * tests/data/test-diff-filter/test6-v1.cc: Likewise. * tests/data/test-diff-filter/test6-v1.o: Likewise. * tests/data/test-diff-filter/test7-report.txt: Likewise. * tests/data/test-diff-filter/test7-v0.cc: Likewise. * tests/data/test-diff-filter/test7-v0.o: Likewise. * tests/data/test-diff-filter/test7-v1.cc: Likewise. * tests/data/test-diff-filter/test7-v1.o: Likewise. * tests/test-diff-filter.cc: Take the new inputs above to run new tests. * tests/Makefile.am: Add the new files above to the distribution. 2014-04-05 Dodji Seketeli Emit qualified name for typedefs * src/abg-comparison.cc (typedef_diff::report): Emit qualified names for typedefs in diff reports about typedef name changes. 2014-04-05 Dodji Seketeli Fix indentation in distinct type diff report * src/abg-comparison.cc (distinct_diff::report): Do not forget to change line. 2014-04-05 Dodji Seketeli Really compare return types for function types * src/abg-ir.cc (compare_function_types): Compare return types, unless this is a method and the return type is the same type as the containing class type. * tests/data/test-diff-dwarf/test5-report.txt: Reference report for the comparison of the two input binaries below. * tests/data/test-diff-dwarf/test5-v0.cc: Source code for the input binary below. * tests/data/test-diff-dwarf/test5-v0.o: Test input binary. * tests/data/test-diff-dwarf/test5-v1.cc: Source code for the input binary below. * tests/data/test-diff-dwarf/test5-v1.o: Test input binary. 2014-04-05 Dodji Seketeli Add missing tests for previous commits * tests/data/test-diff-dwarf/test4-report.txt: Adjust. * tests/test-diff-dwarf.cc: Run tests for data/test-diff-dwarf/test3-report.txt" and data/test-diff-dwarf/test4-report.txt. 2014-04-05 Dodji Seketeli Categorize through compatible distinct type diffs * src/abg-comparison.cc (report_size_and_alignment_changes): Split this static function out of ... (report_name_size_and_alignment_changes): ... this one. (distinct_diff::report): If the typedef-stripped variants of the diff subjects are of the same kind, display their diff. Otherwise, tell explicitly is the distinct type diff involves a type size change. (distinct_diff::traverse): If the typedef-stripped variants of the diff subjects are of the same kind, traverse that underlying diff sub-tree and propagate the categorizing possibly resulting from that traversal. * tests/data/test-diff-dwarf/test4-v0.o: New test input binary. * tests/data/test-diff-dwarf/test4-v0.cc: Source code for the input binary above. * tests/data/test-diff-dwarf/test4-v1.o: New test input binary. * tests/data/test-diff-dwarf/test4-v1.cc: Source code for the input binary above. * tests/data/test-diff-dwarf/test4-report.txt: Reference report for the difference between the two binaries above. * tests/data/test-diff-filter/test5-v0.o: New test input binary. * tests/data/test-diff-filter/test5-v0.cc: Source code for the input binary above. * tests/data/test-diff-filter/test5-v1.o: New test input binary. * tests/data/test-diff-filter/test5-v1.cc: Source code for the input binary above. * tests/data/test-diff-filter/test5-report.txt: Reference report for the difference between the two binaries above. * tests/test-diff-filter.cc: Adjust to produce a filtered diff for the two input binaries above. * tests/Makefile.am: Adjust to add missing test files to the distribution. 2014-04-04 Dodji Seketeli Slight run-by fixes * src/abg-comparison.cc (corpus_diff::priv::apply_filters_and_compute_diff_stats) (corpus_diff::report): Use compute_diff for types which it has an overload rather than going through the compute_diff_for_decls that would use dynamic casting. 2014-04-04 Dodji Seketeli Do not hook type diff nodes to a parent * abg/comparison.cc (var_diff::var_diff): Do not set parent node for the type diff of the var_diff. (var_diff::traverse): Handle category propagation from the type diff node to the var_diff node. (pointer_diff::underlying_type_diff) (reference_diff::underlying_type_diff) (qualified_type_diff::underlying_type_diff, enum_diff::enum_diff) (base_diff::get_underlying_class_diff) (typedef_diff::underlying_type_diff): Do not set the parent node here. ({pointer_diff, reference_diff, qualified_type, enum_diff, class_diff, base_diff, function_decl_diff, typedef_diff}::traverse): Handle category propagation here. * tests/data/test-diff-filter/test4-v0.o: New input binary. * tests/data/test-diff-filter/test4-v0.cc: Source code for the input binary above. * tests/data/test-diff-filter/test4-v1.o: New input binary. * tests/data/test-diff-filter/test4-v1.cc: Source code for the input binary above. * tests/data/test-diff-filter/test4-report.txt: Reference diff report for the input binaries above. * tests/test-diff-filter.cc:: Run bidiff --no-harmless on the binaries above. 2014-04-04 Dodji Seketeli Fix off-by one comparison bug in comparing function parameters * src/abg-comparison.cc (function_decl_diff::ensure_lookup_tables_populated): Function parameters that are diff'ed start at the first non-implicit parameter, not at the first parameter. Oops. * tests/data/test-diff-dwarf/test3-v0.o: New test input binary. * tests/data/test-diff-dwarf/test3-v0.cc: Source code for the binary above. * tests/data/test-diff-dwarf/test3-v1.o: New test input binary. * tests/data/test-diff-dwarf/test3-v1.cc: Source code for the binary above. * tests/data/test-diff-dwarf/test3-report.txt: Reference report for the diff of the new test inputs. * tests/test-diff-dwarf.cc: Use the test inputs above to run new tests. 2014-04-03 Dodji Seketeli Do not forget parm sub-type changes as opposed to parm changes * src/abg-comparison.cc (function_decl_diff::ensure_lookup_tables_populated): A parm change is valid only when the added parm has a different name from the removed parm. Both have the same index, of course. In that case, do not try to remove the corresponding parm sub-type change. * tests/data/test-bidiff/test-enum0-report.txt: Adjust. * tests/data/test-bidiff/test-enum1-report.txt: Adjust. * tests/data/test-bidiff/test-qual-type0-report.txt: Adjust. * tests/data/test-bidiff/test-struct0-report.txt: Adjust. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. * tests/data/test-diff-dwarf/test1-report.txt: Adjust. * tests/data/test-diff-filter/test0-report.txt: Adjust. * tests/data/test-diff-filter/test01-report.txt: Adjust. * tests/data/test-diff-filter/test1-report.txt: Adjust. * tests/data/test-diff-filter/test2-report.txt: Adjust. * tests/data/test-diff-filter/test3-report.txt: Adjust. 2014-04-03 Dodji Seketeli Remove useless white space * src/abg-ir.cc (look_through_decl_only_class): Remove useless white space. 2014-04-02 Dodji Seketeli Use mangled name for decl comparison when it's present * src/abg-ir.cc (decl_base::operator==(const decl_base& other) const): Use the mangled name of the decl in priority. * src/abg-hash.cc (struct decl_base::hash::operator()): Likewise. * src/abg-comparison.cc (function_decl_diff::report): Do not report a function name change if it doesn't involve a mangled name change. This might change when we start dealing with templates. 2014-04-02 Dodji Seketeli A change involving a decl-only class is not SIZE_OR_OFFSET_CHANGE_CATEGORY * src/abg-comp-filter.cc (harmful_filter::visit): If a size change involves a decl-only class, it certainly shouldn't trigger putting the sub-tree into the SIZE_OR_OFFSET_CHANGE_CATEGORY category. 2014-04-02 Dodji Seketeli Fix heuristics to detect function static-ness for DWARF < 3 * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Make the heuristics work for functions with no parameters. 2014-04-02 Dodji Seketeli Avoid emitting local filtered-out changes in more spots * src/abg-comparison.cc (maybe_report_diff_for_member): Take the diff_context in parameter. Use that to check if local changes of category ACCESS_CHANGE_CATEGORY are filtered-out and do not report the change in that case. ({var_diff, enum_diff, class_diff, base_diff, function_decl_diff}::report): Adjust. 2014-04-02 Dodji Seketeli Add a COMPATIBLE_TYPE_CHANGE_CATEGORY to bidiff --no-harmless * include/abg-comparison.h (diff_category::COMPATIBLE_TYPE_CHANGE_CATEGORY): New enumerator. (operator|=(diff_category&, diff_category)): New declaration. * include/abg-fwd.h (is_typedef, strip_typedef) (types_are_compatible): New declarations. * include/abg-ir.h (operator==(const decl_base_sptr, const decl_base_sptr)): Added the consts here. (operator==(const type_base_sptr, const type_base_sptr)): New declaration. * src/abg-comp-filter.cc (is_compatible_change): New static function. (harmless_filter::visit): Detect compatible changes and add the sub-tree into the new COMPATIBLE_TYPE_CHANGE_CATEGORY if applicable. Cleanup the logic. * src/abg-comparison.cc (operator|=(diff_category&, diff_category)): Define new function. (operator==(const decl_base_sptr l, const decl_base_sptr r)): Add consts. (operator==(const type_base_sptr l, const type_base_sptr r)): Define new operator. (is_typedef, strip_typedef, types_are_compatible): New function definitions. * tests/data/test-diff-filter/test3-report.txt: New test report reference. * tests/data/test-diff-filter/test3-v0.cc: Source code for new test input. * tests/data/test-diff-filter/test3-v0.o: New test input. * tests/data/test-diff-filter/test3-v1.cc: Source code for new test input. * tests/data/test-diff-filter/test3-v1.o: New test input. * tests/test-diff-filter.cc: Adjust to consume the new tests inputs above. * tools/bidiff.cc: Add the new COMPATIBLE_TYPE_CHANGE_CATEGORY into the --harmless group. 2014-04-01 Dodji Seketeli Don't emit local filtered-out changes * src/abg-comparison.cc (represent): For var_decl, do not emit filtered-out local size/offset/access changes. (report_name_size_and_alignment_changes): Take the diff context. Do not report filtered-out local size/offset changes. ({var_diff, enum_diff, class_diff, type_decl_diff}::report): Adjust. * test0-report.txt: Adjust. * test01-report.txt: New reference report for the same inputs test0-v{1,0}.o, but called without the --no-harmless command line. * tests/data/test-diff-filter/test2-v0.cc: Source code for new test input. * tests/data/test-diff-filter/test2-v1.cc: Likewise. * tests/data/test-diff-filter/test2-v0.o: New test input. * tests/data/test-diff-filter/test2-v1.o: Likewise. * tests/data/test-diff-filter/test2-report.txt: Reference report for new test input. * tests/test-diff-filter.cc: Consume the test inputs above. * tests/Makefile.am: Add the new test inputs above to the distribution. 2014-04-01 Dodji Seketeli Compact & intuitive reporting for changed function parameters * include/abg-comparison.h (unsigned_changed_parm_map) (unsigned_parm_map): New typedefs. * src/abg-comparison.cc (function_decl_diff::subtype_changed_parms): Renamed this from changed_parms. (function_decl_diff::priv::subtype_changed_parms_}): Renamed this from changed_parms_; (function_decl_diff::priv::{deleted_parms_by_id_, added_parms_by_id_, changed_parms_by_id_}): New members. (function_decl_diff::ensure_lookup_tables_populated): Update the new priv::changed_parms_by_id_ member to contain the parameters that got changed, as opposed to the subtype_changed_parms_ member that contain parameters that got a sub-type change. The other priv::*_by_id_ members are helpers for this. Update them too. (function_decl_diff::subtype_changed_parms): Renamed this from ::changed_parms. (function_decl_diff::report): Report separately about parameters having a sub-type change, and parameters that got changed. Note that in both cases, the change is necessarily to a compatible type. * data/test-diff-dwarf/test2-v0.cc: New test file. * data/test-diff-dwarf/test2-v0.o: Likewise. * data/test-diff-dwarf/test2-v1.cc: Likewise. * data/test-diff-dwarf/test2-v1.o: Likewise. * data/test-diff-dwarf/test2-report.txt: Likewise. * tests/Makefile.am: Add the new test files above to the distribution. * tests/test-diff-dwarf.cc: Consume the input files above to actually perform a regression test. 2014-03-31 Dodji Seketeli Fix thinko class_diff traversing. * src/abg-comparison.cc (class_diff::traverse): Fix thinking in introduced by commit "6709478 Fix infinite loop when traversing classes and their members" * tests/data/test-diff-filter/test1-v{0,1}.o: New test binary input files. * tests/data/test-diff-filter/test1-v{0,1}.cc: Source code for the above. * tests/data/test-diff-filter/test1-report.txt: Reference report for the diffing of the two binary input files above. * tests/test-diff-filter.cc: Make the test run on the new input above. * tests/Makefile.am: Add the new material to the distribution. 2014-03-31 Dodji Seketeli Add forgotten test output adjustment * tests/data/test-diff-filter/test0-report.txt: Adjust for the commit "a8d5284 Fix diff report indentation issue" * tests/data/test-diff-dwarf/test{0,1}-report.txt: Likewise. 2014-03-31 Dodji Seketeli Add forgotten source file for binary test input * tests/data/test-diff-dwarf/test1-v0.cc: New file. * tests/data/test-diff-dwarf/test1-v1.cc: Likewise. 2014-03-31 Dodji Seketeli Fix diff report indentation issue * abg-comparison.cc (corpus_diff::report): Indent the details of function changes. 2014-03-31 Dodji Seketeli Fix infinite loop when traversing classes and their members * src/abg-comparison.cc (TRY_{PRE,POST}_VISIT_CLASS_DIFF): New macros. (class_diff::priv::traversing_): New flag. (class_diff::priv::priv): New constructor to initialize the new flag above. (class_diff::traversing): Do not traverse the diff again if it's being traversed already. 2014-03-31 Dodji Seketeli Fix access_changed and data_member_offset_changed predicates * src/abg-comp-filter.cc (access_changed) (data_member_offset_changed): Fix detection of membership. 2014-03-29 Dodji Seketeli Take filtering in account in diff stats & better categorizing * include/abg-comparison.h (diff_category::ACCESS_CHANGE_CATEGORY): Renamed ACCESS_CHANGED_CATEGORY into this. (diff_category::SIZE_OR_OFFSET_CHANGE_CATEGORY): Renamed SIZE_CHANGED_CATEGORY into this. Changed its semantics to incorporate offset changes as well. * src/abg-comparison.cc (struct noop_deleter): Move this up. (represent): Do not report filtered out data members. (report_mem_header): Add a new num_filtered parameter to take filtered-out members in account in members report headers. Adjust. (class_diff::priv::{count_filtered_bases, count_filtered_data_members, count_filtered_member_functions}): New member functions. When a member is filtered, do not report it all. ({enum_diff, class_diff}::report): Adjust. Take filtered members into account in headers. (corpus_diff::priv::apply_filters_and_compute_diff_stats): New member function. (corpus_diff::priv::emit_diff_stats): Renamed emit_corpus_diff_stats into this. Change it to take the stats in parameter. (corpus_diff::report): Adjust to re-use the above. Filter varibles as well. Take the filtered functions & variables in account in the stats. Do not report filtered-out functions & variables at all. * src/abg-comp-filter.cc (type_size_changed, access_changed) (data_member_offset_changed): New predicates. ({harmless, harmful}_filter::visit): Adjust to use the new predicates above. Update the harmful variant for the new SIZE_OR_OFFSET_CHANGE_CATEGORY category. * tools/bidiff.cc (set_diff_context_from_opts): Adjust for the categories name changes. * tests/data/test-diff-filter/test0-report.txt: New test input. * tests/data/test-diff-filter/test0-v0.cc: Likewise. * tests/data/test-diff-filter/test0-v0.o: Likewise. * tests/data/test-diff-filter/test0-v1.cc: Likewise. * tests/data/test-diff-filter/test0-v1.o: Likewise. * tests/test-diff-filter.cc: New test harness. * tests/Makefile.am: Add the new test files above to the distribution. 2014-03-29 Dodji Seketeli Fix var_diff length determination * src/abg-comparison.cc (var_diff::length): Just compare the two diff subjects. 2014-03-29 Dodji Seketeli Fix typos in the test-diff-dwarf.cc source code * tests/test-diff-dwarf.cc: Fix various typos. 2014-03-27 Dodji Seketeli Initial implementation of diff tree node filtering * include/abg-comp-filter.h: New file. * include/Makefile.am: Add the new include/abg-comp-filter.h to the source distribution. * include/abg-comparison.h (enum visiting_kind, diff_category): New enums. (operator|): Declare new operator declaration for the new visiting_kind enum. (operator{|,^,&,~}): Declare new operator decl for the new diff_category enum. (diff_context::{get_allowed_category, set_allowed_category, switch_categories_on, switch_categories_off, diff_filters, add_diff_filter, maybe_apply_filters}): Declare new member functions. (diff::{parent_, category_}): New members. (diff::diff): Adjust. (diff::{get_parent, set_parent, get_category, add_to_category, is_filtered_out, to_be_reported}): New members. (diff_node_visitor::{get_visiting_kind, set_visiting_kind}): New members. (diff_node_visitor::visit): Add a new flag to saying if the visitor is being called in post or pre children traversing mode. * src/abg-comparison.cc (operator|): Declare new operator declaration for the new visiting_kind enum. (operator{|,^,&,~}): Declare new operator decl for the new diff_category enum. (diff_context::priv::{allowed_category_, filters_}): New members. (diff_context::diff_context): Add all known filters. (diff_context::{get_allowed_category, set_allowed_category, switch_categories_on, switch_categories_off, diff_filters, add_diff_filter, maybe_apply_filters}): Define new member functions. (diff::{is_filtered_out, to_be_reported}): Define new members. (*::report): Use the new diff::to_be_reported function. (*::traverse): Adjust for pre/post visiting. (var_diff::var_diff): Chain the type diff node to its parent. ({pointer_diff, reference_diff, qualified_type_diff, typedef_diff}::underlying_type_diff): Chain the underlying type diff node to its parent. (enum_diff::enum_diff): Likewise. (base_diff::underlying_class_diff): Likewise. ({class_diff, corpus_diff}::report): Do not report changed (member) functions that have been filtered out. Rather report that they have been filtered out. ({function_decl_diff, class_diff}::traverse): Chain underlying type diff nodes to their parent. (diff_node_visitor::visit): Add a new flag to saying if the visitor is being called in post or pre children traversing mode. Make sure to call the default diff::visit overload. * src/abg-comp-filter.cc: New file. * src/Makefile.am: Add the new abg-comp-filter.cc to the source distribution. * tools/bidiff.cc (options::show_harm{ful,less}_changes): New members. (display_usage): Add usage strings for --no-harmless and --no-harmful options. (parse_command_line): Parse --no-harmless and --no-harmful command line options. (set_diff_context_from_opts): Populate the diff context accordingly. 2014-03-26 Dodji Seketeli Add missing headers double inclusion guards * include/abg-comparison.h: Add a missing double inclusion guard. * include/abg-diff-utils.h: Likewise. 2014-03-26 Dodji Seketeli Add a missing apostrophe to access reporting * src/abg-comparison.cc (represent): For member var_decls, add a missing apostrophe after the access. * tests/data/test-diff-dwarf/test0-report.txt: Update test report. 2014-03-21 Dodji Seketeli Fix diff emptiness detection for function_decl_diff nodes * src/abg-comparison.cc (function_decl_diff::length): Just compare the two functions here, damit. * tests/data/test-diff-dwarf/test0-report.txt: Adjust. 2014-03-21 Dodji Seketeli Fixlets in the bidiff regression testing harness * tests/test-bidiff.cc (main): Fix a typo. Fix the path to the output path. 2014-03-21 Dodji Seketeli Initial regression test for dwarf diffing * tests/test-diff-dwarf.cc: New dwarf diffing regression test harness. * tests/data/test-diff-dwarf/test0-report.txt: New test input. * tests/data/test-diff-dwarf/test0-v0.cc: Likewise. * tests/data/test-diff-dwarf/test0-v0.o: Likewise. * tests/data/test-diff-dwarf/test0-v1.cc: Likewise. * tests/data/test-diff-dwarf/test0-v1.o: Likewise. * tests/Makefile.am: Add the new test inputs from tests/test-diff-dwarf.cc and tests/data/test-diff-dwarf/* to the build system. 2014-03-21 Dodji Seketeli Rename test-walker.cc into test-ir-walker.cc * tests/test-ir-walker.cc: Renamed test-walker.cc into this. * tests/Makefile.am: Adjust. The generated binary is now testirwalker. 2014-03-21 Dodji Seketeli Initial diff tree traversal infrastructure * include/abg-comparison.h (struct diff_traversable_base, struct diff_node_visitor): New type. (class diff): Extends the new diff_traversable_base. ({diff, distinct_diff, var_diff, pointer_diff, reference_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, function_decl_diff, type_decl_diff, typedef_diff, translation_unit_diff, corpus_diff}::traverse): New methods. (function_decl_diff::return_type_diff): New accessor. Renamed return_diff into this. (translation_unit_diff::{first, second}_translation_unit): New accessors. (corpus_diff::{deleted, added, changed}_functions): New accessors. * src/abg-comparison.cc ({distinct_diff, var_diff, pointer_diff, reference_diff, qualified_type_diff, enum_diff, class_diff, base_diff, scope_diff, function_decl_diff, type_decl_diff, typedef_diff, translation_unit_diff, corpus_diff}::traverse): New function implementations. (maybe_report_diff_for_member): Renamed maybe_report_diff_for_class_members into this. (var_diff::report): Adjust. (struct translation_unit_diff::priv): New private type. (translation_unit_diff::translation_unit_diff): Instantiate the new priv_ member. (translation_unit_diff::{first,second}_translation_unit): New accessors. (corpus_diff::{deleted, added, changed}_functions): New function implementations. (diff_node_visitor::visit): New function implementations. 2014-03-19 Dodji Seketeli Make tree walking preemptive * include/abg-traverse.h (traversable_base::traversable): Change the signature of this to return a boolean. * include/abg-ir.h (ir_traversable_base::traverse): Change the signature of this to return a boolean. (*::traverse): Adjust. (ir_node_visitor::visit): Change the signature of this to return a boolean. * src/abg-corpus.cc (symtab_build_visitor_type::visit): Adjust. * src/abg-ir.cc (::traverse): Adjust. * tests/test-walker.cc (name_printing_visitor::visit): Adjust. 2014-03-26 Jonathan Wakely Fix comment typos * include/abg-diff-utils.h (compute_diff): Fix typo in apidoc comment. 2014-03-24 Dodji Seketeli Follow DW_AT_abstract_origin and add missing mangled name * src/abg-dwarf-reader.cc (build_function_decl): Change signature to take function_decl to which one shall add properties that got added by subsequent DIEs later. (build_class_type_and_add_to_ir): Adjust. (build_function_decl): Allow adding new properties to an existing function_decl. Add the mangled name in particular. * tests/data/test-read-dwarf/test1.abi: Update test. 2014-03-20 Dodji Seketeli Fix destructor naming. * src/abg-ir.cc (function_decl::get_pretty_representation): In DWARF at least, the destructor function name already contains the '~'. No need to add it. 2014-03-20 Dodji Seketeli Better static function determination heuristic * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Better heuristic. 2014-03-20 Dodji Seketeli Dynamically wire class_decl::base_spec hashing * include/abg-ir.h (decl_base::get_hash): Make this virtual. (class_decl::base_spec::get_hash): Declare a new virtual overload. * src/abg-ir.cc (class_decl::base_spec::get_hash): Define. 2014-03-20 Dodji Seketeli Slight indentation fix in the diff report * src/abg-comparison.cc (class_diff::report): Indentation fix for member function changes report. 2014-03-20 Dodji Seketeli Get rid of class_decl::member_function * include/abg-fwd.h (is_member_function) (get_member_function_is_{ctor,dtor,const}) (get_member_function_vtable_offset): New function declarations. * include/abg-ir.h (class_decl::member_function): Remove. (class_decl::member_functions): Adjust. This is now just a vector of method_decl_sptr. (class_decl::add_member_function): Remove the overload taking class_decl::member_function. Adjust the other overload to take a method_decl_sptr. (class mem_fn_context_rel): New class. (class_decl::method_decl::set_scope): New virtual overload. (class_decl::member_function): Remove. (operator==): Remove the overload taking a class_decl::member_function. (class_decl::member_function::hash): Remove. (ir_node_visitor::visit): Remove the overload taking a class_decl::member_function. * include/abg-comparison.h (changed_member_function_sptr) (string_member_function_sptr_map): Adjust. * src/abg-comparison.cc (represent): Adjust the overload taking a class_decl::member_function to take a class_decl::method_decl. (class_diff::{report, ensure_lookup_tables_populated}): Adjust. * src/abg-corpus.cc (symtab_build_visitor_type::visit): Remove the overload taking a class_decl::member_function. * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Adjust. * src/abg-hash.cc (decl_base::hash::operator()): Use the fully qualified name of the decl in the hash, to increase the likelihood of avoiding hash collisions. (method_type::hash::operator()): Likewise. (function_decl::hash::operator()): Take member functions in account. (class_decl::member_function::hash::operator()): Remove. (class_decl::hash::operator()): Adjust. (type_base::dynamic_hash::operator()): Adjust. * src/abg-ir.cc (is_member_function) (get_member_function_is_{ctor,dtor,const}) (get_member_function_vtable_offset): New function definitions. (function_decl::get_pretty_representation): Adjust. (function_decl::operator): Take member functions in account here. (class_decl::insert_member_decl): Adjust. (mem_fn_context_rel::~mem_fn_context_rel): New definition. (class_decl::member_function::*): Remove. (class_decl::method_decl::set_scope): New definition. (class_decl::get_num_virtual_functions): Adjust. (class_decl::add_member_function): Remove overload taking a class_decl::member_function. Define a new overload taking a class_decl::method_decl. (ir_node_visitor::visit): Remove the overload taking a class_decl::member_function. * src/abg-reader.cc (build_class_decl): Adjust. * src/abg-writer.cc (write_voffset, write_class_decl): Adjust. 2014-03-19 Dodji Seketeli Get rid of class_decl::data_member * include/abg-fwd.h (has_scope): Delete the overloads for type_base. (get_member_is_static): Add an overload for decl_base*. ({is,get,set}_data_member,{get_,set}_data_member_is_laid_out) ({get,set}_data_member_offset): New access declarations. * include/abg-ir.h (class context_rel): Move up. (decl_base::set_context_rel): New definition. (class dm_context_rel): New type. (decl_base::hash_as_member): Remove. (var_decl::set_scope): Declare new virtual member. (class_decl::data_member): Remove. (ir_node_visitor::visit): Remove the overload for class_decl::data_member. (represent_data_member): Remove the represent overload for class_decl::data_member into this. Make it take a var_decl. (represent): Change the overload that takes two class_decl::data_member take two var_decl. And adjust it. (class_diff::report): Adjust. * src/abg-corpus.cc (symtab_build_visitor_type::visit): Remove the overload that takes a class_decl::data_member*. Adjust the overload that takes a var_decl to recognize (static) data members. * src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir) (build_class_type_and_add_to_ir, build_ir_node_from_die): Adjust. * src/abg-hash.cc (var_decl::hash::operator()): Adjust. (class_decl::data_member::hash::operator()): Remove. (decl_base::hash::operator()): Take the context relationship in account here. (decl_base::hash_as_member::operator()): Remove. ({enum_type_decl,typedef_decl}::hash::operator()): Adjust. (class_decl::member_function::hash::operator()): Adjust. (type_base::dynamic_hash::operator()): Adjust. * src/abg-ir.cc (dm_context_rel::~dm_context_rel): New definition. (has_scope): Remove overload for type_base. (get_member_is_static): New overload for decl_base*. (is_data_member): New function definition. ({get,set}_data_member_{offset,is_laid_out}): Define new accessors. (var_decl::set_scope): Define new member function. Make this set a dm_context_rel as the context relationship. (var_decl::operator==): Adjust to take in account the new data member relationship. (class_decl::class_decl): Adjust. (class_decl::insert_member_decl): Adjust. (class_decl::add_data_member): Remove the overload for class_decl::data_member. (class_decl::add_data_member): Adjust the overload for var_decl. (operator==): Remove overload for class_decl::data_member*. (class_decl::data_member::operator==): Likewise. (ir_node_visitor::visit): Remove overload for class_decl::data_member. * src/abg-writer.cc (write_layout_offset, write_class_decl): Adjust. * tests/data/test-read-write/test20.xml: Adjust. 2014-03-18 Dodji Seketeli Better base class diff reporting * include/abg-comparison.h (class base_diff): New. * include/abg-ir.h (function_decl::get_first_non_implicit_parm): New member function. (function_type::get_first_non_implicit_parm): Likewise. * src/abg-comparison.cc (base_has_changed): Change parm to take class_decl::base_spec_sptr. (class_diff::ensure_lookup_tables_populated): Compare the base specs not just the base classes. (class_diff::report): Adjust. Report sub-type changes in the member functions. (base_diff::*): Define member functions. (compute_diff): Define an overload for base_diff_sptr. * src/abg-hash.cc ({function_type, method_type}::hash::operator()): Do not hash the implicit parm of member functions. (class_decl::hash::operator()): Do not hash member types. * src/abg-ir.cc (decl_base::decl_base): Initialize the hashing_started_ member that got moved here from class_decl. (decl_base::get_hash): Do not set the hash if it's being set b/c we are in a class_decl. (decl_base::operator==) Do not compare hashes for now. Two decls can have different hashes and compare equal; think about an incomplete type foo, that compares equal with a complete foo. Their hashes will be different though. So for now, just avoid comparing these. (compare_function_types): Avoid comparing the implicit parameter for member functions. ({function, method}_type::get_first_non_implicit_parm): New definition. * tests/data/test-read-write/test20.xml: Update. 2014-03-13 Dodji Seketeli Do not report change in typedef underlying type is there is none * src/abg-comparison.cc (typedef_diff::report): Do not forget to check the length of the diff of the underlying type before sending its diff report down the wire. 2014-03-13 Dodji Seketeli Avoid hashing a access & static-ness of member types twice * src/abg-hash.cc (class_decl::hash::operator()): Do hash the 'member' part of the member types here, it has been hashed already. 2014-03-13 Dodji Seketeli Set class {size,loc} when adding members to a decl-only class * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Do not forget to set class size and location when adding members to a declaration-only class, turning it into a definition class. 2014-03-13 Dodji Seketeli Use the same representation for member and non-member types * include/abg-fwd.h (is_at_class_scope): Add new oveloads. (as_non_member_type, as_non_member_class_decl): Remove. (has_scope, is_member_decl, is_member_type): New function declarations. (get_member_is_static, set_member_is_static): Likewise. * include/abg-ir.h (enum access_specifier): Move to the abigail:: namespace, from ... (class_decl::access_specifier): ... here. (class context_rel): New type. (decl_base::hash_as_member): New hasher. (decl_base::context_): Change the type of this to context_rel_sptr. (decl_base::get_context_rel): New protected getter. (decl_base::get_scope): Move this out-of-line. (class_decl::member_type): Remove. (class_decl::member_types): Adjust this typedef. (class_decl::{insert,add}_member_type): Make these take a type_base_sptr now. (class_decl::add_member_type): Change the overload that returned a member_type to return a type_base_sptr. (get_member_access_specifier, set_member_access_specifier): New function declarations. * include/abg-comparison.h (class member_type_diff): Remove. (compute_diff): Remove the overload for member_type_diff. * src/abg-comparison.cc (compute_diff_for_types): Adjust for the removal of class_decl::member_type. (maybe_report_diff_for_class_members): New static function. (report_name_size_and_alignment_changes): Do not report a name change just because of a struct -> class change. ({var_diff, enum_diff, function_decl_diff}::report): Use the new maybe_report_diff_for_class_members. (class_diff::report): Adjust for the removal of class_decl::member_type. Use the new maybe_report_diff_for_class_members. (class member_diff): Remove. * src/abg-dwarf-reader.cc (die_access_specifier) (get_scope_for_die, build_translation_unit_and_add_to_ir) (build_class_type_and_add_to_ir, build_function_decl) (build_ir_node_from_die): Adjust. * abg-hash.cc (struct decl_base::hash_as_member): Define. ({scope_type_decl, enum_type_decl, typedef_decl}::hash::operator()): Use the decl_base::hash_as_member. * src/abg-ir.cc (decl_base::decl_base): Adjust. (decl_base::get_scope): New out-of-line getter. (decl_base::{operator==, set_scope): Adjust. (has_scope, is_member_decl, is_member_type) (get_member_access_specifier, set_member_access_specifier) (get_member_is_static, set_member_is_static, is_at_class_scope): New function definitions. (as_non_member_type, as_non_member_class_decl): Remove. (get_node_name): Adjust. (class_decl::{class_decl, set_earlier_declaration, insert_member_decl, insert_member_type, add_member_type): Likewise. (class_decl::member_type::*) Remove. * src/abg-reader.cc (read_access, build_qualified_type_decl) (build_reference_type_def, build_typedef_decl) (build_class_decl): Adjust. * src/abg-writer.cc (write_access, write_member_type) (write_class_decl): Likewise. 2014-03-12 Dodji Seketeli Avoid more static_casts in the (comparison) code * src/abg-ir.cc (class_decl::insert_member_type, operator==): Remove static_casts. (class_decl::member_type::operator==): Likewise. (class_decl::member_class_template::operator==): Likewise. 2014-03-12 Dodji Seketeli Allow adding members to decl-only classes making them defined classes * include/abg-fwd.h (lookup_type_in_scope) (lookup_var_decl_in_scope): New declarations. * include/abg-ir.h (class_decl::get_is_declaration_only): Rename is_declaration_only on this. (class_decl::set_is_declaration_only): * src/abg-comparison.cc (try_to_diff) (class_diff::ensure_lookup_tables_populated) (scope_diff::ensure_lookup_tables_populated): Update for the get_is_declaration_only renaming. * src/abg-dwarf-reader.cc (get_scope_for_die): Likewize. (build_class_type_and_add_to_ir): Make sure that a member type or data member is not already present in the class before adding it. Also, if a decl-only class gets a data member, it's not a decl-only class anymore. * src/abg-hash.cc (class_decl::hash::operator()): Update for the get_is_declaration_only renaming. * src/abg-ir.cc (scope_decl::find_iterator_for_member) (look_through_decl_only_class): Likewise. (lookup_type_in_scope, lookup_var_decl_in_scope, get_node_name) (convert_node_to_decl, lookup_node_in_scope) (lookup_type_in_scope): New definitions. (class_decl::{set_definition_of_declaration, set_earlier_declaration, operator==}): Update for the get_is_declaration_only renaming. * src/abg-reader.cc (build_class_decl): Likewise. * src/abg-writer.cc (write_class_is_declaration_only): Likewise. 2014-03-12 Jonathan Wakely Fixed typos in abg-diff-utils.h * include/abg-diff-utils.h (compute_diff): Fix typos in the API doc. 2014-03-11 Dodji Seketeli Initialize a variable * tools/bilint.cc (main): Initialize the 'r' variable. 2014-03-11 Dodji Seketeli Do not declare classes before defining them anymore * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Do not declare classes before defining them because both the declaration and the definition now compare equal. * tests/data/test-read-dwarf/test1.abi: Update test. * tests/data/test-read-write/test20.xml: Likewise. 2014-03-11 Dodji Seketeli Little style fix * src/abg-comparison.cc (class_diff::report): Slight style fix. 2014-03-10 Dodji Seketeli Better support for decl-only classes in diffing and comparison * include/abg-fwd.h (look_through_decl_only_class): New function declaration. * src/abg-comparison.cc (class_diff::length): Just compare the two classes. (compute_diff): Look through the two classes if they are decl-only, and use their declaration for the diffing. * src/abg-ir.cc (look_through_decl_only_class): Define this new entry point. (class_decl::set_definition_of_declaration): Allow setting a definition that is itself a declaration-only. * src/abg-writer.cc (write_class_decl): Declaration-only can now have members, namely member types. 2014-03-10 Dodji Seketeli Fix comparison wrt hash number * src/abg-ir.cc (decl_base::operator==): Do not consider empty hashes. (class_decl::operator==): Better support for comparing decl-only classes against non-decl-only classes. 2014-03-10 Dodji Seketeli Better support of class DIEs with DW_AT_specification * src/abg-dwarf-reader.cc (get_scope_for_die): The definition of a declaration-only class can be NULL. Do not look through in that case. (build_class_type_and_add_to_ir): Support adding class members to an existing class. (build_ir_node_from_die): If a class DIE has a DW_AT_specification, get the specification DIE, get its matching IR node and add the current members of the current DIE to that IR node. 2014-03-10 Dodji Seketeli Tell struct and class apart * include/abg-ir.h (class_decl::is_struct_): New member. (class_decl::class_decl): Take an additional is_struct member. (class_decl::is_struct): New getter. * src/abg-ir.cc (class_decl::class_decl): Initialize the new is_struct_ data member. (class_decl::get_pretty_representation): Tell struct and class apart. * abg-reader.cc (read_is_struct): New static function. (build_class_decl): Capture the struct-ness of the class. * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Likewise. * src/abg-writer.cc (write_is_struct): New static function. (write_class_decl): Write the struct-ness of the class. * tests/data/test-read-dwarf/test1.abi: Update test. 2014-03-06 Dodji Seketeli Fix typedef_diff emptyness detection * src/abg-comparison.cc (typedef_diff::length): Do not mask away the dynamic type of the typedef_decl before the comparison. 2014-02-28 Dodji Seketeli Add --drop/--keep options to bidiff * include/abg-sptr-utils.h: New file. * include/Makefile.am: Add abg-sptr-utils. to the build system. * include/abg-libxml-utils.h (reader_sptr, xml_char_sptr): Remove these typedefs as there are now in abg-sptr-utils. (build_sptr): Likewise for this template and its specializations declarations. * src/abg-libxml-utils.cc (sptr_utils::build_sptr): Mode the definition of the specializations for xmlTextReader and xmlChar into the sptr_utils namespace. * include/abg-corpus.h (corpus::{get_regex_patterns_of_fns_to_suppress, get_regex_patterns_of_vars_to_suppress, get_regex_patterns_of_fns_to_keep, get_regex_patterns_of_vars_to_keep}): Declare new member functions. * src/abg-comparison.cc (sptr_utils::regex_t_deleter): Define new functor. (build_sptr) Define new specialization for regex_t. (struct array_deleter): Remove unused functor. (corpus::priv::regex_patterns_{fns,vars}_to_{suppress,keep}): New data members. (symtab_build_visitor_type::regex_patterns_{fns,vars}_to_{suppress,keep}): Likewise. (symtab_build_visitor_type::r_{fns,vars}_{suppress,keep})): Likewise. (symtab_build_visitor_type::symtab_build_visitor_type): Update the signature of this constructor to take regex patterns for functions and variables to suppress and to keep. Also, initialize the data members from these new parameters. (symtab_build_visitor_type::regex_{fns,vars}_{suppress,keep}): New member functions. (symtab_build_visitor_type::{add_fn_to_wip_fns, add_var_to_wip_vars}): Likewise. (symtab_build_visitor_type::visit) Use either add_fn_to_wip_fns or add_var_to_wip_vars depending on the overload of the visit() member. (corpus::priv::build_symbol_table): Update for the change of the symtab_build_visitor_type constructor signature. (corpus::get_regex_patterns_of_{fns,vars}_to_{suppress,keep}): Define new member functions. * tools/bidiff.cc (options::{drop,keep}_{fn,var}_regex_patterns}): New data member. (display_usage): Add help strings for --drop, --drop-fn, --drop-var, --keep, --keep-fn, --keep-var (parse_command_line): Parse the command lines above. (set_corpus_keep_drop_regex_patterns): Define new static function. (main): Use the new set_corpus_keep_drop_regex_patterns. 2014-02-28 Dodji Seketeli Style fix in the dwarf reader * src/abg-dwarf-reader.cc (die_is_public_decl): Rename is_public_decl into this. (die_is_declaration_only): Rename is_declaration_only into this. (build_class_type_and_add_to_ir, build_var_decl) (build_function_decl): Adjust for the renames above. 2014-02-28 Dodji Seketeli Skip artificial (member) functions from DWARF * src/abg-dwarf-reader.cc (die_is_artificial): New static function. (build_class_type_and_add_to_ir, build_ir_node_from_die): Use the die_is_artificial function to test if the function DIE is artificial and then skip it. 2014-02-28 Dodji Seketeli Fix function parameter addition/deletion/change detection * include/abg-ir.h (function_decl::parameter::get_name_id): Declare new entry point. * src/abg-comparison.cc (function_decl_diff::ensure_lookup_tables_populated): Use the new function_decl::parameter::get_name_id() for the unique name of the parameter. Also, fix a little logic error: if a parm is deleted and inserted, in all cases, consider it as not deleted. 2014-02-28 Dodji Seketeli Add a --stat option to bidiff * include/abg-comparison.h (diff_context::show_stats_only): Declare new accessors. * src/abg-comparison.cc (diff_context::priv::show_stats_only_): New member. (diff_context::show_stats_only): Define new accessors. (corpus_diff::report): If showing stats only, quit right after showing the summary. * tools/bidiff.cc (options::show_stats_only): New data member. (options::options): Initialize the new data member. (display_usage): Add help string for --stat. (parse_command_line): Parse the --stat option. (set_diff_context_from_opts): Update to set the show_stats_only onto the context. Cleanup the logic to make it more compact. 2014-02-28 Dodji Seketeli Report about functions of different names * src/abg-comparison.cc (function_decl_diff::report): Consider the case of functions with different names. This doesn't happen in the current pipeline b/c they just show up as deleted/added functions so the function reporter doesn't see them as they have been already reported by now. 2014-02-28 Dodji Seketeli Fix length calculation for type diffs. * src/abg-comparison.cc (diff_length_of_type_bases): Fix stupid harmful thinko here. 2014-02-28 Dodji Seketeli Fix calculation of the length of distinct_diff * src/abg-comparison.cc (distinct_diff::length): Also perform a deep comparison here. 2014-02-28 Dodji Seketeli Fix diff length calculation for typedef diffs * src/abg-comparison.cc (typedef_diff::length): Just use comparison for this. 2014-02-28 Dodji Seketeli Fix layout of diff summary * src/abg-comparison.cc (corpus_diff::priv::emit_corpus_diff_stats): Remove useless vertical and horizontal white spaces. 2014-02-28 Dodji Seketeli Fix indentation of pieces of class diff report * src/abg-comparison.cc (represent, class_diff::report): Fix indentation. 2014-02-28 Dodji Seketeli Fix detection of entities of different kinds for diff purposes * src/abg-comparison.cc (distinct_diff::entities_are_of_distinct_kinds): Consider two NULL decls are distinct types for the purpose of diffing. This is just a shortcut to avoid creating a null_diff type for now. But then, stop considering same pointers as different. This was a bug. 2014-02-28 Dodji Seketeli Constify function_decl::parameter::get_type_pretty_representation() * include/abg-ir.h (function_decl::parameter::get_type_pretty_representation): This is now const. 2014-02-28 Dodji Seketeli Improve API doc for the location machinery * include/abg-ir.h (class location): Improve doc. (decl_base::{get,set}_location): Likewise. 2014-02-26 Dodji Seketeli Remove useless dynamic cast * src/abg-ir.cc (class_decl::insert_member_decl): Remove useless dynamic cast from here. 2014-02-26 Dodji Seketeli Insert reference, pointers and qual types at their declaration point * src/abg-dwarf-reader.cc (build_ir_node_from_die): Insert reference, pointers and qualified types at the point where we see them, in their scope, rather than under the scope of their underlying type. This is because their might be first declared as member types and we don't want to loose that information. 2014-02-24 Dodji Seketeli Fix documentation for the diff_utils namespace * include/abg-diff-utils.h (namespace diff_utils): Add comment. (compute_diff): Update comments for some overloads where they were missing. 2014-02-21 Dodji Seketeli Misc style fixes * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): use as_non_member_class_decl rather that complicated casting. src/abg-ir.cc (var_decl::get_pretty_representation): Use get_type_declaration rather than casting. 2014-02-21 Dodji Seketeli Fix a glitch in member data diff reporting * src/abg-comparison.cc (represent): Do not forget the "'" around the access specifier. 2014-02-21 Dodji Seketeli Proper support for diffing member types * include/abg-comparison.h (class member_type_diff): New class. (member_type_diff_sptr): New convenience typedef. (compute_diff): New overload for member_type_diff. * src/abg-comparison.cc (struct member_type_diff::priv): New definition. (member_type_diff::{first_member_type, second_member_type, underlying_type_diff, length}): New member function definitions. (compute_diff): New definition for member type diffs. (compute_diff_for_types): Support diffing member types. (class_diff::report): Do not use strip member types now that we can properly diff them. 2014-02-21 Dodji Seketeli Fix the support for printing cv-qualified names * include/abg-ir.h (decl_base::{location_, name_, qualified_parent_name_, qualified_name_}): Make these data members protected rather than private. (decl_base::get_qualified_parent_name): Declare new member functions. (decl_base::get_qualified_name): Make the core overload virtual. Simplify the other overload that calls the core one. (qualified_type_def::build_name): Declare new protected helper function. (qualified_type_def::{get_cv_quals_string_prefix, get_qualified_name}): Declare new functions. (pointer_type_def::{get_qualified_name}}): Likewise. (class_decl::member_type::get_qualified_name): Likewise. * src/abg-ir.cc (decl_base::get_qualified_parent_name): New definition. (decl_base::get_name): Make this out-of-line. (decl_base::get_qualified_name): The signature of this got simplified. Make it use the new get_qualified_parent_name. (qualified_type_def::{build_name, get_qualified_name, get_cv_quals_string_prefix}): New definitions. (qualified_type_def::qualified_type_def): Update the constructor to use the new build_name function above. (pointer_type_def::get_qualified_name): New definitions. (reference_type_def::get_qualified_name): Likewise. (class_decl::member_type::get_qualified_name): Likewise. 2014-02-21 Dodji Seketeli Misc style fix * src/abg-comparison.cc (represent): Remove useless curly braces and vertical spaces. 2014-02-21 Dodji Seketeli Support DW_AT_specification on class/struct DIEs * src/abg-dwarf-reader.cc (build_ir_node_from_die): Support DW_AT_specification on DW_TAG_{class,structure}type. 2014-02-21 Dodji Seketeli Avoid comparing member types and class templates * src/abg-comparison.h (compute_diff): For class_decl_sptr, do not compare member types and member class templates. This adds a lots of noise that is not necessarily useful for now. * tests/data/test-bidiff/test-qual-type0-report.txt: Update tests. * tests/data/test-bidiff/test-struct0-report.txt: Likewise. * tests/data/test-bidiff/test-struct1-report.txt: Likewise. 2014-02-21 Dodji Seketeli Fix the report of added/removed function parameters * src/abg-comparison.cc (function_decl_diff::priv::{inserted_parms_, removed_parms_}): Remove these. (function_decl_diff::ensure_lookup_tables_populated): Fix thinko. Avoid using the members removed above. Use one less loop to update the changed params. (function_decl_diff::report): Avoid using the removed_parms_ data member that was removed above. 2014-02-21 Dodji Seketeli Put the setter of access specifiers in class_decl::member_base * include/abg-ir.h (class_decl::member_base::set_access_specifier): Put the setter for access specifier here, where it belongs ... (class_decl::member_type::set_access_specifier): ... not here. 2014-02-21 Dodji Seketeli First approach to avoid duplication of IR nodes for forward-declared classes * src/abg-dwarf-reader.cc (is_declaration_only): Put this back (I removed it earlier). (build_class_type_and_add_to_ir): If the class is a declaration-only (a forward declaration), do not add a new declaration only IR node. 2014-02-21 Dodji Seketeli Do not forget to set the indexes of fn parms * include/abg-ir.h (function_type::function_type): In the constructor that takes a vector of parms, walk the vector and set the indexes of the parms. 2014-02-19 Dodji Seketeli Misc diff reporting output cleanup * src/abg-comparison.cc (function_decl_diff::report): Do not talk about changed function anymore. Rather, say that some indirect sub-types changed in the function. 2014-02-19 Dodji Seketeli Do not forget some member types/functions we built IR nodes for * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Associate the member type IR node to the offset of the die of the member type. (build_ir_node_from_die): For a DW_TAG_subprogram DIE that has a DW_AT_specification pointing to another subprogram DIE, associate the offset of this DIE to the IR node of that other DIE. 2014-02-19 Dodji Seketeli Better support of static member variables * include/abg-fwd.h (fqn_to_components) (lookup_type_in_translation_unit, demangle_cplus_mangled_name): Declare new public entry points * src/abg-comparison.cc (corpus_diff::report): Report stuff about global variables using their mangled name, and demangle them. If there is no mangled name for the variable, then use its pretty representation. (compute_diff): For the corpus overload, compare global variables using their mangled name, if its available; otherwise, fall back to using their pretty representation. * src/abg-corpus.cc (var_comp::operator()(const var_decl*, const_var_decl*)): Compare variables using their mangled name in priority. If it's not available then use their pretty representation. * src/abg-dwarf-reader.cc (read_context::var_decls_to_re_add_to_tree): New accessor. (build_translation_unit_and_add_to_ir): If there is what appears to be a definition of a static member variable variable -- this is in case this definition lacks the DW_AT_specification attribute that links it to the DW_TAG_member or DW_TAG_variable DIE that is a child of the right class/structure DIE -- that is not at the right place in the DIE tree, remove it from the its current place in the tree and try to hang it off of the right DIE. To do this, de-mangle its mangled name, look at what is supposed to be the parent class name, look it up in the translation unit IR, and if found, stick the variable IR node in there, as a static member variable. If not found, then bad luck. (build_class_type_and_add_to_ir): Do not try to see if a member variable is static here as the way I was doing it was unreliable. Build the data member node directly w/o going through building a variable node first. Register the data member in the die offset -> IR node map. (build_ir_node_from_die): When seeing DW_TAG_variable, look for a DW_AT_specification attribute. If there is one, then it points to a the DIE of a data member and means that data member is static. Flag the IR node of that data member as static thus. Update the die offset -> IR node map. If there is no DW_AT_specification attribute or if it doesn't point to a data member DIE, schedule this variable tag for a stage when after the whole IR is built for the translation unit, the variable's mangled named is inspected, its hypothetical parent struct/class is looked up and the variable IR node is put into the node of the right struct/class IR node. * src/abg-ir.cc (enum lookup_entity_kind): New. (fqn_to_components, iterator, lookup_type_in_translation_unit) (lookup_node_in_translation_unit, lookup_type_in_translation_unit) (demangle_cplus_mangled_name): New function definitions. 2014-02-19 Dodji Seketeli Shorten an accessor name in the DWARF reader * src/abg-dwarf-reader.cc (read_context::cur_tu): Rename read_context::current_translation_unit into this. (read_context::current_scope, die_location) (build_translation_unit_and_add_to_ir, build_enum_type) (build_function_decl): Adjust wrt the change above. 2014-02-19 Dodji Seketeli Unset decl scope when removing the decl from its scope * src/abg-ir.cc (remove_decl_from_scope): Unset the scope of the decl. 2014-02-19 Dodji Seketeli Support adding data member from var_decl * src/abg-ir.cc (class_decl::insert_member_decl): Support taking a var_decl. (class_decl::add_data_member): Do not insert a data member twice. 2014-02-19 Dodji Seketeli Fix qualified type pretty printing * src/abg-ir.cc (qualified_type_def::qualified_type_def): Remove useless white space. 2014-02-19 Dodji Seketeli Add class_decl::member_base::set_is_static() accessor * include/abg-ir.h (class_decl::member_base::get_is_static): Rename is_static into get_is_static. (class_decl::member_base::set_is_static): New accessor. * src/abg-comparison.cc (represent): Adjust for class_decl::member_base::is_static -> get_is_static. * src/abg-corpus.cc (symtab_build_visitor_type::visit): Likewise. src/abg-hash.cc (class_decl::member_function::hash::operator()): Likewise. * src/abg-ir.cc (class_decl::member_base::operator==): Likewise. * src/abg-writer.cc (write_class_decl): Likewise. 2014-02-13 Dodji Seketeli Fixes needed to diff libstdc++ v4_4 against master * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Support several instances of the same member function being deleted. That can happen when the same member function was present in the initial class several times. Yeah, I've seen that in dwarf. * src/abg-corpus.cc (corpus::priv::build_symbol_table): Do not add the same variable (identified by its mangled name) twice in the variable symbol table. 2014-02-13 Dodji Seketeli Fix wrong deleted functions count when diffing corpora * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): If a function has changed, deleted it from the list the removed functions. 2014-02-13 Dodji Seketeli Several fixes needed to read libstdc++.so * src/abg-reader.cc (read_context::map_id_and_node): Allow duplicated class and basic type declarations. (build_type_decl): Allow duplicated type decls. (build_qualified_type_decl, build_pointer_type_def) (build_reference_type_def): As there can be several distinct duplicated types, compare them by value. (build_class_decl): There can be duplicated class decls. * src/abg-writer.cc (write_enum_type_decl): The name of the enum needs to be xml-escaped. 2014-02-12 Dodji Seketeli qualified, pointer and reference types can be member types * src/abg-reader.cc (build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def): Consider that these types can be member types. 2014-02-12 Dodji Seketeli Consider two typedefs with different names to be different * src/abg-ir.cc (typedef_decl::operator==): Consider two typedefs with different names to be different. 2014-02-12 Dodji Seketeli Really Avoid trying to build IR nodes for non-public functions * src/abg-dwarf-reader.cc (build_ir_node_from_die): For the DW_TAG_subprogram case, bail out early if the current function is non-public. 2014-02-12 Dodji Seketeli Add --{changed,deleted,added}-{fns,vars} options to bidiff * include/abg-comparison.h (diff_context::{show_{deleted,changed_added}_{fns,vars}}): Declare new accessors. (corpus_diff::context): Declare new getter. * src/abg-comparison.cc (diff_context::{show_{deleted,changed_added}_{fns,vars}}): Define these new accessors. (corpus_diff::priv::emit_corpus_diff_stats): Define new function. (corpus_diff::context()): Define new getter. (corpus_diff::report): Use the new corpus_diff::priv::emit_corpus_diff_stats to emit diff stats at the beginning of the report. Conditionalise emitting the different parts of the reports (changed,deleted,added stuff) on the values of the new properties that were just added. * tools/bidiff.cc (options::{show_{deleted,changed,added}_{fns,vars}): New properties. (display_usage, parse_command_line): Update for the newly added --{changed,deleted,added}-{fns,vars} command line options. (set_diff_context_from_opts): Define new static function. (main): Create a diff context, initialize it from the options (using set_diff_context_from_opts) and pass it to compute_diff. 2014-02-11 Dodji Seketeli Add --show-symtabs to bidiff * tools/bidiff.cc (display_usage): Update usage string. (parse_command_line): Recognize the --show-symtab cmdline option. (display_symtabs): New static function. (main): Call the new display_symtabs. 2014-02-11 Dodji Seketeli Harden class_decl node traversal code * src/abg-ir.cc (class_decl::traverse): Add a few asserts here and there. 2014-02-11 Dodji Seketeli Fix the pretty representation for member functions * src/abg-ir.cc (function_decl::get_pretty_representation): Fix this to properly display the representation of member functions. * tests/data/test-bidiff/test-enum0-report.txt: Update this. * tests/data/test-bidiff/test-enum1-report.txt: Likewise. * tests/data/test-bidiff/test-qual-type0-report.txt: Likewise. * tests/data/test-bidiff/test-struct0-report.txt: Likewise. * tests/data/test-bidiff/test-struct1-report.txt: Likewise. 2014-02-11 Dodji Seketeli Do not forget to traverse member types * include/abg-ir.h (class_decl::member_type::traverse): Declare new virtual function. (ir_node_visitor::visit): Declare new virtual function * src/abg-ir.cc (class_decl::member_type::traverse): Implement the traversal of a member type. (ir_node_visitor::visit): Provide a default implementation for the visitor of member type. 2014-02-11 Dodji Seketeli From DWARD, avoid adding IR nodes for member functions twice * include/abg-fwd.h (as_non_member_class_decl): Declare new overload. * src/abg-ir.cc (as_non_member_class_decl): Define new overload. * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Add member functions to the DIE -> IR Node map. (build_ir_node_from_die): Assert that DW_TAG_subprogram cannot be for a member function here because getting the scope of the member function would have constructed the entire class that contains it, including the member function. Then, calling build_ir_node_from_die for the DIE of the member function would find the already IR Node in the DIE -> IR Node map. 2014-02-11 Dodji Seketeli Fix access specifiers value * include/abg-ir.h (class_decl::enum access_specifier): Give the enumerators the same values as what the DWARF spec says. 2014-02-10 Dodji Seketeli Misc diff report cleanups * include/abg-ir.h (function_decl::parameter::get_type_name): Add comment. (function_decl::parameter::get_type_pretty_representation): New member fn. * src/abg-comparison.cc (represent): When representing changed members, use their pretty representation. (function_decl_diff::{ensure_lookup_tables_populated, report}): Use the pretty representation of parameters type. (typedef_diff::report): Enclose the underlying type in "'". (corpus_diff::report): Add proper spacing. 2014-02-10 Dodji Seketeli Re-organize the output of diffing two corpora * src/abg-comparison.cc (corpus_diff::report): Emit information about the number of added/removed/changed functions. If the report is big, prefix any added function with '[A]' deleted function with '[B]'. Also, fix indentation. 2014-02-10 Dodji Seketeli Support diffing entities of different kinds. * include/abg-comparison.h (class distinct_diff): Declare new type. (compute_diff_for_distinct_kinds): Declare new function. * src/abg-comparison.cc (distinct_diff::{distinct_diff, first, second, entities_are_of_distinct_kinds, length, report}): Define new member functions. (compute_diff_for_distinct_kinds, try_to_diff_distinct_kinds): Define new function. (compute_diff_for_types, compute_diff_for_decls): Support diffing entities of different kinds. 2014-02-10 Dodji Seketeli Avoid recursive comparison on class_decl & perform some optimizations * src/abg-ir.cc (class_decl::operator==(const decl_base& other) const): Bail out early in case of recursive comparison, or if type hashes are different. Do not try to compute qualified name unless it's really necessary. The optimizations part of this change were hinted by profiling. 2014-02-10 Dodji Seketeli Handle the DIE for a fn that has a 'specification' attribute * src/abg-dwarf-reader.cc (build_ir_node_from_die): For the DW_TAG_subprogram case, if the function has a DW_AT_specification attribute, build the IR node for the specification DIE instead. 2014-02-10 Dodji Seketeli Add an assert in the dwarf reader * src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): Assert that the result of build_function_decl on a member function is a method_decl. 2014-02-10 Dodji Seketeli Do not forget that build_ir_node_from_die can return member types * src/abg-dwarf-reader.cc (get_scope_for_die): Handle member class types. (build_function_decl): Likewise. 2014-02-10 Dodji Seketeli A member function can have an empty mangled name * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): If a member function has an empty mangling name, use its pretty representation. 2014-02-10 Dodji Seketeli Remove too eager asserts * src/abg-comparison.cc (class_diff::ensure_lookup_tables_populated): Do not assert that the same member type cannot be deleted/inserted twice. It actually can for, pointers, references, typedefs, etc. 2014-02-10 Dodji Seketeli Fix some new line handling in diff reports * src/abg-comparison.cc (represent): Remove extra new line after reporting virtual function number. (class_diff::report): Do not forget to emit a new line between two inserted functions. 2014-02-10 Dodji Seketeli Perform the diff of changed functions and variables in the right order * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): In a changed function or variable, do not mix up the new and old value. 2014-02-10 Dodji Seketeli Fix typo in report * src/abg-comparison.cc (reference_diff::report): Fix typo refereneced -> referenced. 2014-02-10 Dodji Seketeli Fix various crashes * src/abg-comparison.cc (decls_equal::operator()(const decls_type, const decls_type) const): Do not crash when of the decl_types is NULL. ({pointer_diff, reference_diff, enum_diff}::length): Avoid crashing if the underlying type is NULL. * abg-ir.cc (function_decl::get_pretty_representation): Avoid crashing on member functions with empty parameter set. signed-off-by: Dodji Seketeli 2014-02-10 Dodji Seketeli More optimizations hinted by profiling * include/abg-ir.h (decl_base::qualified_name_): New member. (decl_base::get_qualified_name): Cache the qualified name. (decl_base::get_type): Return a reference on the shared pointer. (method_type::get_class_type): Likewise. (class_decl::get_definition_of_declaration): Likewise. (class_decl::member_type::get_underlying_type): Likewise. (class_decl::base_spec::get_base_class): Likewise. * src/abg-ir.cc (decl_base::get_qualified_name): Implement the caching. (class_decl::member_type::get_qualified_name): Return a reference on the shared pointer. 2014-02-10 Dodji Seketeli Avoid crashing when getting function parm type name * include/abg-ir.h (function_decl::parameter::get_type_name): New member function. * src/abg-comparison.cc (function_decl_diff::ensure_lookup_tables_populated): Use the new member function above. 2014-02-10 Dodji Seketeli Small optimization hinted by profiling * include/abg-diff-utils.h (d_path_vec::max_d): Avoid using member functions. This is relevant only when compiling w/o optimization. 2014-02-10 Dodji Seketeli Fix allocation of diff_utils::d_path_vec * include/abg-diff-utils.h (d_path_vec::d_path_vec): Do not forget to allocate enough data for reverse vectors as well. The comment of the constructor is accurate. 2014-02-07 Dodji Seketeli Misc style fixes * include/abg-hash.h (combine_hashes): Remove trailing white spaces. * include/abg-ir.h (class function_decl): Add end-of-class comment. (struct type_base::cached_hash): Fix comment. * src/abg-comparison.cc: Remove useless new line. * src/abg-corpus.cc: Likewise. * src/abg-writer.cc: Likewise. 2014-02-07 Dodji Seketeli Support looking through decl-only classes and update diff reports accordingly * include/abg-comparison.h (class diff_context): New class. (class diff::{ctxt_, reported_once_, currently_reporting_}): New data members. (diff::diff): Initialize the new data members above. (diff::{context, currently_reporting, reported_once}): New accessors. (compute_diff, var_diff::var_diff, pointer_diff::pointer_diff) (reference_diff::reference_diff, qualified_type_diff) (enum_diff:enum_diff, class_diff::class_diff) (scope_diff::scope_diff, function_decl_diff::function_decl_diff) (type_decl_diff::type_decl_diff, typedef_diff::typedef_diff) (translation_unit_diff::translation_unit_diff, corpus_diff::corpus_diff): Take an additional pointer to diff_context. * abg-comparison.cc (diff_context::{has_diff_for, has_diff_for_types, add_diff}): New methods. (try_to_diff, compute_diff_for_types, compute_diff_for_decls) (represent): Take an additional pointer to diff_context in argument. In the later function, do not re-report a diff if it has already been reported, or if it's being reported already. (var_diff::var_diff, pointer_diff::pointer_diff) (reference_diff::reference_diff) (qualified_type_diff::qualified_type_diff, enum_diff::enum_diff) (class_diff::class_diff, scope_diff::scope_diff) (function_decl_diff::function_decl_diff, type_decl::type_decl) (typedef_diff::typedef_diff) (translation_unit_diff::translation_unit_diff) (corpus_diff::corpus_diff): Take an additional pointer to diff_context in argument. ({pointer_diff, qualified_type_diff, reference_type_diff}::report): do not re-report a diff about the underlying type if it has already been reported, or if it's being reported already. (enum_diff::report): Fix this to properly use the populated lookup tables. (compute_diff): take an additional pointer to diff_context in argument. For the var_decl, pointer_diff reference_type_diff, qualified_type_diff enum_diff, scope_diff, function_decl_diff, type_decl_diff and typedef_diff overloads, do not re-build a diff object, if one exits already. Otherwise, record the new diff object created so that it can be re-used later. (enum_diff::ensure_lookup_tables_populated): Fix logic to avoid one loop. (class_decl::priv::{deleted_member_functions_, inserted_member_functions_, changed_member_function_}): New members to support reporting about member functions changes. (class_decl::{lookup_tables_empty, clear_lookup_tables, length): Update for the new additions above. (class_decl::ensure_lookup_tables_populated): Likewise. Fix to properly use the lookup tables and also avoid a going through several loops to compute the changed members. (class_decl::report): Flip a switch to make the beginning and end of the reporting, in the context. Also, do not try to report again, if we were already reporting this diff. Fix quite some spots to properly use the lookup tables. (scope_diff::ensure_lookup_tables_populated): Skip decl-only classes during comparison. Fix some thinkos. Fix logic to avoid a loop. (scope_diff::report): Adjust to pass a context to compute_diff_for_types. (function_decl_diff::ensure_lookup_tables_populated): Fix logic to avoid a loop. (function_decl_diff::report): Adjust call to compute_diff_for_types to pass the context. (typedef::report): Avoid re-reporting the diff of the underlying types, if we are already reporting it. (corpus_diff::priv::ensure_lookup_tables_populated): Use the pretty representation of the function rather than its name to key the maps of deleted and added functions. Fix logic to avoid going through an additional loop for the changed functions. (corpus_diff::report): Add a title for removed/added/changed functions. Fix indentation for added/removed/changed functions. * include/abg-ir.h (class_decl::comparison_started_): New member * src/abg-dwarf-reader.cc (is_public_decl): Style fix. (is_declaration_only_): New static function. (build_class_type_and_add_to_ir): Create decl-only classes (IR) for classes flagged as declaration-only in the DWARF. * src/abg-hash.cc (class_decl::hash::operator()): Do not forget to include the "is_declaration_only" flag into the hashing. * src/abg-ir.cc (class_decl::operator==): Look through decl-only classes to get their definitions and compare the definitions instead. Avoid comparing member types and fns if the comparison of this type has already started. * src/abg-reader.cc (build_class_decl): Set the definition of a declaration, when we see it. * tests/data/test-bidiff/test-qual-type0-report.txt: Update. * tests/data/test-bidiff/test-struct0-report.txt: Likewise. * tests/data/test-bidiff/test-struct1-report.txt: Likewise. signed-off-by: Dodji Seketeli 2014-02-07 Dodji Seketeli Support reading *.bi input with duplicated qualified type ids. * src/abg-reader.cc (read_context::map_id_and_node): Support qualified types with duplicated ids. 2014-02-07 Dodji Seketeli Fix comparison of member types * src/abg-ir.cc (class_decl::member_type::operator==): Compare the underlying type of the member type. 2014-02-07 Dodji Seketeli Avoid duplicated entries in the symbol tables of the corpus * include/abg-ir.h ({var_decl, function_decl}::ptr_equal): New equality functor for pointers to var_decl and function_decl. ({function_decl, var_decl}::hash): Make these hashing functors public. * include/abg-hash.cc (struct var_decl::hash, struct function_decl::hash): Remove these from here. There are now in the public abg-ir.h. ({var_decl, function_decl}::hash::operator()): Define these here. * src/abg-corpus.cc (symtab_build_visitor_type::{fns_map, fn_is_in_map, add_fn_to_map, vars_map, var_is_in_map, add_var_to_map}): New accessors. (corpus::priv::build_symbol_table): Avoid duplicated entries in variables and functions symbols tables. 2014-02-07 Dodji Seketeli Ease debugging of abigail::diff_utils::compute_diff * include/abg-diff-utils.h (compute_diff): Add asserts on for the length of the shortest edit script during the divide and conquer part of the diff algorithm. 2014-02-07 Dodji Seketeli Fix further reaching reverse path calculation in core diff algo * include/abg-diff-utils.h (end_of_frr_d_path_in_k_plus_delta): Favour moving left when the two abscissas at the previous steps are equal. (compute_diff): Update the length of the shortest edit script when the size of one of the inputs is zero. * tests/test-core-diff.cc (in_out_spec): Add a new input to diff two sequences for regression testing. * tests/data/test-core-diff/report13.txt: New reference for the comparison of the new regression test above. 2014-02-07 Dodji Seketeli Add debugging facilities for core diffing issues * include/abg-ir.h (fns_to_str): Declare new fn. * src/abg-ir.cc (get_next_string, fn_to_str, fns_to_str): New static functions. (fns_to_str): Define new fn. * tools/abg-tools-utils.cc (dump_functions_as_string) (dump_function_names, compare_functions): New functions. 2014-01-20 Dodji Seketeli Fix apidoc comment * src/abg-ir.cc (decl_base::operator==): Fix comment. 2014-01-20 Dodji Seketeli Fix bilint outputting for translation units & corpus * tools/bilint.cc (main): Fix logic. 2014-01-20 Dodji Seketeli Remove debugging assertion when diffing * include/abg-diff-utils.h (d_path_vec::at): Do not check for bounds. 2014-01-20 Dodji Seketeli Do not use exceptions in dynamic_cast * src/abg-ir.cc (class_decl::member_function::operator==) (class_decl::member_function::operator==): Do not use the exception path for dynamic casting. This was near the top of many profiles. 2014-01-20 Dodji Seketeli Just add decls sequentially when reading from DWARF * src/abg-dwarf-reader.cc (insert_decl_into_ir_under_scope) (build_namespace_decl_and_add_to_ir, build_enum_type) (build_class_type_and_add_to_ir, build_ir_node_from_die) (build_ir_node_from_die): Remove. * tests/data/test-read-dwarf/test0.abi: Update because now type IDs can be used before they are defined. * tests/data/test-read-dwarf/test1.abi: Likewise. 2014-01-17 Dodji Seketeli Misc Doxygen API doc fixes * include/abg-comparison.h: Various doxygen api doc string fixes. * include/abg-diff-utils.h: Likewise. * include/abg-dwarf-reader.h: Likewise. * include/abg-ir.h: Likewise. * include/abg-reader.h: Likewise. * include/abg-writer.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-writer.cc: Likewise. 2014-01-17 Dodji Seketeli Fix bilint --noout, add --diff option * tools/bilint.cc (options::options): Initialize ... (options::{diff, bidiff}): ... new members. (display_usage): Update the display usage string for --diff & --bidiff options. (parse_command_line): Support the --diff and --bidiff options. (main): Require the --diff option to actually diff the emitted output with input. Make --noout really work for when reading from dwarf. 2014-01-17 Dodji Seketeli Read .abi files with types used before being defined & lots of fixes * src/abg-reader.cc (read_context::m_decls_stack): Make this is a std::deque, rather than a std::stack. (read_context::{get_id_xml_node_map, clear_id_xml_node_map, get_xml_node_decl_map, map_xml_node_to_decl, get_decl_for_xml_node, clear_xml_node_decl_map, map_id_and_node, get_xml_node_from_id, get_scope_for_node, build_or_get_type_decl}): New member functions. (read_context::{get_cur_decl, push_decl, pop_decl}): Update this now that the decl stack uses a std::deque. (read_context::clear_decls_stack): New. (read_context::get_translation_unit): Use the first decl of the decl stack, that is most certainly the global scope of the current translation unit, to get the translation unit. (read_context::key_type_decl): Take a new flag to force the re-keying; that is set an id to a new type, even if the id was already set to a type. (read_context::push_and_key_type_decl): Assert that a type must have a declaration. (handle_*): Make these return the decl_base_sptr resulting from the parsing of the xml node, rather than just a bool. (walk_xml_node_to_map_type_ids): New static function. (read_translation_unit_from_input): Read the abi-instr xml sub-tree once, just to build an id->xml node map. That way, when a declaration needs a type what is not yet defined, it can just get its XML node, build the type from it and use it. Do not forget to advance the xml reader cursor when the reading of the 'abi-instr' sub-tree is read. Clear all the new maps we have used for the current translation unit. (handle_element_node): Cleanup logic. (build_namespace_decl): Update the new xml node -> decl map, and use it to avoid building the same namespace twice. (build_function_parameter): Do not even try to get the type of a variadic parameter. (build_function_decl, build_var_decl): Support types that are defined later. (build_type_decl): Do not build the same type twice. But there can be several 'unnamed-enum-underlying-type' node. In that case just return the previous one. (build_qualified_type_decl, build_pointer_type_def) (build_reference_type_def, build_enum_type_decl) (build_typedef_decl): Support underlying type defined later. (build_class_decl): Support declaration-only related cases where we can have several xml nodes with the same id. Update the new xml node -> IR node maps. Fix member type adding. (build_type_tparameter, build_non_type_tparameter) (build_template_tparameter): Support used types defined later. 2014-01-17 Dodji Seketeli Fix member class template creation * src/abg-ir.cc (class_decl::add_member_class_template): Do not forget the scope of the member class template itself. 2014-01-17 Dodji Seketeli Avoid endless loop in unescape_xml_string * src/abg-libxml-utils.cc (unescape_xml_string): Avoid and endless loop for strings containing an '&' but that are not pre-defined entities. 2014-01-17 Dodji Seketeli Fix a potential crash * src/abg-ir.cc (decl_base::get_qualified_name): Do not crash if the scope is empty. 2014-01-17 Dodji Seketeli Do not loose the member type information when reading them from DWARF * include/abg-ir.h (class_decl::declaration_): Make this be a decl_base_sptr so that it can actually be a class_decl::member_type which underlying type is a class decl. (class_decl::{set, get}_earlier_declaration): Take or return a decl_base_sptr rather than a class_decl_sptr. * src/abg-ir.cc (class_decl::set_earlier_declaration): Take a decl_base_sptr rather than a class_decl_sptr. * src/abg-dwarf-reader.cc (die_class_map_type): Make this map take decl_base_sptr rather than a class_decl_sptr. (build_class_type_and_add_to_ir): If the class being currently built is a member class, do not loose that information after it has been added to its scope. Also, base types and types of member variables can be member types and should retain that information. (build_qualified_type): Likewise, the underlying type of a qualified type shouldn't loose the information about its potentially being a member type. (build_pointer_type_def, build_reference_type, build_typedef_type) (build_var_decl, build_function_decl): Likewise. 2014-01-17 Dodji Seketeli Fix hashing of member types * include/abg-ir.h (class_decl::{member_function_template, member_class_template}): Make these inherit from decl_base, to comply with class_decl::member_type. (class_decl_base_spec::{base_spec, member_type, member_function, member_function_template, member_class_template}::hash): Declare these hashing functors in the header here. (class_decl::{member_base, member_type, data_member, member_function, member_function_template, member_class_template}::hash::operator()): define these out of line here. (type_base::dynamic_hash::operator()): Update this to hash member things. * src/abg-writer.cc (write_qualified_type_def) (write_pointer_type_def, write_class_decl) (write_reference_type_def, write_enum_type_decl): Add an overload that takes the type ID to use in the serialization. (write_member_type): New implementation. 2014-01-17 Dodji Seketeli A Member class can also be a scope for other decls in DWARF * include/abg-fwd.h (as_non_member_class_decl): Declare ... * src/abg-ir.cc (as_non_member_class_decl): ... this new function. * include/abg-ir.h (class class_decl::member_type): Add more comments about member types. * src/abg-dwarf-reader.cc (get_scope_for_die): Use the new as_non_member_class_decl here. 2014-01-17 Dodji Seketeli Misc style fixes * include/abg-ir.h (location_manager::_Impl): Rename this type into priv. * src/abg-ir.cc b/src/abg-ir.cc (location_manager::_Impl): Likewise. (location_manager::location_manager): Update for the renaming above. * src/abg-reader.cc (build_type_decl): Remove useless white space. (build_enum_type_decl, build_class_decl): Use the _sptr typedef in the return type. 2014-01-14 Dodji Seketeli Update namespace comments * src/abg-dwarf-reader.cc (namespace dwarf_reader): Add apidoc comment. * src/abg-reader.cc (namespace xml_reader): Update apidoc comment. 2014-01-14 Dodji Seketeli Expand 'abi-instr' XML element nodes during de-serialization * src/abg-reader.cc (update_read_context) (update_depth_info_of_read_context): Remove. (read_context::{pop_scope, pop_scope_or_abort): New. (read_context::{push_decl_to_current_scope, push_and_key_type_decl}): Remove the overloads that take the 'update_depth_info' boolean. (build_namespace_decl): New static function. (build_function_decl, build_var_decl, build_type_decl) (build_qualified_type_decl, build_pointer_type_def) (build_reference_type_def, build_enum_type_decl, build_type_decl) (build_class_decl, build_function_tdecl, build_class_tdecl) (build_type_tparameter, build_type_composition) (build_non_type_tparameter, build_template_tparameter) (build_template_parameter, build_type): Remove the 'update_depth_info' boolean from parameters. (handle_element_node): Renamed handle_element into this. Take an xml node and a boolean to add the resulting IR node to the IR. (handle_type_decl, handle_namespace_decl) (handle_qualified_type_decl, handle_pointer_type_def) (handle_reference_type_def, handle_enum_type_decl) (handle_typedef_decl, handle_var_decl, handle_function_decl) (handle_class_decl, handle_function_tdecl, handle_class_tdecl): Take an xml node and a boolean to add the resulting IR node to the IR. (advance_cursor): No more need to call update_read_context. (read_translation_unit_from_input): Expand the 'abi-instr' node into memory so that we walk its XML nodes and build the IR nodes from them. (read_location): Remove the overload that was using the xml reader. (): 2014-01-14 Dodji Seketeli Misc style fixes * src/abg-reader.cc (read_context::{get_cur_decl, pop_decl}): Return decl_base_sptr rather than shared_ptr. (read_context::push_decl): Take a decl_base_sptr rather than shared_ptr. 2014-01-14 Dodji Seketeli Fix apidoc markup * include/abg-comparison.h (class var_diff): @ref var_decls -> @ref var_decl. * src/abg-comparison.cc (function_decl_diff::first_function_decl): @Return -> @return. 2014-01-14 Jonathan Wakely Fix checkout & build instructions * CONTRIBUTING: Fix Git repository url. * doc/website/mainpage.txt: Add elfutils into the dependencies list and fix the repository directory name. Also use autoreconf -i. * include/abg-fwd.h: Fix Git repository URL. 2014-01-13 Dodji Seketeli Tweak dwarf reading test to detect more namespace linking-fu * tests/data/test-read-dwarf/test0.cc: Define a member function out-of-line, outside of its namespace. * tests/data/test-read-dwarf/test0.abi: Update the .abi file. * tests/data/test-read-dwarf/test0: Update the resulting binary. 2014-01-13 Dodji Seketeli Add asserts to detect type id mis-management in native format * read_translation_unit_from_input (read_translation_unit_from_input): Abort when an element could not be handled. (build_function_parameter, build_type_decl, qualified_type_def) (build_pointer_type_def, build_reference_type_def) (build_enum_type_decl, build_typedef_decl, build_class_decl) (build_type_tparameter, build_template_tparameter) (handle_qualified_type_decl, handle_pointer_type_def) (handle_reference_type_def, handle_typedef_decl): Abort when a referred-to type is not found or if a type is defined twice. 2014-01-13 Dodji Seketeli Misc style fixes * src/abg-hash.cc (class_decl::member_function_template::hash::operator()): Remove useless vertical space. * src/abg-ir.cc (class_decl::class_decl): Properly indent. * src/abg-writer.cc (fn_tmpl_shared_ptr_map) (class_tmpl_shared_ptr_map): Properly indent these typedefs. 2014-01-13 Dodji Seketeli Optimize comparison & underlying type accessing * include/abg-ir.h (qualified_type::get_underlying_type) (pointer_type_def::get_pointed_to_type) (reference_type_def::get_pointed_to_type) (typedef_decl::get_underlying_type): Avoid triggering refcount counter increasing/decreasing here, by returning a reference to the underlying type. This showed up high on a profile. ({scope_decl, type_decl, scope_type_decl, namespace_decl, qualified_type_def, pointer_type_def, reference_type_def, enum_type_decl, typedef_decl, var_decl, class_decl}::operator==): Avoid taking the exception-using path of dynamic_cast. This showed up very high on a profile. 2014-01-13 Dodji Seketeli Fix reading/writing native xml corpus files * src/abg-reader.cc (read_context::clear_type_map): New member function. (read_translation_unit_from_input): Read up to the next element node if we are not on an element node already. Clear the type map. Realize that we might be on the next 'abi-instr' node upon completion. (read_corpus_from_input): Read up to the next element node if we are not on an element node already. It must be an "abi-corpus" node. THen Advance to the next 'abi-instr' element node before handing it to read_translation_unit_from_input. * src/abg-writer.cc (write_context::clear_type_id_map): New member function. (write_translation_unit): Call it. * tools/abg-tools-utils.cc (guess_file_type): Read enough bytes to detect abi-corpus files magic bytes. * tools/bilint.cc (main): Do not write the corpus file to the output stream if --noout has been provided. 2014-01-13 Dodji Seketeli Escape xml pre-defined entities in native (de-)serialization. * include/abg-libxml-utils.h (escape_xml_string) (unescape_xml_string): Declare new functions. * src/abg-libxml-utils.cc (escape_xml_string) (unescape_xml_string): Define them. * src/abg-reader.cc (build_function_decl, build_var_decl) (build_type_decl, build_enum_type_decl, build_class_decl) (build_type_tparameter, build_non_type_tparameter) (build_template_tparameter, handle_namespace_decl) (handle_typedef_decl): Use unescape_xml_string. * src/abg-writer.cc (write_type_decl, write_function_decl) (write_class_decl, write_type_tparameter) (write_non_type_tparameter, write_template_tparameter): Use escape_xml_string. 2014-01-13 Dodji Seketeli Implement hash caching * include/abg-ir.h (decl_base::hash_): New member. (decl_base::{g,s}et_hash): New accessors. (type_base_::cached_hash): Forward-declare new hasher. (struct type_ptr_equal): New equality predicate. (type_shared_ptr_equal::operator()): Do not forget to test pointer equality. (type_base::cached_hash): Declare new hasher. * src/abg-hash.cc ({decl_base, type_decl, scope_type_decl, qualified_type_def, pointer_type_def, reference_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, function_decl::parameter, class_decl::data_member, class_decl::member_function, class_decl, }::hash::operator()): Implement caching. (type_base::cached_hash::operator()(const type_base*)): Define. (type_base::cached_hash::operator() (const type_base_sptr): Define. * src/abg-ir.cc (type_ptr_map): Make this map use type_base::cached_hash instead of type_base::ptr_hash now. (decl_base::decl_base): Initialize the new decl_base::hash_. member. (decl_base::{s,g}et_hash): Define. (decl_base::operator==(const decl_base& other)): Take the hash in account to speed up inequality detection. * src/abg-writer.cc (type_ptr_map): Renamed type_shared_ptr_map into this. Make it use type_base::cached_hash and type_ptr_equal instead of type_base::shared_ptr_hash and type_shared_ptr_equal. (get_id_for_type): Add overload for type_base*. Re-write the previous overload in terms of this one. (write_context::m_type_id_map): Use type_ptr_map as the type for this. 2014-01-13 Dodji Seketeli Do not canonicalize types anymore; it's slow and luckily not needed * src/abg-ir.h (translation_unit::canonicalize_type): Remove. * src/abg-dwarf-reader.cc (canonicalize_and_add_type_to_ir) (canonicalize_and_insert_type_into_ir) (canonicalize_and_insert_type_into_ir_under_scope): Remove. (build_enum_type, build_class_type, build_ir_node_from_die): Update for removal of type canonicalization. * src/abg-ir.cc (translation_unit::canonicalize_type): Remove. 2014-01-13 Dodji Seketeli Fix class scope setting & member type de-serializing from dwarf * include/abg-fwd.h (add_decl_to_scope, insert_decl_into_scope): return the decl added to the scope. (as_non_member_type, get_type_declaration): Declare new entry points. * include/abg-ir.h (class decl_base::insert_decl_into_scope): Update this friend declaration. (class scope_decl, class_decl): Update the friend add_decl_to_scope declaration. (scope_decl::add_member_decl): Return the added decl. (class_decl_sptr): Move this typedef befoer the class_decl class declaration. (class_decl::definition_of_declaration_): New member. (class_decl::{set_definition_of_declaration, get_definition_of_declaration}): New accessors. (class_decl::add_member_decl): Return the added member. (class_decl::insert_member_type): New member. (class_decl::member_base::access_specifier): Make this protected. (class_decl::member_type): Make this inherit from type_vase. (class_decl::member_type::type_): Remove this member. (class_decl::member_type::as_type): Remove this accessor. (class_decl::member_type::operator==(const type_base&)): New. (class_decl::member_type::operator shared_ptr() const): Remove. (class_decl::member_type::get_underlying_type): New. (class_decl::member_type::operator==(const member_type&) const): New. * src/abg-comparison.cc (class_diff::{ensure_lookup_tables_populated, report}): Adjust for the removal of class_decl::member_type::as_type. * src/abg-dwarf-reader.cc (scope_stack_type): Change this as a typedef to stack. (current_scope): Change return type from scope_decl_sptr to scope_decl*. (insert_decl_into_scope): New. (build_namespace_decl_and_add_to_ir): Use insert_decl_into_scope in lieu of add_decl_to_scope. (build_class_type_and_add_to_ir): likewise. Link a class definition to its declaration. Push the current scope on the scope stack. Use as_non_member_type. Fix setting member types. (get_scope_for_die): Look through declaration-only classe to get its definition. (build_qualified_type, build_pointer_type_def) (build_reference_type, build_typedef_type, build_var_decl) (build_function_decl): Use as_non_member_type. (build_ir_node_from_die): Fix member variable & function adding. * src/abg-ir.cc (scope_decl::{add_member_decl, insert_member_decl}): Return the added member. (add_decl_to_scope): Likewise. (insert_decl_into_scope): Likewise. (get_top_most_scope_under): Fix logic. (get_type_declaration): New overload that return a decl_base*. (as_non_member_type): New definition. (class_decl::{get_definition_of_declaration, set_definition_of_declaration, insert_member_decl}): Likewise. (class_decl::add_member_decl): Re-write in terms of class::insert_member_decl. (class_decl::insert_member_type): New definition. (class_decl::add_member_type): Re-write in terms of class_decl::insert_member_type. (class_decl::remove_member_type): Update for the class_decl::member_type::as_type removal. (class_decl::{add_data_member, add_member_function, add_member_function_template, add_member_class_template}): Call scope_decl::add_member_decl. (class_decl::member_type::member_type): Update as the type now virtually inherits from type_base. (class_decl::member_type::{set,get}_access_specifier): New definitions. (class_decl::member_type::get_underlying_type): Likewise. (class_decl::member_type::set_scope): Update wrt class_decl::member_type::as_type -> get_underlying_type rename. (class_decl::member_type::operator==(const decl_base& other)): There is no more class_decl::member_type::as_type. (class_decl::member_type::operator==(const type_base& other)): New. (class_decl::member_type::get_pretty_representation): Update wrt class_decl::member_type::as_type -> get_underlying_type rename. * src/abg-reader.cc (build_class_decl): New that add add_member_decl adds even member types, no need to add it explicitly anymore. 2014-01-07 Dodji Seketeli Add regression tests for dwarf reading * tests/test-read-dwarf.cc: New dwarf reading regression test. * tests/data/test-read-dwarf/test0: New test input. * data/test-read-dwarf/test0: Likewise. * data/test-read-dwarf/test0.abi: Likewise. * data/test-read-dwarf/test0.cc: Likewise. * data/test-read-dwarf/test1: Likewise. * data/test-read-dwarf/test1.abi: Likewise. * data/test-read-dwarf/test1.cc: Likewise. * tests/Makefile.am: Build the new tests/test-read-dwarf.cc file. 2014-01-07 Dodji Seketeli Remove useless dependencies in tests/Makefile.am * tests/Makefile.am: Remove useless *_DEPENDENCIES variables. 2014-01-07 Dodji Seketeli Support new 'abi-corpus' native XML format (.abi) * include/abg-reader.h (read_corpus_from_native_xml) (read_corpus_from_native_xml_file): Declare new entry points. * include/abg-writer.h (write_corpus_to_native_xml) (write_corpus_to_native_xml_file): Likewise. * src/abg-reader.cc (read_translation_unit_from_input): Renamed read_input into this. Support new 'path' attribute for 'abi-instr' XML element. (read_corpus_from_input): New static function. (read_translation_unit_from_file) (read_translation_unit_from_buffer) (read_translation_unit_from_istream): Update wrt read_input -> read_translation_unit_from_input. (read_corpus_from_native_xml, read_corpus_from_native_xml) (read_corpus_from_native_xml_file): Define new entry points. * src/abg-writer.cc (write_translation_unit): Write 'path' attribute into the 'abi-instr' xml element. (write_corpus_to_native_xml, write_corpus_to_native_xml_file): Define new entry points. * tools/abg-tools-utils.h (file_type::{FILE_TYPE_XML_CORPUS, FILE_TYPE_ZIP_CORPUS}): New enumerators. * tools/abg-tools-utils.cc (guess_file_type): Support detection of the new xml file format containing a document root 'abi-corpus' root element. * tools/bidiff.cc (main): Support diffing xml corpus-es and zip corpus-es. * tools/bidw.cc (main): Recognize elf files before reading them. * tools/bilint.cc (main): Support reading xml/zip corpus-es too. * tests/data/test-read-write/test[0-23].xml: Update 'path' attribute. 2014-01-07 Dodji Seketeli Misc style fixes * include/abg-writer.h (write_translation_unit): Re-indent parms. * src/abg-writer.cc (write_translation_unit): Likewise. * test/test-read-write.cc (main): Fix white space. 2014-01-06 Dodji Seketeli Fix global variables diff reporting in corpus-es * src/abg-comparison.cc (corpus_diff::priv::ensure_lookup_tables_populated): Fix a wrong assert, resulting from a copy paste typo. 2014-01-06 Dodji Seketeli Add support for global variables in corpus diffing * include/abg-comparison.h (string_var_ptr_map, changed_var_ptr) (string_changed_var_ptr_map): New convenience typedefs. * src/abg-comparison.cc (corpus_diff::priv::{deleted_vars_,added_vars_,changed_vars_}): New members. (corpus_diff::priv::{lookup_tables_empty, clear_lookup_tables}): Update wrt the new variables related lookup tables. (corpus_diff::ensure_lookup_tables_populated): Update to populate variables related lookup tables. (corpus_diff::report): Update to display added/removed/changed variables. 2014-01-06 Dodji Seketeli Misc style fixlets * include/abg-comparison.h (changed_function_ptr): Fix comment. * src/abg-comparison.cc (corpus_diff::report): Likewise. * src/abg-corpus.cc (corpus::is_empty): Likewise. 2013-12-23 Dodji Seketeli Initial support for diffing ABI corpus files * include/abg-comparison.h (string_function_ptr_map) (changed_function_ptr, string_changed_function_ptr_map) (corpus_diff_sptr): New convenience typedefs. (translation_unit_diff): Add comments. (class corpus_diff): New type. (compute_diff): New overload for corpus_diff. * include/abg-corpus.h (corpus::{functions, variables}): New typedefs. (corpus::{operator==, get_functions, get_variables}): New members. * include/abg-diff-utils.h (struct deep_ptr_eq_functor): New functor. * include/abg-ir.h (translation_unit::operator==): New member equality operator. * src/abg-comparison.cc (struct corpus_diff::priv): New private struct holding the private members of corpus_diff. (corpus_diff::priv::{lookup_tables_empty, clear_lookup_tables, ensure_lookup_tables_populated}): Define new private member functions. (corpus_diff::{corpus_diff, first_corpus, second_corpus, function_changes, variable_changes, length, report}): New public members. (struct noop_deleter): New struct. (compute_diff): New implementation for corpus_diff. * src/abg-corpus.cc (struct corpus::priv): Renamed corpus::impl into this. Add new fns, vars and is_symbol_table_built data members. (corpus::priv::build_symbol_table): New member function. (class symtab_build_visitor_type): New visitor type to build the symbol table. (struct func_comp, struct var_comp): New comparison functors. (corpus::priv::build_symbol_table): Define new member function. (corpus::{corpus, add, get_translation_units, operator==, get_functions, get_variables}): Define new members. * src/abg-ir.cc (translation_unit::operator==): Define new member equality operator. (operator==(translation_unit_sptr l, translation_unit_sptr r)): Define new equality operator. * tools/abg-tools-utils.h (enum file_type): New enum. (guess_file_type): Declare new function. * tools/abg-tools-utils.cc (guess_file_type): define new function. * tools/bidiff.cc (main): Guess the type of the files given in input and support elf files reading and diffing. 2013-12-23 Dodji Seketeli Generalize use of equality operator in core diff algorithms * include/abg-diff-utils.h (struct default_eq_functor): New equality functor. (end_of_fr_d_path_in_k, end_of_frr_d_path_in_k_plus_delta): Add a new equality functor template parameter and document it. Use it to compare the elements of the sequences given in argument. (compute_middle_snake, ses_len, compute_diff): Add a new equality functor template parameter and document it. Adjust call to end_of_frr_d_path_in_k_plus_delta, end_of_fr_d_path_in_k and compute_middle_snake. (ses_len, compute_diff): Add a new overload that uses a default_eq_functor as comparison functor, to avoid breaking existing client code. * src/abg-diff-utils.cc (compute_middle_snake): Adjust the call to the compute_middle_snake. 2013-12-23 Dodji Seketeli Change ir node visitor interface work on pointer to nodes * include/abg-ir.h (ir_traversable_base): New type to be the base of IR nodes that are to be traversed. Extends traversable_base. Its ir_traversable_base::traversable() method takes an ir_node_visitor&. (ir_node_visitor::visit): Change these virtual overloads to take pointers to IR nodes, rather than references. This will be useful to e.g, store these IR nodes in containers on the side for some algorithms to work. That is going to be useful later to, e.g. build symbol tables on the side, using the visitor interface. (class decl_base): Make this inherit ir_traversable_base. * src/abg-ir.cc (*::traverse): Adjust comments and the call the ir_node_visitor::visit call. Use the ir_traversable_base type rather than traversable_base. (ir_traversable_base::traverse): Define. (ir_node_visitor::visit): Change these overloads to take pointers rather than reference to ir nodes. * tests/test-walker.cc (name_printing_visitor::visit): Adjust to take pointers rather than references. 2013-12-23 Dodji Seketeli Do not forget to read function parms * src/abg-dwarf-reader.cc (build_function_decl): Do not forget the the function parameters. Oops. 2013-12-20 Dodji Seketeli Support reading member functions and member types from DWARF * include/abg-ir.h (method_type_sptr): New convenience typedef. * src/abg-dwarf-reader.cc (read_context::{dwarf_version, die_wip_classes_map}): New accessors. (die_is_virtual): Rename is_virtual into this. (is_type_tag, is_type_die, die_virtual_function_index): Define new static functions. (die_member_offset): Fix comment. (get_scope_for_die): Take the read context as argument. (canonicalize_and_add_type_to_ir): Likewise. On NULL scope, get the current translation unit from the read context. (canonicalize_and_insert_type_into_ir_under_scope): Handle NULL context. (build_function_decl): Support creating method_decls from here when necessary. (build_class_type_and_add_to_ir): Rename build_class_type into this. Handle adding the class to the IR and to the relevant maps. During the creation of the class, arrange for build_ir_node_from_die on the current DIE to return a declaration-only class, representing the declaration for the class that is being constructed. This breaks circular dependencies induced by decls/types that refer to the class being built, before the class is fully built and has a (logical) type ID. Once the class is created, make it refer to the class declaration that was previously handed for the requests to the class DIE. Now requests to the class DIE will just yield the newly built class. Add support for member functions and member types. (build_corpus): Support reading the dwarf version and stick it into the context. (build_ir_node_from_die): Adjust for change in canonicalize_and_add_type_to_ir and build_class_type signature change. * src/abg-ir.cc (class_decl::method_decl::get_type): Support returning NULL type. 2013-12-20 Dodji Seketeli Don't crash in get_global_scope on empty decls * src/abg-ir.cc (get_global_scope): Don't crash when given a NULL decl. 2013-12-20 Dodji Seketeli Make decl_base::set_scope virtual, to work on class_decl::member_type * include/abg-ir.h (decl_base::set_scope): Make this virtual. (class_decl::member_type::set_scope): Declare an overload here. * src/abg-ir.cc (class_decl::member_type::set_scope): Define new overload. Make this set the scope of the underlying type of the member type as well. 2013-12-20 Dodji Seketeli Support artificial parameters * include/abg-ir.h (function_decl::parameter::{get, set}_artificial): Add new accessors for an "artificial" flag. * src/abg-reader.cc (build_function_parameter): Support reading the artificial parameter flag. * src/abg-writer.cc (write_function_decl): Support writing the artificial parameter flag. 2013-12-19 Dodji Seketeli Initial support for reading struct/class * src/abg-dwarf-reader.cc (enum virtuality): New enum. (class expr_result, struct dwarf_expr_eval_context): New types. (die_size_in_bits) (die_access_specifier, die_virtuality, is_virtual) (die_location_expr, op_pushes_constant_value) (op_pushes_non_constant_value, op_manipulates_stack) (op_is_arith_logic, op_is_control_flow) (eval_last_constant_dwarf_sub_expr, die_member_offset) (build_class_type): New static functions. (build_ir_node_from_die): Support creating IR node for class and struct by calling the new build_class_type. 2013-12-19 Dodji Seketeli Slight style fix * src/abg-dwarf-reader.cc (build_qualified_type): Fix indentation. 2013-12-19 Dodji Seketeli Be more forgiving when parsing xml from stdin * src/abg-libxml-utils.cc (xml_istream_input_read): Return the byte read count even when the stream seems to be borked. In that case it should be zero. 2013-12-19 Dodji Seketeli Don't crash if building pointer/reference yields NULL * src/abg-dwarf-reader.cc (build_ir_node_from_die): Do not crash if building the IR node for the underlying type yields NULL. 2013-12-19 Dodji Seketeli Use dwarf_attr_integrate() rather than dwarf_attr() * src/abg-dwarf-reader.cc (die_string_attribute) (die_unsigned_constant_attribute, die_signed_constant_attribute) (die_flag_attribute, die_die_attribute): Use dwarf_attr_integrate rather than dwarf_attr to look through DW_AT_abstract_origin. 2013-12-14 Dodji Seketeli Support enums * src/abg-dwarf-reader.cc (build_enum_type): New function. (build_ir_node_from_die): Call the new build_enum_type here to Handle DW_TAG_enumeration_type DIEs. 2013-12-14 Dodji Seketeli Build & use a DIE -> parent map to avoid emitting useless types * include/abg-ir.h (translation_unit::{mark_type_as_used, prune_unused_types}): Remove these declarations. * src/abg-ir.cc (translation_unit::priv::used_types_): Remove. (class subtype_marking_visitor): Likewise. (translation_unit::{mark_type_as_used, prune_unused_types): Likewise. (get_top_most_scope_under): Fix logic and add comment. * src/abg-dwarf-reader.cc (die_tu_map_type, offset_offset_map): New convenience typedefs. (read_context::{die_tu_map_, die_parent_map_}): New context members. (read_context::{die_tu_map, die_parent_map}): New accessors. (build_ir_node_from_die): New overload that takes the scope of the ir node in parameter. (die_signed_constant_attribute): Un-comment this. (build_die_parent_relations_under, build_die_parent_map) (get_parent_die, get_scope_for_die): New static functions. (build_translation_unit_and_add_to_ir): Renamed build_translation_unit into this. Populate the new read_context::die_tu_map() here. (canonicalize_and_add_type_to_ir) (canonicalize_and_insert_type_into_ir) (canonicalize_and_insert_type_into_ir_under_scope): Move these overloads over the top of the file. (build_namespace_decl_and_add_to_ir): Fix this by adding the namespace to the IR scope of the DIE (using the new get_scope_for_die()). Update the read_context::die_decl_map() map. (build_function_decl): Support functions that return void. Also, skip parameters that don't have type set. (build_corpus): Walk all the DIEs to build a DIE -> parent map. Adjust for the rename to build_translation_unit_and_add_to_ir. (build_ir_node_from_die): Add a scope parm. Adjust back to building IR nodes only for public decls, unless the 'called_from_public_decl' flag is set. Adjust to stick the resulting IR node into the scope given in parameter. 2013-12-14 Dodji Seketeli Mark sub-types as part of general type marking * src/abg-ir.cc (subtype_marking_visitor): New visitor. (translation_unit::mark_type_as_used): When marking a composite type as used, mark its sub-types as well. 2013-12-14 Dodji Seketeli Add missing virtual keywords for traverse() method * include/abg-ir.h ({translation_unit, decl_base, scope_decl, type_decl, namespace_decl, qualified_type_decl, pointer_type_def, reference_type_def, enum_type_decl, typedef_decl, var_decl, function_tdecl, class_decl, class_decl::data_member, class_decl::member_function, class_decl::member_function_template, class_decl::member_class_template}::traverse): Add a virtual keyword at least to "document" that this method is virtual -- and thus remind the user that it overrides the traversable_base::traverse(). 2013-12-14 Dodji Seketeli Add a is_type overload * include/abg-fwd.h (is_type): Declare new overload that takes a type reference. * src/abg-ir.cc (is_type): Define. 2013-12-13 Dodji Seketeli Prune types that are not ref'ed by public decls * include/abg-fwd.h (remove_decl_from_scope): Declare new function. * include/abg-ir.h (type_base_sptr, decl_base_sptr): Move these convenience typedef before the translation_unit declaration. (translation_unit::{mark_type_as_used, prune_unused_types}): Declare new methods. (decl_base::remove_member_decl): Likewise. (class_decl::{remove_member_decl, remove_member_type): Likewise. * src/abg-dwarf-reader.cc (die_decl_map_type): Change this map type so that the value is now a DIE offset, rather than a DIE. This is because many times the lifetime of DIEs is shorter than the one of the reader_context. Also, the die offset uniquely designates a physical DIE even if several different instances of logical DIE might point to it. (struct die_hash): Remove this as it's useless now that we store DIE offsets in the map. (build_translation_unit): Call build_ir_node_from_die w/o setting the called_from_public_decl flag. Prune the types that are not used by any public decls. (build_namespace_decl_and_add_to_ir): all build_ir_node_from_die w/o setting the called_from_public_decl flag. (build_ir_node_from_die): Change the only_public_decl flag into a called_from_public_decl flag. Mark types used by public decls as such. Adjust for the parm changes of build_qualified_type build_pointer_type_def, build_reference_type, and build_typedef_type. (build_qualified_type, build_pointer_type_def) (build_reference_type, build_typedef_type): Take a new called_from_public_decl. Pass it to build_ir_node_from_die. (build_var_decl): Call build_ir_node_from_die with the called_from_public_decl flag set to true to flag the types referenced by this variable as being used. (build_function_decl): Take a called_from_public_decl flag as well, as this function can now call build_function_decl itself to build a function decl out of the value of the DW_AT_specification attribute, for DIEs representing function definitions. Also, flag the types referenced by public functions are being used. * src/abg-ir.cc (translation_unit::priv::used_types_): New map for the used types. (translation_unit::{mark_type_as_used, prune_unused_types}): Define new methods. (scope_decl::remove_member_decl): Likewise. (remove_decl_from_scope): Define new function. (class_decl::{remove_member_decl, remove_member_type}): Define new methods. 2013-12-12 Dodji Seketeli Support reading namespaces * include/abg-fwd.h (get_global_scope): Return a const global_scope. Add a new overload that takes a naked pointer as parm. (insert_decl_into_scope, get_top_most_scope_under): Declare new entry points. * include/abg-ir.h (class decl_base, class scope_decl): Add insert_decl_into_scope as a friend of these classes. (scope_decl::{insert_decl_into_scope, find_iterator_for_member}): Declare new member. (scope_decl::get_member_decls): New non-const overload. * src/abg-dwarf-reader.cc (build_translation_unit): Remove the "recurse" parameter. Adjust the call to build_ir_node_from_die to read just public decls that are at namespace scope. Anything else should be dropped unless it's needed to emitting the public namespace-level decls. (build_namespace_decl_and_add_to_ir) (canonicalize_and_insert_type_into_ir): Define new static functions. (build_corpus): Adjust ad build_translation_unit doesn't have the "recurse" parameter anymore. (canonicalize_and_add_type_to_ir): Make this static. Fix comments. (build_ir_node_from_die): Take a new "only_public_decl" parameter. For DW_TAG_base_type case, use the new canonicalize_and_insert_type_into_ir to insert the type at the right place in the global scope making sure it is seen before the current scope. For pointer, references and qualified types, use canonicalize_and_insert_type_into_ir to add the type at the same scope as its underlying type. Handle DW_TAG_{namespace,module} using the new build_namespace_decl_and_add_to_ir function. Add some vertical spaces and some assertions. * src/abg-ir.cc (scope_decl::add_member_decl): Use scope_decl_sptr typedef. (scope_decl::{insert_member_decl,find_iterator_for_member}): Define new methods. (insert_decl_into_scope, get_top_most_scope_under): Define new functions. (get_global_scope): Constify the return type. (get_translation_unit): Adjust as get_global_scope now returns a const. * src/abg-reader.cc (get_translation_unit): Likewise. 2013-12-12 Dodji Seketeli Fix function_decl::parameter::operator== * include/abg-ir.h (function_decl::parameter::operator==): Support empty type, e.g, in presence of a variadic parameter. 2013-12-12 Dodji Seketeli Misc style fixes * include/abg-ir.h (decl_base::set_visibility): Remove useless white space. (class scope_decl): Remove useless white space. (scope_decl::add_member_decl): Use decl_base_sptr convenience typedef. (global_scope_sptr, namespace_decl_sptr): New convenience typedef. (class global_scope): Remove useless white space. 2013-12-11 Dodji Seketeli Misc style fixes * src/abg-dwarf-reader.cc (die_string_attribute, is_public_decl) (build_translation_unit, build_ir_node_from_die): Fix comments. (die_unsigned_constant_attribute, die_signed_constant_attribute) (die_loc_and_name): Align parms. 2013-12-11 Dodji Seketeli Support typedef types * src/abg-dwarf-reader.cc (build_typedef_type): Define new static function. (canonicalize_and_add_type_to_ir): Do not crash on NULL input type. Also, add a new overload for smart pointer on scope. (build_ir_node_from_die): For DW_TAG_base_type case, adjust as canonicalize_and_add_type_to_ir now takes smart pointers on scopes. Support the DW_TAG_typedef case by calling the new build_typedef_type. 2013-12-11 Dodji Seketeli Support reference types * src/abg-dwarf-reader.cc (build_pointer_type_def): Do not forget to get the proper size of the pointer type. (build_reference_type): Define new static function. (build_ir_node_from_die): Call build_reference_type for the DW_TAG_reference_type and DW_TAG_rvalue_reference_type cases. 2013-12-11 Dodji Seketeli Support pointer types * include/abg-fwd.h (get_translation_unit, get_global_scope): Declare new overloads that act on a naked pointer to decl_base. * src/abg-dwarf-reader.cc (build_pointer_type_def): Define new static function. (canonicalize_and_add_type_to_ir): Take a naked pointer to scope_decl rather than a smart pointer. (build_ir_node_from_die): For DW_TAG_base_type, adjust. Support DW_TAG_pointer_type case. For DW_TAG_{const,volatile}_type case, make sure the qualified type is in the same scope as its underlying type. * src/abg-ir.cc (get_global_scope, get_translation_unit): Define new overloads that acts on a naked decl_base. 2013-12-11 Dodji Seketeli Support qualified types * src/abg-dwarf-reader.cc (build_qualified_type) (canonicalize_and_add_type_to_ir): Define new static functions. (build_ir_node_from_die): In the DW_TAG_base_type case, use the new canonicalize_and_add_type_to_ir which is a factorization of this code. In the DW_TAG_{const,volatile}_type, use the new build_qualified_type and canonicalize_and_add_type_to_ir functions. 2013-12-11 Dodji Seketeli Support reading public functions from DWARF * src/abg-dwarf-reader.cc (read_context::dwarf_): New member. (read_context::load_debug_info): Move the content of load_debug_info_from_elf here. (read_context::dwarf): New accessor for the dwarf_ member above. (die_flag_attribute, die_loc_and_name, is_public_decl) (build_function_decl): New static functions. (die_location): Do not try to create a location object when the location has empty file or empty line number. (build_translation_unit): Take a new address_size parameter. (build_type_decl): Really take a context parameter. Use the new die_loc_and_name() here. (build_var_decl): Skip non-public vars. (build_corpus): Use dwarf_nextcu instead of dwfl_nextcu, so that we can get the address_size used in the current CU. Note that for this we are getting the Dwarf* pointer from the context thanks to the new read_context::dwarf() getter. Adjust the call to build_translation_unit to pass it the new address_size. (build_ir_node_from_die): Shorten lines a little bit. Call the new build_function_decl to support reading DW_TAG_subprogram DIEs. (read_corpus_from_elf): Adjust to create the read context earlier and use its read_context::load_debug_info method to load the debug info. 2013-12-11 Dodji Seketeli Make bilint read input from stdin * include/abg-libxml-utils.h (new_reader_from_istream): Declare new public entry point. * src/abg-libxml-utils.cc (xml_istream_input_read) (xml_istream_input_close): New static functions. (new_reader_from_istream): Define new public input function. * include/abg-reader.h (read_translation_unit_from_istream): Declare new entry points. * src/abg-reader.cc (read_translation_unit_from_istream): Define new entry points. * tools/bilint.cc (options::{read_from_stdin, noout}): New members. (display_usage): Document --stdin and --noout. (parse_command_line): Adjust to consider that no option on the command line means reading from stdin, just like --stdin. Support the --noout option as well. (main): Support Read the abi instr from stdin; in that case, what was read is just serialized back to stdout, unless --noout was supplied. 2013-12-11 Dodji Seketeli Support the "address-size" attribute for elements * include/abg-ir.h (translation_unit::translation_unit): Take an address_size parameter. (translation_unit::{get_address_size, set_address_size}): New accessors. * src/abg-ir.cc (translation_unit::priv::address_size_): New private member. (translation_unit::translation_unit): Take an address_size parameter. (translation_unit::{get_address_size, set_address_size}): Define these new methods. * src/abg-reader.cc (read_input): Read the "address-size" attribute from the abi-instr element. * src/abg-writer.cc (write_translation_unit): Write the "address-size" attribute. * tests/data/test-read-write/test23.xml: New test input. * tests/test-read-write.cc (in_out_specs): Add the new test above to the list of files to read and write back. 2013-12-11 Dodji Seketeli Support variadic arguments in function decls * src/abg-reader.cc (build_function_parameter): Support reading the "is-variadic" attribute. * src/abg-writer.cc (write_function_decl): Support writing the "is-variadic" attribute. * tests/data/test-read-write/test22.xml: New test input. * tests/test-read-write.cc (in_out_specs): Add the new test to the list of files to read and write back. 2013-12-07 Dodji Seketeli Initial support of reading an ABI Corpus from DWARF * configure.ac: Check the presence of libdw.so and elfutils/libdwfl.h headers from elfutils and define the necessary linking flags. * include/abg-dwarf-reader.h: New header file * include/Makefile.am: Add the new header file to the source distribution. * src/abg-dwarf-reader.cc:: New file. * src/Makefile.am: Add the new file to the source distribution. * include/abg-fwd.h (dump): Add declarations for several overloads to allow dumping to a given output stream. * include/abg-ir.h (class translation_unit): Use a pimpl idiom for this now. (translation_unit::canonicalize_type): Declare new method. * src/abg-ir.cc (struct translation_unit::priv): New private type for the pimpl idiom for translation_unit. (translation_unit::{translation_unit, get_global_scope, get_path, set_path, get_loc_mgr}): Adjust for pimpl idiom. (translation_unit::canonicalize_type): Define this new method and one overload. * src/abg-writer.cc (dump): Define several overloads to dump IR nodes to given output streams. * tools/bidw.cc: New file for the new bidw tool. * tools/Makefile.am: Define rules to build the new bidw tools. 2013-12-07 Dodji Seketeli Pass a string by reference rather than by value * tools/bilint.cc (display_usage): Pass program name by reference. 2013-12-07 Dodji Seketeli Misc style fixes * src/abg-ir.cc (location_manager::location_manager) (translation_unit::{is_empty, traverse, ~translation_unit): Remove useless vertical white spaces. * tools/bilint.cc (parse_command_line): Fix indentation. 2013-12-04 Dodji Seketeli Prepare serialization API for multiple backends * include/abg-reader.h: New file with abigail::xml_reader APIs. * include/abg-writer.h: New file with abigail::xml_writer APIs. * include/Makefile.am: Add the new files above to the source distribution. * src/abg-reader.cc: Update top-file comments. (namespace xml_reader): Rename namespace reader into this. (read_to_translation_unit, read_corpus_from_archive): New static functions. (read_translation_unit_from_file) (read_translation_unit_from_file, read_corpus_from_file): New entry points. (struct array_deleter): New functor. (translation_unit::read): Remove this. * src/abg-writer.cc: Update top file comments. (namespace xml_writer): Rename namespace writer into this. (struct archive_write_ctxt): New internal type. (create_archive_write_context, write_translation_unit_to_archive) (write_translation_unit, write_corpus_to_archive): New low level static functions overloads. (write_corpus_to_archive, write_translation_unit): Public higher level overloads. (translation_unit::write): Remove. (dump): Update for new xml_writer namespace. * include/abg-ir.h (translation_unit::{read, write}): Remove these serialization methods. * include/abg-corpus.h (corpus_sptr): New convenience typedef. (corpus::{read, write}): Remove these methods. * src/abg-corpus.cc (corpus::{read, write}) (corpus::impl::{serialized_tus, archive}): Remove these members. (corpus::impl::{get_archive, close_archive, write_tu_to_archive, read_to_translation_unit}): Remove these methods. * tests/test-bidiff.cc (main): Update for usage of the new xml_reader API. * tests/test-read-write.cc (main): Likewise. Update for the usage of the new xml_writer API, too. * tests/test-walker.cc (main): Update for the usage of the new xml_reader API. * tests/test-write-read-archive.cc (main): Likewise. And for the xml_writer API, too. * tools/biar.cc (add_tus_to_archive, extract_tus_from_archive): Likewise. * tools/bidiff.cc (main): Likewise, for xml_reader APIs. * tools/bilint.cc (main): Likewise, for xml_writer APIs, too. 2013-11-29 Dodji Seketeli Add support for bidiff regression testing * tests/data/test-bidiff/test-enum0-v0.cc.bi: New input file. * tests/data/test-bidiff/test-enum0-v1.cc.bi: Likewise. * tests/data/test-bidiff/test-enum0-report.diff: Likewise. * tests/data/test-bidiff/test-enum1-v0.cc.bi: Likewise. * tests/data/test-bidiff/test-enum1-v1.cc.bi: Likewise. * tests/data/test-bidiff/test-enum1-report.txt: Likewise. * tests/data/test-bidiff/test-qual-type0-v0.cc.bi: Likewise. * tests/data/test-bidiff/test-qual-type0-v1.cc.bi: Likewise. * tests/data/test-bidiff/test-qual-type0-report.txt: Likewise. * tests/data/test-bidiff/test-struct0-v0.cc.bi: Likewise. * tests/data/test-bidiff/test-struct0-v1.cc.bi: Likewise. * tests/data/test-bidiff/test-struct0-report.txt: Likewise. * tests/data/test-bidiff/test-struct1-v0.cc.bi: Likewise. * tests/data/test-bidiff/test-struct1-v1.cc.bi: Likewise. * tests/data/test-bidiff/test-struct1-report.txt: Likewise. * tests/data/test-bidiff/test-var0-v0.cc.bi: Likewise. * tests/data/test-bidiff/test-var0-v1.cc.bi: Likewise. * tests/data/test-bidiff/test-var0-report.txt: Likewise. * tests/test-bidiff.cc: New file. * tests/Makefile.am: Build the new runtestbidiff regression test and add the above to the source distribution. 2013-11-29 Dodji Seketeli Add missing test inputs to source distribution * tests/Makefile.am (data/test-read-write/test{17, 18, 19, 20, 21}.xml): Add these test input files to the source distribution. 2013-11-28 Dodji Seketeli Add diff support for var_decl * include/abg-comparison.h (class var_diff): New declaration. (var_diff_sptr): New convenience typedef. (compute_diff): New overloads for var_diff, decl_base and type_base. * src/abg-comparison.cc (try_to_diff): Renamed try_to_diff_types into this. (compute_diff_for_types): Adjust for the try_to_diff_types renaming. Fix comments. (compute_diff_for_decls): Re-use try_to_diff. Update for var_decl. (compute_diff): Define overloads for decl_base, type_base and var_decl. (diff_length_of_decl_bases, diff_length_of_type_bases): New static help functions. (report_name_size_and_alignment_changes): Renamed report_size_and_alignment_changes into this. Make it report name changes as well. (var_diff::priv): New struct. (var_diff::{var_diff, first_var, second_var, type_diff, length, report}): Define methods. ({qualified_type_diff, enum_diff, class_diff, scope_diff, function_decl_diff}::report): Do not report anything if the diff is empty. (type_decl_diff::length): Fix this. (type_decl_diff::report): Adjust for renaming to report_name_size_and_alignment_changes. 2013-11-28 Dodji Seketeli Add enum_type_decl::get_pretty_representation() * include/abg-ir.h (enum_type_decl::get_pretty_representation): Declare new virtual method override. * src/abg-ir.cc (enum_type_decl::get_pretty_representation): Define it. 2013-11-28 Dodji Seketeli Change return type of abigail::is_type() * include/abg-fwd.h (is_type): Change the return type from bool to type_base_sptr. 2013-11-27 Dodji Seketeli Support diff for enum_type_decl * include/abg-ir.h (enum_type_decl_sptr): New typedef. (enum_type_decl::enumerator::enumerator): Make default constructor public so that enumerators can be stored in vectors. Maybe I should have made stored pointers to enumerators instead ... (enum_type_decl::enumerator::get_qualified_name): Define new method. * include/abg-comparison.h (string_enumerator_map) (changed_enumerator, string_changed_enumerator_map) (enum_diff_sptr): New convenience typedefs. (class enum_diff): Declare new class. (compute_diff): New overload for enum_type_decl. * src/abg-comparison.cc (enum diff_kind, report_mem_header): Move these at the beginning of the file. (struct enum_diff::priv): Define this. (enum_diff::{clear_lookup_tables, lookup_tables_empty, ensure_lookup_tables_populated, enum_diff, first_enum, second_enum, underlying_type_diff, deleted_enumerators, inserted_enumerators, changed_enumerators, length, report}): Define these new methods. (compute_diff): New overload for enum_diff. (compute_diff_for_types): Add support enum_type_decl here. 2013-11-27 Dodji Seketeli Fix equality operator for enum_type_decl * src/abg-ir.cc (enum_type_decl::operator==(const type_base& o)): This was comparing just the decl_base and type_base part of the enum. Now re-use the enum_type_decl::operator==(const decl_base) that compares the entirety of the types. 2013-11-27 Dodji Seketeli Fix indentation and wording of some existing diff reports * src/abg-comparison.cc (class_diff::report): Fix report wording. Change indentation space from 4 white spaces to two. (scope_diff::report): Fix logic indentation generation. 2013-11-26 Dodji Seketeli Change enum_type_decl::enumerators from a list to a vector * include/abg-ir.h (enum_type_decl::enumerators): Change this from a list to a vector. * src/abg-hash.cc (enum_type_decl::hash::operator()): Use the typedef enum_type_decl::enumerators rather than std::list. * src/abg-ir.cc (enum_type_decl::get_enumerators): Use the enum_type_decl::enumerators typedef. (enum_type_decl::operator==): Likewise. * src/abg-reader.cc (build_enum_type_decl): Likewise. * src/abg-writer.cc (write_enum_type_decl): Likewise. 2013-11-25 Dodji Seketeli Fix thinko in qualified_type_diff::length * src/abg-comparison.cc (qualified_type_diff::length): Fix thinko. 2013-11-25 Dodji Seketeli Support diff between qualified types * include/abg-ir.h (qualified_type_def_sptr): Declare new typedef. (class qualified_type_def): Add comment at the end. (operator<<(std::ostream&, qualified_type_def::CV)): Declare new streaming operator. * src/abg-ir.cc (operator<<(std::ostream&, qualified_type_def::CV)): Define this new streaming operator. * include/abg-comparison.h (class qualified_type): Declare new class. (compute_diff): Declare new overload for qualified_type_def_sptr. * src/abg-comparison.cc (struct qualified_type_diff::priv): Define new type. (qualified_type_diff::{qualified_type_diff, first_qualified_type, second_qualified_type, underlying_type_diff, length}): Define new methods. (get_leaf_type): Define new static function. (compute_diff): Define overload for qualified_type_def_sptr. (compute_diff_for_types): Add support for diffing qualified_type_def here. 2013-11-25 Dodji Seketeli Cleanup header of changes of underlying types of pointers/references * src/abg-comparison.cc ({pointer_diff, reference_diff}::report): Unify header of changes in the referenced type. * src/abg-ir.cc (decl_base::get_pretty_representation): By default, do not prefix types with "type ", for consistency sake. 2013-11-25 Dodji Seketeli Ensure diff types can only be created by compute_diff * include/abg-comparison.h (diff::diff): Make constructor protected. (pointer_diff::pointer_diff): Likewise. (pointer_diff::{first_pointer, second_pointer}): Constify the return type. (compute_diff): Make this a friend of class pointer_diff. (reference_diff::reference_diff): Make this constructor protected. (compute_diff): Make this a friend of class reference_diff. (class_diff::class_diff): Make this constructor protected. (compute_diff): Make this a friend of class class_diff. (scope_diff::scope_diff): Make this constructor protected. (compute_diff): Make this a friend of class scope_diff. (function_decl_diff::function_decl_diff): Make this constructor protected. (type_decl_diff::type_decl_diff): Likewise. (typedef_diff::typedef_diff): Likewise. (translation_unit_diff::translation_unit_diff): Likewise. (compute_diff): Make this a friend of class translation_unit_diff. * src/abg-comparison.cc (pointer_diff::{first_pointer, second_pointer}): Constify return type. 2013-11-21 Dodji Seketeli Add size/alignment info to class diff report * src/abg-comparison.cc (represent): Move these static overloads to the beginning of the file. (report_size_and_alignment_changes): New function. It has been factorized out of ... (type_decl_diff::report): ... this. (class_diff::report): Use the new report_size_and_alignment_changes to report size/alignment info for classes. 2013-11-21 Dodji Seketeli Style fix * src/abg-comparison.cc (class_diff::report): Rename first_class into first and second_class into second. 2013-11-21 Dodji Seketeli Misc diff reporting nits * include/abg-ir.h (type_decl::get_pretty_representation): New overload. * abg-ir.cc (type_decl::get_pretty_representation): Implement it. * src/abg-comparison.cc (represent, class_diff::report): Quote the pretty representation of abi artifacts in the report. (type_decl_diff::report): Better wording to express type_decl change. 2013-11-20 Dodji Seketeli Support reporting changed data member in class * include/abg-ir.h (operator<<(std::ostream&, decl_base::binding)) (operator<<(std::ostream&, class_decl::access_specifier)): Declare new streaming operators. (class_decl::member_type::get_pretty_representation): New virtual overload. * src/abg-ir.cc (operator<<(std::ostream&, decl_base::binding)): (operator<<(std::ostream&, class_decl::access_specifier)): Define new streaming operators. (class_decl::member_type::get_pretty_representation): Define new method. * src/abg-comparison.cc (represent): Make the existing overloads end by a newline. Add a new overload that represents the changes that happened a given data member. (enum diff_kind): New. (report_mem_header): Renamed report_num_dels_or_ins into this. Make it support introducing changed members as well as deletions/insertions. (class_diff::report): Adjust for the report_num_dels_or_ins -> report_mem_header change. Use the new represent() overload to report about changed data members. Adjust logic now that represent() emits a newline at its end. Also adjust logic as far as representing base classes and member types changes is concerned. (type_decl_diff::report): Remove useless white space. 2013-11-20 Dodji Seketeli Ensure that *::report adds just one empty line to its content * include/abg-comparison.h (diff::report): Add a comment saying that each the diff::report interface must leave one empty line at the end of the report. * src/abg-comparison.cc ({pointer_diff, reference_diff, class_diff, scope_diff, function_decl_diff, type_decl_diff, typedef_diff}::report): Leave just one empty line after content. 2013-11-20 Dodji Seketeli Various doxygen doc additions and fixes * include/abg-comparison.h: Lots of doc string additions & fixes, especially for typedefs. * include/abg-ir.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-ir.cc: Likewise. 2013-11-20 Dodji Seketeli Better support changed base classes and member types * include/abg-comparison.h (class_diff::{clear_lookup_tables, lookup_tables_empty, ensure_lookup_tables_populated}): Declare new methods. (compute_diff): Make this a friend of class_diff. * src/abg-comparison.cc (class_diff::priv::{deleted_bases_, inserted_bases_, changed_bases_, deleted_member_types_, inserted_member_types_, changed_member_types_, deleted_data_members_, inserted_data_members_, changed_data_members_, deleted_member_class_tmpls_, inserted_member_class_tmpls_, changed_member_class_tmpls_}): Define new members. (class_diff::priv::{base_has_changed, member_type_has_changed, data_member_has_changed}): Declare and define new methods. (class_diff::{clear_lookup_tables, lookup_tables_empty, ensure_lookup_tables_populated}): Define new methods. (class_diff::report): Detect and report when a base class or a member type has changed, as opposed to just saying that it has been removed and inserted. Fix the rest of the function to avoid emitting useless vertical space and avoid saying that the class has "zero" insertion/deletion of a given kind of member. (scope_diff::report): avoid saying that the scope has "zero" insertion/deletion of a given kind of member. Avoid useless vertical spaces. (type_decl_diff::report): Avoid useless vertical spaces. 2013-11-19 Dodji Seketeli Add bilint tool to validate bi files somewhat. * tools/bilint.cc: New file. * tools/Makefile.am: Build and install the new file above. 2013-11-19 Dodji Seketeli Add diff support for typedef_decl and type_decl * include/abg-ir.h (operator<<(std::ostream&, decl_base::visibility)): Declare new streaming operator. * src/abg-ir.cc (operator<<(std::ostream&, decl_base::visibility)): Define it. (type_decl::{operator==, get_pretty_representation}): Likewise, define these new overloads. (decl_base::{operator==, get_pretty_representation}): New overloads. * include/abg-comparison.h (type_decl_diff type_decl_diff_sptr, typedef_diff, typedef_diff_sptr): Declare new classes and typedefs. * src/abg-comparison.cc (type_decl_diff::{type_decl_diff, first_type_decl, second_type_decl, length, report}): New methods definitions. (compute_diff): New function definition that takes pointers of type_decl. (typedef_diff::{typedef_diff, first_typedef_decl, second_typedef_decl, underlying_type_diff, length, report}): New methods. (compute_diff): New function definition that takes pointers of typedef_decl. (try_to_diff_types): New template function, factorized out of ... (compute_diff_for_types): ... this. Add support diffing type_decl and typedef_decl. (pointer_diff::report): Fix indentation of emitted report. * tools/bidiff.cc (parse_command_line): Fix style. 2013-11-19 Dodji Seketeli Avoid missing member types while reading bi files * include/abg-fwd.h (get_type_declaration): Declare function. * include/abg-ir.h (class decl_base): Add class_decl as a friend. This to be able to call decl_base::set_scope from class_decl. (scope_decl::add_member_decl): Make this virtual protected, so that it can be called (virtually) from e.g, class_decl. (type_decl_sptr, typedef_decl_sptr): New convenience typedefs. (class_decl::add_member_decl): New virtual overload for scope_decl::add_member_decl. (class_decl::{add_member_type, add_data_member, add_member_function}): New overloads. * src/abg-ir.cc (add_decl_to_scope): Benign style cleanup. (get_type_declaration): Define new function. (class_decl::add_member_decl): New method. (class_decl::add_member_type): Avoid silently added a new member type when that member type has already been (perhaps inadvertently) added to a scope already. Rather, put a strict assert in place there. Also add a new overload that constructs the member type out of a classic type and adds it to the class. (class_decl::{add_data_member, add_member_function}): Likewise. (class_decl::{add_member_function_template, add_member_class_template}): Avoid silently added a new member template when that template has already been (perhaps inadvertently) added to a scope already. Rather, put a strict assert in place there. * src/abg-reader.cc (push_decl_to_current_scope): Take a an extra flag saying if the current decl should be added to the current scope as well (in addition to being pushed onto the stack of scopes maintained in the reader context). (push_and_key_type_decl): Likewise, take that extra flag and pass it to push_decl_to_current_scope. (build_function_decl, build_var_decl, build_type_decl) (build_qualified_type_decl, build_pointer_type_def) (build_reference_type_def, build_enum_type_decl, build_typedef_decl) (build_function_tdecl, build_class_tdecl): Likewise. (build_class_decl): Likewise. When building member data, types, and functions, make sure /not/ to add the data, type of function to the current scope before adding it to the class_decl. This was making the member not being added to the class because it already had a scope. (build_type_tparameter, build_type_composition) (build_non_type_tparameter, build_template_tparameter) (build_type): Adjust to add the template parm to the current scope explicitly, like previously. (handle_type_decl): Use build_type_decl function. Add the type_decl to the current scope, like previously. (handle_namespace_decl, handle_qualified_type_decl) (handle_pointer_type_def, handle_reference_type_def) (handle_enum_type_decl, handle_typedef_decl, handle_var_decl) (handle_function_decl, handle_class_decl, handle_function_tdecl) (handle_class_tdecl): Adjust to add the decl to the current scope, like previously. * tests/data/test-read-write/test21.xml: New test input with member type(def). 2013-10-24 Dodji Seketeli Avoid tabs and add const/virtual/offsets to class member diff reports * include/abg-ir.h (class_decl::get_num_virtual_functions): New declaration. * src/abg-ir.cc (class_decl::get_num_virtual_functions): New definition. (function_decl::get_pretty_representation): Represent destructors and const member functions. * src/abg-writer.cc (write_cdtor_const_static): Take a new bool parm for constness and serialize it. (write_class_decl): Serialize member functions & function template const-ness. * src/abg-reader.cc (read_cdtor_const): Read the "const" xml attribute, rather than "is_const". 2013-10-24 Dodji Seketeli Fix num insertions reporting in member functions * src/abg-comparison.cc (class_diff::report): Fix num insertions reporting. 2013-10-24 Dodji Seketeli Serialize vtable offset for virtual functions * include/abg-ir.h (class_decl::member_function::get_vtable_offset): Renamed class_decl::member_function::get_vtable_offset_in_bits into this. The offset is an index into a table; it's not a value in bits. * src/abg-hash.cc (class_decl::member_function::hash): Update wrt function name change above. * src/abg-ir.cc (class_decl::member_function::operator==): Likewise. * src/abg-reader.cc (build_class_decl): Rename the attribute vtable-offset-in-bits into vtable-offset. * src/abg-writer.cc (write_voffset): New function. (write_class_decl): Use the new write_voffset. Cleanup. 2013-10-24 Dodji Seketeli White space and style fixes * include/abg-ir.h (class_decl::member_function::member_function): Align function parameters. * src/abg-ir.cc (type_decl::operator==): Remove useless white spaces 2013-10-24 Dodji Seketeli Do not report added/removed type_decls * src/abg-comparison.cc (scope_diff::report): Do not report added/removed type_decls. 2013-10-24 Dodji Seketeli Fix string representation for variables and methods * src/abg-ir.cc (var_decl::get_pretty_representation): Don't use the pretty representation for the type of the variable; just use its qualified name. (method_type::set_class_type): I wonder what I was thinking when setting the first parameter's type to being the type of the class. Remove this. (function_decl::get_pretty_representation): Use the "method " prefix for methods. Avoid printing the first parameter of methods. Use the qualified name of the parameter type, rather than its pretty representation. * src/abg-writer.cc (write_class_decl): Do not skip the first function parameter when serializing the method. 2013-10-24 Dodji Seketeli Support reporting removed types/decls * include/abg-comparison.h (scope_diff::{removed_types, removed_decls, added_types, added_decls}): New accessor methods declarations. * src/abg-comparison.cc (scope_diff::{removed_types, removed_decls, added_types, added_decls}): New accessor methods definitions. (scope_diff::report): Report removed & added types/decls. 2013-10-24 Dodji Seketeli Fix erratic reporting of changed types & decls in scopes * src/abg-comparison.cc (scope_diff::ensure_lookup_tables_populated): A changed type/decl is not only one that has been both deleted and inserted (as is a type/decl with a given name N has been deleted and a type/decl with that same name N has been inserted), but we must also ensure that both inserted and deleted type/decl are not the same. Otherwise, it might has been a type/decl that has been shuffled around. 2013-10-24 Dodji Seketeli Fix some class & scope diff reports formatting glitchs * src/abg-comparison.cc (class_diff::report): Quote data members. (scope_diff::report): Simplify how we report changed types. Avoid unnecessary vertical spaces. 2013-10-24 Dodji Seketeli Pretty representation for variables and types by default * include/abg-ir.h (var_decl::get_pretty_representation): New method declaration. * src/abg-ir.cc (decl_base::get_pretty_representation): Prefix types with the "type " string. (var_decl::get_pretty_representation): New method definition. 2013-10-24 Dodji Seketeli Re-write middle snakes management in core diff algorithms * include/abg-diff-utils.h (point::set): New overload.. (point::{add, operator<, operator>, operator<=, operator>=}): New methods. (point::operator!=): Constify. (point::operator==): Constify. Cleanup. (point::operator=): Keep emptiness. (class snake): New class definition (d_path_vec::{over_bounds, offset}): New methods. (d_path_vec::check_index_against_bound): Don't take a bound parameter anymore. Use the new over_bound method above. Fix up error reporting. (d_path_vec::d_path_vec): Fix d_path_vec size allocation. (d_path_vec::operator[]): Use the d_path_vec::at method to check all accesses against the bounds. This is slower, but at least we can expect to have something that is more robust. We can remove the bound checking later when we are sure the code has been tested enough. Also use the new offset() method. (d_path_vec::at): Take long long. (ends_of_furthest_d_paths_overlap): Constify input parameters. (end_of_fr_d_path_in_k, end_of_frr_d_path_in_k_plus_delta): Take an instance of the new snake in parameter, rather than a bare end point that wasn't carrying enough information about the snake. Record the snake which consists of up to four points: a begin point, an intermediate point, a diagonal start point and an end point. Return that snake upon successful completion. (compute_middle_snake): Take an instance of snake, rather than the two points that were supposed to represent a snake and with which we were loosing information before. Revisit/simplify the logic of this function; this literally goes forward or in reverse, gets the resulting snake returned by the end_of_fr_d_path_in_k and end_of_frr_d_path_in_k_plus_delta functions, detect if these snakes overlap and just return the current snake. Much simpler. The caller now gets a snake, which has much more information than the previous snake approximation made of just two points. Bonus point, this follows almost to the word, what the paper says. (maybe_record_match_point, find_snake_start_point): Remove these as there are not used by compute_middle_snake anymore. (print_snake, ses_len): Update these to take/handle a snake. (snake_end_points): New declaration. (compute_diff): When we are getting an empty first sequence, this means that we are inserting the second sequence *before* the beginning of the first sequence; keep this information by setting the insertion point index to -1, rather than zero. Update this to get/handle snakes, rather than free points vaguely representing snakes. Now that compute_middle_snake returns real snakes, handle the information we are getting. Basically for edit scripts of length equal to 1, as the snake carries all the necessary information about the non-diagonal edge (as well as the diagonal edges), we (can) now precisely update the current edit script (as well as the longest common sub-sequence). For edit scripts of length greater than 1, better at which points to divide the problem and consequently, at which points to conquer it back -- better following The Paper to the letter. (display_edit_script): Update this for the use of instances of snake. * src/abg-diff-utils.cc (ends_of_furthest_d_paths_overlap): Update for constification of inputs. (snake_end_points): Define new function. (compute_middle_snake): Adapt for the taking an instance of snake. * tests/test-diff2.cc (main): Update for using instances of snake. * tests/test-core-diff.cc: Add new tests. * tests/data/test-core-diff/report0.txt: Update for output adaptation. * tests/data/test-core-diff/report6.txt: Likewise. * tests/data/test-core-diff/report7.txt: Likewise. * tests/data/test-core-diff/report8.txt: New test data. * tests/data/test-core-diff/report9.txt: Likewise. * tests/data/test-core-diff/report10.txt: Likewise. * tests/data/test-core-diff/report11.txt: Likewise. * tests/data/test-core-diff/report12.txt: Likewise. * tests/data/test-core-diff/report3.txt: Likewise. 2013-10-19 Dodji Seketeli Support diff/reporting for functions & better diff/report in general * include/abg-ir.h ({decl_base, class_decl, function_decl}::get_pretty_representation): New virtual member to get a pretty string name for decls & types. (class_decl::parameter): Add an index to the parameter type. (class_decl::parameter::parameter): Update the constructor for the change above. (class_decl::parameter::{get_index, set_index}): Accessors for the new index. (class_decl::parameter::operator==): Take in account the index. (function_type::append_parameter): Set the index of the parameter here. * include/abg-fwd.h (get_type_name): New declaration. * src/abg-ir.cc (get_type_name): New definition. ({decl_base, function_decl, class_decl}::get_pretty_representation): New implementations. (method_type::set_class_type): Update this to set function parameter's index by default. (function_decl::append_parameters): Use the append_parameter method from function_type. * include/abg-comparison.h (class function_decl_diff): New type declaration. * src/abg-comparison.cc (compute_diff_for_decls, compute_diff): New definitions. ({pointer_diff, class_diff, scope_diff}::report): Use the new get_pretty_representation. Output a prettier report. (function_decl_diff::priv): New type. (function_decl_diff::{deleted_parameter_at, inserted_parameter_at, ensure_lookup_tables_populated, function_decl_diff, first_function_decl, second_function_decl, changed_parms, removed_parms, added_parms, length, report}): New member function definitions. * src/abg-hash.cc (function_decl::parameter::hash): Update this to take the index in account. 2013-10-19 Dodji Seketeli Misc style & white space fixes * include/abg-fwd.h (is_global_scope, is_at_global_scope) (is_at_class_scope, is_at_template_scope, is_template_parameter) (is_type, is_var_decl, is_template_parm_composition_type) (is_template_decl, is_function_template_pattern) (add_decl_to_scope, get_global_scope, get_translation_unit): Remove parameter names from declarations. * include/abg-ir.h (decl_base::set_location): Remove useless white space. (struct type_shared_ptr_equal): Fix comment filling. 2013-10-16 Dodji Seketeli Avoid useless hashing during serialization * src/abg-writer.cc (write_context::get_id_for_type): Avoid the useless hashing incurred by the [] operator on the map, when we already have the value we want. 2013-10-16 Dodji Seketeli Add more IR nodes dumping routines * include/abg-fwd.h (dump): Declare 4 overloads for the dumping routines. * include/abg-ir.h (var_decl_sptr): New typedef. * src/abg-writer.cc (dump(const decl_base_sptr)): Add comments. (dump(const type_base_sptr)): New dumping routines. (dump(const var_decl_sptr)): Likewise. 2013-10-16 Dodji Seketeli Fix IR node comparison bugs * include/abg-ir.h (type_shared_ptr_equal::operator()): Fix thinko in checking for the boolean value of the pointers to types. * src/abg-ir.cc (type_decl::operator==(const decl_base&)): Do not forget to compare the decl_base part of the type too. (type_decl::operator==(const type_base&)): To ease maintenance, re-use the equality operator that takes a decl_base. (scope_type_decl::operator==(const type_base&)): Likewise. (qualified_type_def::operator==(const type_base&)): Likewise. (compare_function_types): New sub-routine to compare function types. It fixes an infinite recursion when comparing two methods of the same class. (function_type::operator==(const type_base&)): Use the new compare_function_types function. (class_decl::operator==(const decl_base&)): Fix a thinko in the first test of the function. Use a dedicated scope for each class section comparison; that way, there won't be any chance to misuse the variables pertaining to a different section. Fix the member function sections; we were mistakenly using the variables for the *data* section there. (class_decl::operator==(const type_base&)): Re-use the operator that takes a decl_base. (class_decl::operator==(const class_decl&)): Don't remove const-ness during the static cast. (class_decl::member_function::operator==(const member_function&)): Do not remove the reference from the static cast. (class_decl::member_class_template::operator==(const member_base&)): Likewise. (type_tparameter::operator==(const template_parameter&)): Likewise. (template_tparameter::operator==(const template_parameter&)): Likewise. (function_tdecl::operator==(const template_decl&)): Likewise. (class_tdecl::operator==(const template_decl&)): Likewise. (class_tdecl::operator==(const class_tdecl&)): Likewise. * tests/data/test-read-write/test12.xml: Update this because the test now correctly considers two type template parameters at the same index as being equivalent. * tests/data/test-read-write/test13.xml: Likewise. 2013-10-16 Dodji Seketeli On going white space cleanups * include/abg-ir.h: Remove useless white spaces. * src/abg-ir.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-writer.cc: Likewise. 2013-10-15 Dodji Seketeli Finish reporting about class_diff * src/abg-comparison.cc (report_num_dels_or_ins): Factorize out the header of each of inserted/deleted parts of the class into this new function. (class_diff::report): Use the new report_num_dels_or_ins. Cleanup the code. Add support for reporting about member functions, member function templates and member class templates. 2013-10-15 Dodji Seketeli White space cleanup in abg-ir.h * include/abg-ir.h (class_decl::member_function_template::member_function_template): Remove useless white space. 2013-10-15 Dodji Seketeli Progress on diffing pointers, references and classes * include/abg-comparison.h (diff::{first_subject,second_subject): Changed first_scope/second_scope into these; so that this diff class now works on stuff that are not scope. Changed the type of these to decl_base_sptr (diff::diff): Update for the change above. (diff::{length, report}): New virtual pure methods. (class pointer_diff, reference_diff): New classes declarations. (compute_diff): New overloads for the new classes above. Make the existing overloads take shared_pointers instead of references. Also make them return shared pointers of the computed diff, rather than just populating diff references passed in parameter. (class class_diff): Renamed class class_decl_diff into this. (report_changes): Change these functions into member functions. * src/abg-comparison.cc (compute_diff_for_types): New static function. (pointer_diff::pointer_diff, pointer_diff::first_pointer) (pointer_diff::second_pointer, pointer_diff::length) (pointer_diff::underlying_type_diff) (pointer_diff::underlying_type_diff, pointer_diff::report) (pointer_diff::report, compute_diff) (reference_diff::reference_diff, reference_diff::first_reference) (reference_diff::second_reference) (reference_diff::underlying_type_diff) (reference_diff::underlying_type_diff, reference_diff::length) (reference_diff::report, compute_diff): New functions. (class_diff::class_diff, class_diff::length) (class_diff::first_class_decl, class_diff::second_class_decl) (class_diff::base_changes, class_diff::base_changes) (class_diff::member_types_changes) (class_diff::member_types_changes) (class_diff::data_members_changes) (class_diff::data_members_changes, class_diff::member_fns_changes) (class_diff::member_fns_changes) (class_diff::member_fn_tmpls_changes) (class_diff::member_class_tmpls_changes) Update wrt class_decl_diff -> class_diff renaming. (class_diff::report): Make the report function be a member function. Add an indentation parameter. Add support for member types and data members. (compute_diff): New overload for class_decl_sptr. (scope_diff::first_scope, scope_diff::second_scope) (scope_diff::length, scope_diff::report): New member functions. (scope_diff::{deleted_member_at, inserted_member_at}): Update wrt first_scope -> first_subject change. (compute_diff): New overload for scope_decl_sptr. (translation_unit_diff::report): Change the report function into this member function. (compute_diff): Change the overload for translation_unit to take a translation_unit_sptr rather than a reference. * tools/bidiff.cc (main): Update this wrt the change of the signature of compute_diff. 2013-10-15 Dodji Seketeli Fix construction of class_decl::member_type * include/abg-ir.h (class_decl::member_type::member_type): Remove inline body from here. * src/abg-ir.cc (class_decl::member_type::member_type): Move implementation here. Also, properly set the name of the the member_type at construction time. 2013-10-15 Dodji Seketeli Few typedef additions to abg-ir.h * include/abg-ir.h (pointer_type_def_sptr) (reference_type_def_sptr): New typedefs. 2013-10-11 Dodji Seketeli Add debugging routines for decl_base_sptr and translation_unit * src/abg-writer.cc (dump): Add two version of this; on for decl_base_sptr, one for translation_unit&. 2013-10-11 Dodji Seketeli Initial implementation of tu diffing & bidiff cmd line program * include/abg-comparison.h (class translation_unit_diff): New type. (compute_diff): Make this take class_decl&, rather than class_decl_sptr. Add new overloads for scope_decl& and translation_unit&. (report_changes): New overload for scope_diff& and translation_unit&. * src/abg-comparison.cc (struct class_decl_diff::priv): New type. (class class_decl_diff): Add comments to methods. (class translation_unit_diff): Implement methods. (compute_diff, report_changes): Implement the new overloads. (scope_diff::ensure_lookup_tables_populated): Fix a thinko here. * src/abg-ir.cc (is_var_decl): Add new predicate. * tools/abg-tools-utils.h (file_exists, is_regular_file) (check_file): Declare new functions. * tools/abg-tools-utils.cc (get_stat, file_exists, check_file) (is_regular_file): Define new functions. (is_dir): Use the new get_stat. * tools/bidiff.cc: New file. * tools/Makefile.am: Add tools/bidiff.cc to the build system; make it produce the bidiff tool. 2013-10-10 Dodji Seketeli Fix inheritance of operator== on decl_base and type_base * include/abg-ir.h (*lots of descendants of decl_base, type_decl) (template_decl, class_decl::member_base): Replace the previous classical *::operator==(*&) with an overload of decl_base::operator==(const decl_base&), type_base::operator==(const type_base), template_decl::operator==(const template_decl&) or class_decl::member_base::operator==(const class_decl::member_base&). This makes the descendant operator be the one called when a comparison involves references the parent class. * src/abg-ir.cc: Write the implementation of the above. Remove the useless static_casts from the previous operator== code. 2013-10-10 Dodji Seketeli On going misc white spaces and style fixes * include/abg-ir.h: Add author. Remove many useless white spaces. Add missing end-of-class comments. Move function declaration comments from here to their definition point. * include/abg-fwd.h: Remove useless indentation. Also move doxygen comments to *definition* points in src/abg-ir.cc. * src/abg-ir.cc: Remove many useless white spaces. Move comments from declaration points to here. 2013-10-06 Dodji Seketeli Fix middle snake determination & ses len computation for d == 1 * include/abg-diff-utils.h (compute_middle_snake): After the overlap determination happened, finding the middle snake can require keep on building the current path until the "end". The end meaning reaching the max of D. And that max is (M + N)/2 + 1. In the extreme cases were middle snake was on the very last step (M + N) + 1, we were not finding the middle snake. Fix this. (compute_diff): When d == 1 and the first edge on the edit graph is a non-diagonal edge and when a_base != a_begin, we were failing to properly initialize x,y to find that non-diagonal edge. Also we were failing to correctly compute the size of the sequence. Fix these. * tests/test-core-diff.cc: Add a new regression test for the two cases above. * tests/data/test-core-diff/report7.txt: New reference data for the new regression test. 2013-10-05 Dodji Seketeli Initial un-debugged implementation of scope diffing * include/abg-comparison.h (class scope_diff): New type. (compute_diff(scope_decl_sptr, scope_decl_sptr, scope_diff)): New declaration. (report_changes): New declaration. * src/abg-comparison.cc (struct scope_diff::priv): Define. (scope_diff::{clear_lookup_tables, lookup_tables_empty, ensure_lookup_tables_populated, scope_diff, member_changes, deleted_member_at, inserted_member_at, changed_types, changed_decls}): Define these new member functions. (compute_diff): Define. * include/abg-ir.h (decl_base_sptr): New typedef. (operator==(decl_base_sptr, decl_base_sptr)): Declare new operator. * src/abg-ir.cc (operator==(decl_base_sptr, decl_base_sptr)): Define. (scope_decl::{operator==, traverse}): Adjust for using vectors to store scope members now, rather than lists. (scope_decl::{declarations, scopes}): Make these types be vector. This makes the members of a scopes be vector, rather than lists. This enables them to be diffed. 2013-10-05 Dodji Seketeli Simplify & cleanup compute_diff core api * include/abg-diff-utils.h (insertion::inserted_): Changed the type of this from vector to vector. (insertion::{insertion, inserted_indexes}): Adjust. (compute_diff): Add two new simpler overloads. Implement them in term of the former more complex overload. (compute_lcs): Adjust for the vector -> vector change. * src/abg-diff-utils.cc (compute_lcs, compute_ses): Adjust for the compute_diff change above. * src/abg-comparison.cc (compute_diff, report_changes): Adjust for the compute_diff & vector changes above.. 2013-10-05 Dodji Seketeli Misc white space, style and comments cleanup * include/abg-ir.h (class scope_decl): Add end of class comment. (class type_base): Add a _sptr typedef and end of class comment. * src/abg-ir.cc (operator==(class_decl_sptr, class_decl_sptr)): Fix comment. 2013-10-04 Dodji Seketeli Un-debugged initial implementation of class diffing. * include/abg-ir.h (decl_base::get_qualified_name): New declaration. (class_decl::{base_specs, member_types, data_members, member_functions, member_function_templates, member_class_templates}): Make all these containers be vectors, rather than list. This makes these containers (like class_decl::base_specs, class_decl::member_types, etc) be suitable to be used by the core diffing algorithms to diff their content. (operator==(class_decl_sptr, class_decl_sptr)) (operator==(class_decl::member_type_sptr, class_decl::member_type_sptr)) (operator==(class_decl::base_spec_sptr, class_decl::base_spec_sptr)) (operator==(class_decl::data_member_sptr, class_decl::data_member_sptr)) (operator==(class_decl::member_function_sptr, class_decl::member_function_sptr)) (operator==(class_decl::member_function_template_sptr, class_decl::member_function_template_sptr)) (operator==(class_decl::member_class_template_sptr, class_decl::member_class_template_sptr)): Declare these new equality operators. These are to be used by the core diffing algorithms when comparing two vectors of shared pointers of members of class_decls. * src/abg-ir.cc (decl_base::get_qualified_name): Define. (class_decl::class_decl, class_decl::operator==(class_decl&)): Adjust for the containers type change to a vector. (operator==(class_decl_sptr, class_decl_sptr)) (operator==(class_decl::member_type_sptr, class_decl::member_type_sptr)) (operator==(class_decl::base_spec_sptr, class_decl::base_spec_sptr)) (operator==(class_decl::data_member_sptr, class_decl::data_member_sptr)) (operator==(class_decl::member_function_sptr, class_decl::member_function_sptr)) (operator==(class_decl::member_function_template_sptr, class_decl::member_function_template_sptr)) (operator==(class_decl::member_class_template_sptr, class_decl::member_class_template_sptr)): Define these. * include/abg-comparison.h (diff::scope_): Remove (diff::{first_scope_, second_scope_}): New members. (class_decl_diff::class_decl_diff): Pass the new scopes to this constructor. (class_decl_diff::{first_class_decl, second_class_decl}) (report_changes): New declarations. * src/abg-comparison.cc (class_decl_diff::class_decl_diff): Update as per the declaration. (class_decl_diff::{first_class_decl, second_class_decl}): Define as per the declaration. (compute_diff): Initial implementation for this. (report_changes): Define. 2013-10-04 Dodji Seketeli Change the diff::changes_type back to just edit_script * include/abg-comparison.h (diff::changes_type): Remove this typedef. (class_decl_diff::data_members_changes): Rename class_decl_diff::data_member_changes into this. (class_decl_diff::member_fn_tmpls_changes): Renamed class_decl_diff::member_fn_tmpl_changes into this. (class_decl_diff::member_class_tmpls_changes): Renamed class_decl_diff::member_class_tmpl_changes into this. (class_decl_diff::{base_changes, member_types_changes, data_members_changes, member_fns_changes, member_fn_tmpls_changes, member_fn_tmpls_changes, member_class_tmpls_changes}): Adjust these declarations for the use of edit_script. * src/abg-comparison.cc (class_decl_diff::priv::*): Likewise. (class_decl_diff::{base_changes, member_types_changes, data_members_changes, member_fns_changes, member_fn_tmpls_changes, member_fn_tmpls_changes, member_class_tmpls_changes}): Adjust these definitions for the above. 2013-10-04 Dodji Seketeli Misc white space, style and comment fixes * include/abg-ir.h: Lots of useless white space removals and comments adding. (class class_decl::member_base): Fix comment. * src/abg-hash.cc: Lots of useless white space removals too. * src/abg-ir.cc: Remove useless white space too. 2013-10-04 Dodji Seketeli Fix middle snake determination * include/abg-diff-utils.h (point::{operator!=,operator==}): New operators. (end_of_fr_d_path_in_k, end_of_frr_d_path_in_k_plus_delta): Allow the initial point (-1,-1) that is not a point addressing elements of the input sequences, but that is the starting point of the forward paths and the ending point of reverse paths in the "Linear Refinement" of the algorithm. (is_match_point, maybe_record_match_point) (find_snake_start_point): New functions. (find_last_snake_in_path): Remove this. It's not used anymore. (compute_middle_snake): Allow checking for overlapping paths even on points that are outside of the edit graph boundaries. Once the overlap is detected, if a non-empty snake has been seen already, report it as the middle snake. Otherwise, keep building the path until the end and report the last snake encountered as the middle snake. Add comments. (compute_diff): For the d == 1 case, fix the logic of the finding the non-diagonal edge. Fix typos. Add comments. (display_edit_script): Fix report glitches. * tests/data/test-core-diff/report3.txt: Update as per the report glitch above. * tests/data/test-core-diff/report4.txt: Likewise. * tests/data/test-core-diff/report5.txt: Likewise. * tests/data/test-core-diff/report6.txt: New reference report for a new test. * tests/test-core-diff.cc: Add a new test for negative delta. 2013-10-03 Dodji Seketeli Initial regression test facility for core diff algorithms * tests/data/test-core-diff/report0.txt: New test reference data. * tests/data/test-core-diff/report1.txt: Likewise. * tests/data/test-core-diff/report2.txt: Likewise. * tests/data/test-core-diff/report3.txt: Likewise. * tests/data/test-core-diff/report4.txt: Likewise. * tests/data/test-core-diff/report5.txt: Likewise. * tests/test-core-diff.cc: New regression test program. * tests/Makefile.am: Add these new files to the build system. 2013-10-02 Dodji Seketeli Initial command line testing facility for core diff algorithms * tests/test-diff2.cc: New command line testing facility. * tests/Makefile.am: Add this to the build system. 2013-10-02 Dodji Seketeli Fix core diff algorithms for negative deltas * diff2.h (point::point): New copy constructor. (point::{operator+=, operator=}): Use point::set. (point::{operator--, operator++,}): New operators. (d_path_vec::{a_size_, b_size_}): New members. (d_path_vec::max_d_): Remove this member. (d_path_vec::max_d): Compute this, now that max_d_ was removed. (point_is_valid_in_graph): Declare this new function. (end_of_fr_d_path_in_k, ): Return a bool when the end of furthest reaching past found is within the bounds of the edit graph. Add comments. (end_of_frr_d_path_in_k_plus_delta): Likewise. Also, delta can be negative; support that. Do not cross the boundaries of the edit graph when following a diagonal edge. (find_last_snake_in_path): New function. (compute_middle_snake): Make forward/reverse d_path_vec be big enough to hold paths for M+N differences. Normally M+N/2 should be enough, but we were getting weird out of bound errors. Let's handle it this way for now. Do not require that we check for overlap only when we are on a diagonal edge. Once we detected an overlap, use the new find_last_snake_in_path to find the boundaries of the snake. (ses_len): Delta can be negative. (display_edit): Small minor English nit. 2013-09-28 Dodji Seketeli Lay down the foundations of computing the diff between two class_decl * include/abg-diff-utils.h: New file. * src/abg-diff-utils.cc: Likewise. Implement the code diffing algorithms from Eugene Myers. * include/abg-comparison.h: New file. First short at defining the basic APIs to compute the diff of two classes. * src/abg-comparison.cc: New file. Start the implementation of the above header. 2013-09-26 Dodji Seketeli Prepare node visitors to be usable on things other than IR nodes * include/abg-fwd.h (node_visitor_base): Renamed ir_node_visitor into this. * include/abg-traverse.h (struct node_visitor_base): New base for the visitors. (struct traversable_base): Update comments. (traversable_base::traverse): Change this into non-pure virtual. Make it take a reference to node_visitor_base, rather than a reference to ir_node_visitor. * src/abg-traverse.cc (traversable_base::traverse): New empty default implementation. * include/abg-ir.h: Make ir_node_visitor inherit from new node_visitor_base. 2013-09-26 Dodji Seketeli Renamed data members from m_something to something_ * src/abg-ir.{cc,h}: Renamed data members from m_something to something_ and update their usage. 2013-08-29 Dodji Seketeli Initial version of an archive manipulation program: biar * tests/test-utils.h (is_dir, ensure_dir_path_created) (ensure_parent_dir_created): Move these directories manipulation utilities from here to ... * tools/abg-tools-utils.h (is_dir, ensure_dir_path_created) (ensure_parent_dir_created): ... here in this new file. (dir_name, base_name): Declare these new functions. * tests/test-utils.cc (is_dir, ensure_dir_path_created) (ensure_parent_dir_created): Likewise, move these to ... * tools/abg-tools-utils.cc (is_dir, ensure_dir_path_created) (ensure_parent_dir_created): ... here in this new file. (dir_name, base_name): Define these. * tools/Makefile.am: New file. Create a new libtoolsutils.la static library with stuff from tools/abg-tools-utils.cc in it. Also create a new 'biar' program with the stuff from the new tools/biar.cc in it. * tools/biar.cc: New file. Contains the code for the new "biar" archive manipulation command line utility. * tests/test-read-write.cc (main): Adjust for the change about ensure_parent_dir_created above. * tests/test-write-read-archive.cc (main): Likewise. * Makefile.am (SUBDIRS): Add the new tools/ sub-directory to the build system. * configure.ac (AC_CONFIG_FILES): Generate tools/Makefile. * tests/Makefile.am: Make libtestutils.la link with the new libtoolsutils.la. Make sure to express the dependencies between libtestutils.la and the binaries that depend on it. Otherwise parallel builds can go awry. 2013-08-29 Dodji Seketeli Define translation_unit{_sptr,s} types in abigail:: * include/abg-corpus.h (abigail::corpus::{translation_unit_sptr, translation_units): Do not define these typedefs here. Rather) (define them ... * include/abg-ir.h (abigail::{translation_units,translation_unit_sptr): ... here. This is because a translation unit can be manipulated independently from an abi corpus. * src/abg-corpus.cc (corpus::get_translation_units): Adjust return type to comply with the change above. 2013-08-29 Dodji Seketeli Fix header inclusion in abg-corpus.h * include/abg-corpus.h: Drop incomplete abg-traverse.h and abg-fwd.h. Use abg-ir.h proper and be done with it. Users of the library will just have to use abg-corpus.h to manipulate and the archives and the IR they contain. 2013-08-29 Dodji Seketeli Add error message to translation_unit::write * src/abg-writer.cc (translation_unit::write): Add an error message to stderr if something ultimately went wrong. 2013-08-29 Dodji Seketeli Rename abigail::corpus::{get_file_path --> get_path} * include/abg-corpus.h (corpus::{get_path, set_path): Renamed corpus::get_file_path and corpus::set_file_path into these as get_path/set_path is what is used elsewhere as well. * src/abg-corpus.cc (corpus::{get_path, set_path}): Likewise. * tests/test-write-read-archive.cc (main): Adjust for the change above. 2013-08-29 Dodji Seketeli Cleanup src/Makefile.am * src/Makefile.am: Fix library naming and remove useless trailing space from directory path. 2013-08-27 Dodji Seketeli Initial writing/reading of an ABI corpus to an archive * configure.ac: Support detection of libzip dependency. Define new DEPS_CFLAGS and DEPS_LIBS variables for use in Makefile.am to refer to the dependency headers and libraries. * doc/website/mainpage.txt: Update this to talk about the new libzip dependency. * include/Makefile.am: Add abg-libzip-utils.h to the build system. * include/abg-corpus.h (corps): Hide abigail::corpus's private behind a pimpl idiom. (corpus::{drop_translation_units, get_file_path, set_file_path, write, read}): New methods. * include/abg-libxml-utils.h (new_reader_from_buffer): Declare new function. * include/abg-libzip-utils.h: New file. * src/Makefile.am: Add abg-corpus.cc and abg-libzip-utils.cc to the build system. Refer to the library and headers dependencies via the new DEPS_LIBS and DEPS_CFLAGS variables. * src/abg-corpus.cc: New file. * src/abg-ir.cc (translation::set_path): New method. * src/abg-libxml-utils.cc (new_reader_from_buffer): Define new function. * src/abg-libzip-utils.cc: New file. * src/abg-reader.cc (translation_unit::read): New overload. * src/abg-writer.cc: Inject the names from the std namespace into the abigail namespace, rather than into abigail::writer. (abigail::translation_unit::write): New overload. This can now use ofstream and the other stuff from std that are injected in the abigail:: namespace. * tests/Makefile.am: Add tests/test-write-read-archive.cc to the build system; use that to build runtestwritereadarchive. Also add the input test data from tests/data/test-write-read-archive/test[0-4].xml. * /tests/data/test-write-read-archive/test[0-4].xml: New test input data files. * tests/test-write-read-archive.cc: New test for this archive write/read support. 2013-08-27 Dodji Seketeli Fix & add missing API documentation * src/abg-ir.cc (location_manager::create_new_location): Fix documentation comment. (translation_unit::translation_unit) (translation_uni::get_global_scope, translation_unit::get_path) (translation_unit::traverse, translation_unit::get_loc_mgr) (translation_unit::is_empty, translation_unit::traverse): Add missing documentation comments. * src/abg-libxml-utils.cc (new_reader_from_file): Fix comment. * src/abg-reader.cc (translation_unit::read): Likewise. 2013-08-27 Dodji Seketeli Remove useless header inclusion * include/abg-traverse.h: Remove useless #include 2013-08-27 Dodji Seketeli Misc white space cleanups * include/abg-corpus.h: Cleanup white spaces. * include/abg-fwd.h: Likewise. * include/abg-ir.h: Likewise. * include/abg-libxml-utils.h: Likewise. * src/abg-config.cc: Likewise. * src/abg-ir.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-writer.cc: Likewise. 2013-08-27 Dodji Seketeli Small cleanup in abg-config.cc * src/abg-config.cc: Include auto-generated $(top_builddir)/config.h file. 2013-08-27 Dodji Seketeli Pass absolute paths to the compiler during the build * src/Makefile.am: Pass absolute file paths to the compiler during the build. This helps in e.g in emacs' compilation mode, when the output shows an error reported by GCC's diagnostics, setting point to the error line and hitting 'enter' transports the user to the file location where the error happened; as the file path is nows absolute, emacs can always find it. Otherwise, finding it depends on $PWD and whatnot. * tests/Makefile.am: Likewise. 2013-08-27 Dodji Seketeli Misc cleanups in abg-fwd.h * include/abg-fwd.h: Move location, location_manager and translation_unit in the ir section. Remove stuff that was commented out anyway. 2013-08-27 Dodji Seketeli Move location, location_manager & translation_unit back into abg-ir.h * include/abg-corpus.h: Move location location_manager, translation_unit from here ... * include/abg-ir.h: ... to here. The reason being that these are really constructs of the Internal Representation of the ABI/API of a translation unit. What is left in abg-corpus is really exclusively related to an ABI Corpus, which I see more as a "packaging" construct that abstracts the bundling of several translation units together. Also, I fixed some comments about the location/location_manger types; now a location is made specific to a translation unit; to an abi corpus. A location of a given translation unit has to be decoded by the location manager of that same translation unit. 2013-08-22 Dodji Seketeli Make libxml2 a private dependency wrt pkconfig * libabigail.pc.in: Libxml2 is not exposed to clients so make it be a private dependency. 2013-08-22 Dodji Seketeli White space fix in COMPILING * COMPILING: White space fix. 2013-08-22 Dodji Seketeli Add abg-version.h.in to the source distribution & cleanup * include/Makefile.am: Add abg-version.h.in to the source distribution. * configure.ac: Generate abg-version.h in using the existing AC_CONFIG_FILES macro call. 2013-08-22 Dodji Seketeli Support pkgconfig through a new libabigail.pc file * libabigail.pc.in: New pkgconfig file. * configure.ac: Define the LIBXML2_VERSION variable that is used in the libabigail.pc.in file. Generate the libabigail.pc file from its libabigail.pc.in template. * Makefile.am: Add libabigail.pc.in to the source distribution. Install the generated libabigail.pc to the right destination. 2013-08-21 Dodji Seketeli Tweak the apidoc mainpage * include/abg-fwd.h: Fix link to the project web page and for git check-out. 2013-08-21 Dodji Seketeli Initial website generation-fu using Doxygen * doc/website/mainpage.txt: New file representing the input for the website. * doc/website/libabigail-website.doxy: New file representing the doxygen configuration for the website generation. * doc/api/libabigail.doxy: Output doxygen generation warnings into a file. * doc/Makefile.am: Support generating the website from doxygen. Update the api generation relevant macros names for better consistency. Make "make html" generate the website too. Make "make clean" erase the website bits too. Add a 'website' target to make the website. 2013-08-21 Dodji Seketeli Fix typo in CONTRIBUTING file * CONTRIBUTING: Fix typo, courtesy of Mark Wielaard. 2013-08-19 Dodji Seketeli Remove autotools-generated files * Makefile.in: Remove this autotools-generated file. I know that people in the GCC-realm like storing these autotools-generated files into the source control system, but I believe in this day and age, this is annoying (to say the least) for the project developers for no good reason. Requiring (the ubiquitous) autoconf for building from source is no big deal today, and typing "autoreconf" is not hard to do, really. And it saves the developers for having to update a bunch of boilerplate automatically generated files into the source control system; this is really unnecessary noise and it is a commonly accepted good practice to avoid doing it these days. To help people who do not know how to handle this, there is a COMPILING file in the source tree that explains how to build the project from sources. * aclocal.m4: Likewise. * configure: Likewise. * include/Makefile.in: Likewise. * src/Makefile.in: Likewise. * doc/Makefile.in: Likewise. * tests/Makefile.in: Likewise. 2013-08-19 Dodji Seketeli Add a new COMPILING file explaining how to build the package * COMPILING: New file. 2013-08-14 Dodji Seketeli Remove name of unused parameter in decl_base::traverse. * src/abg-ir.c (decl_base::traverse): Remove name of unused parameter. 2013-08-14 Dodji Seketeli install headers in $includedir/libabigail * include/Makefile.am: Install headers in $includedir/libabigail 2013-08-14 Dodji Seketeli For usage from within GCC set header path to $includedir/libabigail * abigail.m4: The include path used for compilation goes to $includedir/libabigail. 2013-08-08 Benjamin Kosnik Separate out bits from the ir header. * include/abg-irfwd.h: Move to... * include/abg-fwd.h: ...this. * include/abg-ir.h (traverse_base): Move to... * include/abg-traverse.h: ...here. New. * include/abg-ir.h (location, location_manager, translation_unit): Move to... * include/abg-corpus.h: ...here. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. 2013-08-07 Benjamin Kosnik Template naming compression. * include/abg-ir.h: Template naming compressions. (class_template_decl): To class_tdecl. (function_template_decl): To function_tdecl. (template_type_parameter): To type_tparameter. (template_non_type_parameter): To non_type_tparameter. (template_template_parameter): To template_tparameter. (tmpl_parm_type_composition): To type_composition. * include/abg-irfwd.h: Same. * src/abg-hash.cc: Same. * src/abg-ir.cc: Same. * src/abg-reader.cc: Same. 2013-08-07 Benjamin Kosnik Slight change to doxy config. * doc/api/libabigail.doxy: Turn off namespace scopes, on all the viz. 2013-08-07 Benjamin Kosnik Move class_decl nested types out-of-line. * include/abg-ir.h (class_decl): Move nested types out of line. 2013-08-07 Benjamin Kosnik Rename class_decl::method to class_decl::method_base. * include/abg-ir.h (class_decl::member): To member_base. * src/abg-hash.cc: Same. * src/abg-ir.cc: Same. * src/abg-writer.cc: Same. 2013-08-07 Benjamin Kosnik Nest hashers. * include/abg-ir.h: Nest all hashers. * include/abg-irfwd.h (abigail): Don't inject std::tr1::hash. Remove hasher forward declarations. * include/abg-hash.h: Tweak. * src/abg-hash.cc: Define hashers here. * src/abg-ir.cc: Adjust for above. * src/abg-reader.cc: Same. * src/abg-writer.cc: Same. 2013-08-06 Benjamin Kosnik Rename abi_corpus to corpus * include/abg-corpus.h (abi_corpus): Change to corpus. * include/abg-hash.h: Tweaks. * include/abg-libxml-utils.h: Same. 2013-08-06 Benjamin Kosnik Simplify interface for serializing/deserializing translation_units. * include/abg-ir.h (translation_unit::read): New member function. (translation_unit::write): Same. * src/abg-reader.cc (translation_unit::read): Define. * src/abg-writer.cc (translation_unit::write): Define. * include/abg-reader.h: Remove. * include/abg-writer.h: Remove. * include/Makefile.am (headers): Same. * include/Makefile.in: Regenerate. 2013-08-06 Benjamin Kosnik First pass clean reading API. * include/abg-reader.h (read_file): Remove extraneous file parameter. * src/abg-reader.cc: Same. * tests/test-read-write.cc: Adjust. 2013-08-06 Benjamin Kosnik Rename traversable to traversable_base, move up the _decl hierarchy via decl_base derivation. * include/abg-ir.h (traversable): To traversable_base. (decl_base): Inherit from traversable_base. (decl_base::traverse): Null definition. (function_decl, etc.): Remove traversable_base as base class. 2013-08-06 Benjamin Kosnik Standardize typedef naming. Plural form is the container form, smart_ptr types are type + _sptr. * include/abg-ir.h (scope_decl): Add declarations, scopes as types. (function_type): Add parameter_sptr, parameters as types. (enum_type_decl): Add type_sptr, enumerators as types. (class_decl): Adjust typedefs for consistency. Change base_specs_type to base_specs, member_types_type to member_types, data_members_type to data_members, member_functions_type to member_functions, member_function_templates_type to member_function_templates, member_class_templates_type to member_class_templates. 2013-08-02 Benjamin Kosnik Doxygen markup fixes final. * include/abg-config.h: Doxygen cleanups round two. * include/abg-hash.h: Same. * include/abg-ir.h: Same. * include/abg-irfwd.h: Same. * include/abg-libxml-utils.h: Same. * src/abg-config.cc: Same. * src/abg-hash.cc: Same. * src/abg-ir.cc: Same. * src/abg-reader.cc: Same. * src/abg-writer.cc: Same. 2013-08-01 Benjamin Kosnik Forward decls for abg-ir.h, doxygen fixups, restyle. * include/abg-irfwd.h: New file for forward declarations. * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/*: Forward declare, doxygen fixups, restyle. * src/*: Same. * src/abg-corpus.cc: Empty, removed. * doc/api/libabigail.doxy: Tweak. 2013-08-01 Benjamin Kosnik Add virtual dtor to translation_unit. * include/abg-ir.h (translation_unit): Add virtual dtor. * src/abg-ir.cc: Define. 2013-08-01 Benjamin Kosnik Adjust doxygen input path. * doc/api/libabigail.doxy: Adjust include directory. 2013-08-01 Benjamin Kosnik Collapse subdir of include to include. * include/libabigail/abg-*.h: Move to... * include/abg-*.h * include/libabigail: Remove. * configure.ac: Adjust include location from libabigail/include to include. * Makefile.in: Same. * aclocal.m4: Same. * configure: Same. * doc/Makefile.in: Same. * include/Makefile.am: Same. * src/Makefile.am: Same. * src/Makefile.in: Same. * tests/Makefile.am: Same. * tests/Makefile.in: Same. 2013-07-23 Dodji Seketeli Update autotool auto-generated files * Makefile.in: Updated. * aclocal.m4: Likewise. * configure: Likewise. * doc/Makefile.in: Likewise. * src/Makefile.in: Likewise. * tests/Makefile.in: Likewise. 2013-07-20 Dodji Seketeli Implement a translation unit traversal API * include/libabigail/abg-ir.h (struct ir_node_visitor, struct traversable): New interfaces. (translation_unit, scope_decl, type_decl, qualified_type_def) (pointer_type_def, reference_type_def, enum_type_decl) (typedef_decl, var_decl, function_decl, data_member) (member_function, member_function_template) (member_class_template): Implement the traversable interface, overload the traversable::traverse pure virtual function. * src/abg-ir.cc ({translation_unit, scope_decl, type_decl, namespace_decl, qualified_type_def, pointer_type_def, reference_type_def, enum_type_decl, typedef_decl, var_decl, function_decl, class_decl::member_function, class_decl, class_decl::data_member, class_decl::member_function_template, class_decl::member_class_template, function_template_decl, class_template_decl, }::traverse): Implement traversal. (ir_node_visitor::visit): New method, overloaded for the types above, which implement the traversable interface. * tests/test-walker.cc: New test case program to showcase how to use the new traversal API. * tests/makefile.am: Add test-walker.cc to the build system. 2013-07-19 Dodji Seketeli By default, statically link libabigail with whoever uses abigail.m4 * abigail.m4: Make $abigaillibs statically link libabigail by default. 2013-07-19 Dodji Seketeli Move static member definition to abg-viz-dot.cc file * include/libabigail/abg-viz-dot.h: Move definition of node_base::_M_count_total to ... * src/abg-viz-dot.cc: ... here. 2013-07-19 Dodji Seketeli Put headers in include/libabigail * include/libabigail: New directory. * include/Makefile.am: New file. * include/libabigail/Makefile.am: New file. * src/abg-*.h: Move these in include/libabigail/*.h * src/Makefile.am: Set -I option to look for headers in include/libabigail * doc/api/libabigail.doxy: Look for headers in include/libabigail * tests/Makefile.am: Set -I option to look for headers in include/libabigail * abigail.m4: Set includedir to $prefix/include/libabigail for library used as a dep, or to srcdir/libabigail/include/libabigail in GCC source tree. * configure.ac: Add Makefile.am in include and include/libabigail * abigail.m4: Look for headers in include/libabigail when the libabigail is in in the source tree and in $incdir/libabigail when it is installed as a dependency. 2013-07-18 Benjamin Kosnik Install into docdir, turn off collaboration graphs. * doc/Makefile.am (doc-install-html-doxygen): Install generated files into docdir. * doc/api/libabigail.doxy (COLLABORATION_GRAPH): Turn off. 2013-07-18 Benjamin Kosnik Fix dependencies for api/html output directory. * doc/Makefile.am: Create abi output directory. 2013-07-16 Dodji Seketeli Prepare for publishing * COMMIT-LOG-GUIDELINES: New file. * CONTRIBUTING: New file. * README: Amended to refer to the first files above. 2013-07-16 Dodji Seketeli LGPLv3 License the library * COPYING-LGPLV3: New file. * abg-config.cc: License the file to LGPLv3. * abg-config.h: Likewise. * abg-corpus.cc: Likewise. * abg-corpus.h: Likewise. * abg-hash.cc: Likewise. * abg-hash.h: Likewise. * abg-ir.cc: Likewise. * abg-ir.h: Likewise. * abg-libxml-utils.cc: Likewise. * abg-libxml-utils.h: Likewise. * abg-reader.cc: Likewise. * abg-reader.h: Likewise. * abg-writer.cc: Likewise. * abg-writer.h: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-common.h: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-dot.h: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-viz-svg.h: Likewise. * tests/test-read-write.cc: Likewise. * tests/test-utils.cc: Likewise. * tests/test-utils.h: Likewise. 2013-07-17 Dodji Seketeli Add assert.h in abg-ir.cc * src/abg-ir.cc: Add missing assert.h 2013-07-17 Dodji Seketeli Fix missing license blurbs * src/abg-config.cc: Fix licensing blurb. * src/abg-config.h: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-corpus.h: Likewise. * src/abg-ir.cc: Likewise. * src/abg-ir.h: Likewise. * src/abg-reader.cc: Likewise. * src/abg-writer.cc: Likewise. 2013-07-02 Benjamin Kosnik Correct DOT merge. * src/abg-viz-common.h: Use _M_attributes for attribute overflows. * src/abg-viz-dot.h: Merge in correct node_base. * src/abg-viz-dot.cc: Same. * tests/test-dot.cc: Correct examples. * tests/Makefile.am: Add .gv to CLEANFILES. * tests/Makefile.in: Regenerate. 2013-07-02 Benjamin Kosnik Pull out common style type. * src/abg-viz-common.h: Pull out common style type. * src/abg-viz-dot.cc: Adjust scoping. * src/abg-viz-common.cc: Same. * src/abg-viz-dot.h: Use common style class. * src/abg-viz-svg.h: Same. 2013-07-02 Benjamin Kosnik Commonize visualization support. * src/abg-viz-svg.h: Move common code to... * src/abg-viz-dot.h: Move common code to... * src/abg-viz-common.h: ...here. New. * src/abg-viz-svg.cc: Move common code to... * src/abg-viz-common.cc: ...here. New. * src/Makefile.am: Add abg-viz-common.cc, abg-viz-common.h * src/Makefile.in: Regenerate. 2013-07-01 Benjamin Kosnik Initial DOT work. * doc/vizualization/layout/scripts/ (inkscape_export_svg_to_plain_svg.sh): Move... (inkscape_export_svg_to_png_and_pdf.sh): Move... * scripts: ..here. New toplevel directory. * scripts/scripts/dot_to_png.sh: New. * scripts/scripts/dot_to_svg.sh: New. * src/Makefile.am: Add abg-viz-dot.cc, abg-viz-dot.h. * tests/Makefile.am: Add test-dot.cc. * src/abg-viz-dot.cc: New. * src/abg-viz-dot.h: New. * tests/test-dot.cc: New. * doc/vizualization/graph: New. * doc/vizualization/graph/gv/sa-A.gv: New. * doc/vizualization/graph/gv/sa-B.gv: New. * doc/vizualization/graph/gv/sa-C1.gv: New. * doc/vizualization/graph/gv/sa-C2.gv: New. * doc/vizualization/graph/gv/sa-C3.gv: New. * doc/vizualization/graph/gv/sa-C4.gv: New. * doc/vizualization/graph/gv/sa-D1.gv: New. * doc/vizualization/graph/gv/sa-D2.gv: New. * doc/vizualization/graph/gv/sa-D2v.gv: New. * doc/vizualization/graph/gv/sa-D3.gv: New. * doc/vizualization/graph/gv/sa-D3v.gv: New. * doc/vizualization/graph/gv/sa-D4v.gv: New. * doc/vizualization/graph/gv/sa-D5v1.gv: New. * doc/vizualization/graph/gv/sa-D5v2.gv: New. * doc/vizualization/graph/gv/sa-DD1.gv: New. * doc/vizualization/graph/gv/sa-DD2.gv: New. * doc/vizualization/graph/gv/sa-DD3.gv: New. * doc/vizualization/graph/gv/sa-DD4.gv: New. * doc/vizualization/graph/gv/sa-DD5.gv: New. * doc/vizualization/graph/gv/sa-base.gv: New. * doc/vizualization/graph/png/sa-A.png: New. * doc/vizualization/graph/png/sa-B.png: New. * doc/vizualization/graph/png/sa-C1.png: New. * doc/vizualization/graph/png/sa-C2.png: New. * doc/vizualization/graph/png/sa-C3.png: New. * doc/vizualization/graph/png/sa-C4.png: New. * doc/vizualization/graph/png/sa-D1.png: New. * doc/vizualization/graph/png/sa-D2.png: New. * doc/vizualization/graph/png/sa-D2v.png: New. * doc/vizualization/graph/png/sa-D3.png: New. * doc/vizualization/graph/png/sa-D3v.png: New. * doc/vizualization/graph/png/sa-D4v.png: New. * doc/vizualization/graph/png/sa-D5v1.png: New. * doc/vizualization/graph/png/sa-D5v2.png: New. * doc/vizualization/graph/png/sa-DD1.png: New. * doc/vizualization/graph/png/sa-DD2.png: New. * doc/vizualization/graph/png/sa-DD3.png: New. * doc/vizualization/graph/png/sa-DD4.png: New. * doc/vizualization/graph/png/sa-DD5.png: New. * doc/vizualization/graph/png/sa-base.png: New. * doc/vizualization/graph/sources/sa-A.cc: New. * doc/vizualization/graph/sources/sa-B.cc: New. * doc/vizualization/graph/sources/sa-C.cc: New. * doc/vizualization/graph/sources/sa-D.cc: New. * doc/vizualization/graph/sources/sa-DD.cc: New. * doc/vizualization/graph/sources/sa-base.cc: New. * doc/vizualization/graph/svg/sa-A.svg: New. * doc/vizualization/graph/svg/sa-B.svg: New. * doc/vizualization/graph/svg/sa-C1.svg: New. * doc/vizualization/graph/svg/sa-C2.svg: New. * doc/vizualization/graph/svg/sa-C3.svg: New. * doc/vizualization/graph/svg/sa-C4.svg: New. * doc/vizualization/graph/svg/sa-D1.svg: New. * doc/vizualization/graph/svg/sa-D2.svg: New. * doc/vizualization/graph/svg/sa-D2v.svg: New. * doc/vizualization/graph/svg/sa-D3.svg: New. * doc/vizualization/graph/svg/sa-D3v.svg: New. * doc/vizualization/graph/svg/sa-D4v.svg: New. * doc/vizualization/graph/svg/sa-D5v1.svg: New. * doc/vizualization/graph/svg/sa-D5v2.svg: New. * doc/vizualization/graph/svg/sa-DD1.svg: New. * doc/vizualization/graph/svg/sa-DD2.svg: New. * doc/vizualization/graph/svg/sa-DD3.svg: New. * doc/vizualization/graph/svg/sa-DD4.svg: New. * doc/vizualization/graph/svg/sa-DD5.svg: New. * doc/vizualization/graph/svg/sa-base.svg: New. 2013-07-01 Benjamin Kosnik Regenerate build/configure. * aclocal.m4: * configure: 2013-06-06 Benjamin Kosnik Regenerate configure files. * Makefile.in: * aclocal.m4: * configure: * doc/Makefile.in: * src/Makefile.in: * tests/Makefile.in: 2013-05-28 Benjamin Kosnik Add svg generation. * src/Makefile.am: Add abg-viz-svg.cc, abg-viz-svg.h. * tests/Makefile.am: Add test-svg.cc. * src/abg-viz-svg.cc: New. * src/abg-viz-svg.h: New. * tests/test-svg.cc: New. 2013-05-22 Benjamin Kosnik Remove ChangeLog * ChangeLog: Remove content. 2013-05-21 Benjamin Kosnik Fixup abg-version.h merge duplicate. * configure.ac: Remove src/abg-version.h merge duplicate. 2013-05-20 Benjamin Kosnik Add doc/visualization/layout. * doc/vizualization/layout: New. * doc/vizualization/layout/pdf/sa-A.pdf: New. * doc/vizualization/layout/pdf/sa-B.pdf: New. * doc/vizualization/layout/pdf/sa-C1.pdf: New. * doc/vizualization/layout/pdf/sa-C2.pdf: New. * doc/vizualization/layout/pdf/sa-C3.pdf: New. * doc/vizualization/layout/pdf/sa-D1.pdf: New. * doc/vizualization/layout/pdf/sa-D2.pdf: New. * doc/vizualization/layout/pdf/sa-D2v.pdf: New. * doc/vizualization/layout/pdf/sa-D3.pdf: New. * doc/vizualization/layout/pdf/sa-D3v.pdf: New. * doc/vizualization/layout/pdf/sa-D4v.pdf: New. * doc/vizualization/layout/pdf/sa-DD1.pdf: New. * doc/vizualization/layout/pdf/sa-DD2.pdf: New. * doc/vizualization/layout/pdf/sa-DD3.pdf: New. * doc/vizualization/layout/pdf/sa-DD4.pdf: New. * doc/vizualization/layout/pdf/sa-DD5.pdf: New. * doc/vizualization/layout/pdf/sa-base.pdf: New. * doc/vizualization/layout/png/sa-A.png: New. * doc/vizualization/layout/png/sa-B.png: New. * doc/vizualization/layout/png/sa-C1.png: New. * doc/vizualization/layout/png/sa-C2.png: New. * doc/vizualization/layout/png/sa-C3.png: New. * doc/vizualization/layout/png/sa-D1.png: New. * doc/vizualization/layout/png/sa-D2.png: New. * doc/vizualization/layout/png/sa-D2v.png: New. * doc/vizualization/layout/png/sa-D3.png: New. * doc/vizualization/layout/png/sa-D3v.png: New. * doc/vizualization/layout/png/sa-D4v.png: New. * doc/vizualization/layout/png/sa-DD1.png: New. * doc/vizualization/layout/png/sa-DD2.png: New. * doc/vizualization/layout/png/sa-DD3.png: New. * doc/vizualization/layout/png/sa-DD4.png: New. * doc/vizualization/layout/png/sa-DD5.png: New. * doc/vizualization/layout/png/sa-base.png: New. * doc/vizualization/layout/scripts/ (inkscape_export_svg_to_plain_svg.sh): New. (inkscape_export_svg_to_png_and_pdf.sh): New. * doc/vizualization/layout/sources/sa-A.cc: New. * doc/vizualization/layout/sources/sa-B.cc: New. * doc/vizualization/layout/sources/sa-C.cc: New. * doc/vizualization/layout/sources/sa-D.cc: New. * doc/vizualization/layout/sources/sa-DD.cc: New. * doc/vizualization/layout/sources/sa-base.cc: New. * doc/vizualization/layout/svg/sa-A.svg: New. * doc/vizualization/layout/svg/sa-B.svg: New. * doc/vizualization/layout/svg/sa-C1.svg: New. * doc/vizualization/layout/svg/sa-C2.svg: New. * doc/vizualization/layout/svg/sa-C3.svg: New. * doc/vizualization/layout/svg/sa-D1.svg: New. * doc/vizualization/layout/svg/sa-D2.svg: New. * doc/vizualization/layout/svg/sa-D2v.svg: New. * doc/vizualization/layout/svg/sa-D3.svg: New. * doc/vizualization/layout/svg/sa-D3v.svg: New. * doc/vizualization/layout/svg/sa-D4v.svg: New. * doc/vizualization/layout/svg/sa-DD1.svg: New. * doc/vizualization/layout/svg/sa-DD2.svg: New. * doc/vizualization/layout/svg/sa-DD3.svg: New. * doc/vizualization/layout/svg/sa-DD4.svg: New. * doc/vizualization/layout/svg/sa-DD5.svg: New. * doc/vizualization/layout/svg/sa-base.svg: New. 2013-05-20 Benjamin Kosnik Generate abg-version.h at configure time. * configure.ac: Add src/abg-version.h to AC_CONFIG_FILES. * src/Makefile.am: Remove abg-version.h generation rules. * src/abg-version.h.in: New. 2013-04-02 Benjamin Kosnik Add doc dir. Add Doxgen api generation rules. * doc: Add. * doc/Makefile.am (html, install-html): Add. * doc/Makefile.in: Add. * doc/api/libabigail.doxy: Add doxygen config. * src/abg-*: Add @file markup. 2013-03-27 Benjamin Kosnik Add configure to source control * configure: Add. * src/abg-corpus.cc: include stdexcept 2013-06-25 Dodji Seketeli Support offsets and virtual attribute in base class specifiers * src/abg-ir.h (class_decl::base_spec::base_spec): Take an offset and a is_virtual flag. (class_decl::base_spec::{get_is_virtual, get_offset_in_bits}): New methods. (class_decl::has_no_base_nor_member): New method declaration.. * src/abg-ir.cc (class_decl::base_spec::base_spec): Take an offset and a is_virtual flag (class_decl::has_no_base_nor_member): Define it. * src/abg-reader.cc (read_offset_in_bits): Renamed read_var_offset_in_bits into this. (read_is_virtual): New static function. (build_class_decl): Read the 'layout-offset-in-bits' and the 'is-virtual' of the base class specifier. Adjust for the read_var_offset_in_bits -> read_offset_in_bits rename. * src/abg-writer.cc (write_layout_offset): New overload for the base class specifiers. (write_class_decl): If the class has no member or base class, make it a proper empty xml element. Write the offset and the is-virtual attribute. * tests/data/test-read-write/test20.xml: New test input data. * tests/test-read-write.cc: De-serialize the test above, serialize it back and compare that both versions are the same. 2013-06-22 Dodji Seketeli Iron out support for simple base classes. * src/abg-ir.h (class_decl::base_spec::base_spec): Move this out-of-line. Add a new constructor for clients compiled without RTTI. * src/abg-ir.cc (class_decl::base_spec::base_spec): This is now here out-of-line. Define the new constructor for clients compiled without RTTI. * tests/data/test-read-write/test19.xml: New test case input for base classes. * tests/test-read-write.cc: De-serialize and serialize the new test case input above. 2013-06-21 Dodji Seketeli Fix handling of forward decl of classes * abg-ir.h (class_decl::set_earlier_declaration): Move this out-of-line and add an overload. * src/abg-ir.cc (class_decl::set_earlier_declaration): Moved this out-of-line here and add an overload. * src/abg-reader.cc (build_class_decl): Really read the 'decl-of-decl-id' property. Do not make the definition use the id of the declaration. Both have their id. * src/abg-writer.cc (write_class_decl): Put a space before the property "def-of-decl-id". * tests/data/test-read-write/test18.xml: New test input. * tests/test-read-write.cc: De-serialize this new input, serialize it back and make sure both versions are identical. 2013-06-21 Dodji Seketeli Serialize the layout offset of class data members. * src/abg-writer.cc (write_layout_offset): New function. (write_class_decl): Serialize the layout offset. 2013-06-21 Dodji Seketeli Support Bitwise OR for qualified_type_def::CV better * src/abg-ir.h (qualified_type_def::CV_RESTRICT): New enumerator for the qualified_type_def::CV enum. (operator|(qualified_type_def::CV, qualified_type_def::CV)): New declaration. * src/abg-ir.cc (operator|(qualified_type_def::CV, qualified_type_def::CV)): New definition. * src/abg-reader.cc (build_qualified_type_decl): No need for casting the result of bitwise or between instances of qualified_type_def::CV. 2013-06-14 Dodji Seketeli Support method type/decl, variadic functions, class declarations-only * src/abg-ir.h (function_decl::parameter::parameter): New constructor with variadic parameter marker. (function_decl::m_type): Make this protected to let method_decl inheriting class to access it. (function_decl::get_type): Move this out-of-line. (class method_type, method_type_hash): New types. (enum class_decl::access_specifier): Add no_access new enumerator. (class_decl::data_member::data_member): Move this out-of-line. (class_decl::data_member::~data_member): Declare virtual destructor. (class method_decl): New class. (class member_function): Make this inherit method_decl, instead of function_decl. (class_decl::class_decl): New constructors. (class_decl::{hashing_started, is_declaration_only, set_earlier_declaration, get_earlier_declaration}): New methods. * src/abg-ir.cc (add_decl_to_scope): If a decl is already in a scope, don't add it to this scope. (get_global_scope): Make this work when passed an instance of global_scope. (dynamic_type_hash::operator()): Add support for method_type. (method_type::{method_type, set_class_type, ~method_type, }) (method_type_hash::operator()): New defintions. (function_decl::get_type, class_decl::class_decl): Move these out-of-line here. (class_decl::method_decl::{method_decl, ~method_decl, get_type}): New definitions. (class_decl::member_function::member_function): Move this out-of-line here. Support method_decl. (class_decl::data_member::data_member): Likewise. (class_decl_hash::operator()): Guard this against endless loop. * src/abg-reader.cc (write_class_is_declaration_only): New static function. (write_var_decl): Take a flag to write the mangled name or not. (write_function_decl): Take a flag to skip the first parameter. (write_cdtor_const_static): Use 'yes' instead of 'true' as value of the properties. (write_decl, write_function_template_decl): Adjust wrt the new signatures of write_var_decl and write_function_decl. (write_enum_type_decl): Simplify call to write_location. (write_class_decl): Support serializing declaration-only classes. * src/abg-writer.cc: * tests/data/test-read-write/test17.xml: New test input. * tests/test-read-write.cc: De-serialize the above, and serialize it back. * tests/data/test-read-write/test10.xml: Update this test. 2013-06-01 Dodji Seketeli Support function_type and adapt a function_decl to use it * src/abg-ir.h (class function_type): Forward decl prior to class function_decl. (function_decl::parameter): Pass string by const reference. Add a variadic marker member and initialize it. (function_decl::parameter::get_type): Add a non-const overload. (function_decl::parameter::get_variadic_marker): New getter. (function_decl::function_decl) Take a const reference to a vector for parameters, type size/alignment. Add two overloads that takes a pointer to function_type. (function_decl::get_parameters): Move this out-of-line. (function_decl::append_parameter(s)): Renamed function_decl::add_parameter(s) into these. Move it out-of-line. Add an overload. (function_decl::{get_type, set_type}): New declaration. (function_decl::get_return_type): Move this out-of-line. (function_decl::is_variadic): New in-line function. (function_decl::m_type): New data member. (function_decl::{m_parms, m_return_type}): Remove. This are now carried by function_decl::m_type. (class function_type, struct function_type_hash): New declarations. (member_function::member_function): Take a vector of pointers to parameters. Take size/align of the type of the member function. Adjust initialization. * src/abg-ir.cc (dynamic_type_hash): Hash instance of function_type accessed through a pointer. (function_type::{operator==, ~function_type}) (function_type_hash::operaror(), function_decl::{get_return_type, }, function_decl::parameter::hash::operator()): New definitions. (function_decl::function_decl): The out-of-line definitions of the declarations above. (function_decl::append_parameter): Moved this out-of-line from inline function_decl::add_parameter. Make this rely on the underlying m_type. (function_decl::operator==): Adjust for use of vector for the parameters. Also, there is no need anymore to compare the parameters or the return types as they are compared by the comparison of the function types. * src/abg-reader.cc (build_function_decl): Read the new size/alignment attributes on the function-decl element. Build a function_type and use it to build the function_decl. Parameters and return type are now hung off of the function_type. (handle_function_decl): use build_function_decl. * src/abg-writer.cc (write_function_decl): Write the new size/alignment properties of the function-decl element. Adjust for the use of vectors for function parameters now. * tests/data/test-read-write/test10.xml: Adjust for the presence of size/alignment properties in the function-decl element now. * tests/data/test-read-write/test11.xml: Likewise. * tests/data/test-read-write/test12.xml: Likewise. * tests/data/test-read-write/test13.xml: Likewise. * tests/data/test-read-write/test14.xml: Likewise. * tests/data/test-read-write/test9.xml: Likewise. 2013-06-01 Dodji Seketeli Support null type hashing * src/abg-ir.cc (dynamic_type_hash::operator()(const type_base* t) const): Support hashing null type. 2013-05-23 Dodji Seketeli Add a couple of output file suffix configuration properties * src/abg-config.h (config::{get_tu_instr_suffix, set_tu_instr_suffix, get_tu_instr_archive_suffix, set_tu_instr_archive_suffix}): New decls. * src/abg-config.cc (config::{get_tu_instr_suffix, set_tu_instr_suffix, get_tu_instr_archive_suffix, set_tu_instr_archive_suffix}): New defs. 2013-05-23 Dodji Seketeli Add a new add_decl_to_scope overload * src/abg-ir.h (add_decl_to_scope): New declaration. * src/abg-ir.cc (add_decl_to_scope): New definition. 2013-05-23 Dodji Seketeli Ensure add_decl_to_scope properly updates the scope * src/abg-ir.h (scope_decl::m_member_scopes) (scope_decl::get_member_scopes): New declarations. (scope_decl::add_member_decl): Move this to ... * src/abg-ir.cc (scope_decl::add_member_decl): ... here. Make it update the new scope_decl::m_member_scopes too. 2013-05-23 Dodji Seketeli Add translation_unit::get_path * src/abg-ir.cc (translation_unit::get_path): New declaration. * src/abg-ir.cc (translation_unit::get_path): New definition. 2013-05-23 Dodji Seketeli Link the global scope to its translation unit * src/abg-ir.h (global_scope::global_scope): Take a translation unit and initialize the tu member with it. * src/abg-ir.cc (translation_unit::get_global_scope): Initialize the global scope with its actual translation unit. 2013-05-23 Dodji Seketeli Have location numbers that are stable throughout translation unit editing * src/abg-irc.cc (location_manager::create_new_location): Just append the new expanded location to the end of the location vectors, and return the new size of the vector as the location number. That way we don't change the location number of an expanded location that is already in the vector -- that change happens if we keep the vector sorted during the insertion. (location_manager::expand_location): The index of the expanded location is the location number - 1. 2013-05-23 Dodji Seketeli Fix in-source detection of the library for GCC * abigail.m4 (ABIGAIL_INIT): Don't forget to set abigaillibs when we detect the library in the source tree, particularly for GCC. 2013-05-21 Dodji Seketeli Re-generate aclocal.m4 * aclocal.m4: Re-generate with autoconf 2.64. 2013-05-21 Benjamin Kosnik Generate abg-version at configure time in builddir * configure.ac: Add src/abg-version.h to AC_CONFIG_FILES. * src/Makefile.am: Remote ad-hoc generation of abg-version.h from here. * src/abg-version.h.in: New file. * configure: Re-generate. * src/Makefile.in: Likewise. 2013-05-21 Dodji Seketeli add abigail.m4 to the distribution * Makefile.am: Add abigail.m4 to the distribution. * Makefile.in: Re-generate. 2013-05-10 Dodji Seketeli Pedantic fixes * src/abg-ir.h (enum decl_base::binding): Remove trailing space. (enum class_decl::access_specifier): Likewise. 2013-05-07 Dodji Seketeli Fix for building libabigail inside the GCC tree * abigail.m4: Detect when we are in the GCC tree; disable version check in that case. 2013-05-07 Dodji Seketeli Re-generate configury with autoconf 2.64 * abigail.m4: Add licence header. * configure.ac: Re-generate configure script with autoconf 2.64 like for GCC. 2013-05-07 Dodji Seketeli Allow autoconf-based clients to detect the library * configure.ac: Define the components of the version number as autoconf variables. Set the version number to 0.1.0 * abigail.m4: New file * Makefile.am: Add abigail.m4 to the build system. Install it in $(datadir)/aclocal. * src/Makefile.am: Generate and add abg-version.h from the version number autoconf variable defined in configure.ac. Re-generate abg-version.h each time configure.ac changes. * src/abg-config.h (abigail_get_library_version): Declare ... * src/abg-config.cc (abigail_get_library_version): ... and define this wirth C linkage. This is useful for autoconf tests to test for the presence of the library. * configure: Re-generate. * Makefile.in: Likewise. * src/Makefile.in: Likewise. * tests/Makefile.in: Likewise. 2013-05-03 Dodji Seketeli Build system fix for make distcheck * Makefile.am: Support the doc sub-directory. We don't have a COPYRIGHT file. * src/Makefile.am: Don't prefix the file paths by the absolute path of the src dir; current autotools know how to deal with it, otherwise and it break them. * tests/Makefile.am: Likewise. Make sure to remove the output of the tests upon make clean. * Makefile.in: Re-generate. * aclocal.m4: Likewise. * configure: Likewise. * src/Makefile.in: Likewise. * tests/Makefile.in: Likewise. 2013-05-02 Dodji Seketeli Initial support for member class templates * src/abg-ir.cc (class_decl::add_member_function_template): Fix comment. (class_decl::add_member_class_template) (class_decl::member_class_template::operator==) (class_decl::member_class_template_hash::operator()): New definitions. (class_decl::operator==): Compare member templates. Fix logic. (class_decl::data_member_hash::operator()) (class_decl::member_function_hash::operator()) (class_decl::member_function_template_hash::operator()): Don't hash the is_static boolean as it's hashed as part of the 'member' sub-object hashing. (class_decl::member_function_template::operator==): Move this out of line here, from the header file. (class_decl_hash::operator()): Hash member class templates. * src/abg-ir.h (class_decl::member::{m_is_static,is_static}): Add the is_static boolean here, so that it's factorized out of the inherited classes of this class. (class_decl::data_member::{is_static, m_is_static}) (class_decl::member_function::{is_static, m_is_static}) (class_decl::member_function_template::{is_static, m_is_static}): Remove this as it's now part of the base 'member' class. (class_decl::data_member::operator==) (class_decl::member_function::operator==): Don't compare the is_static boolean as it's now compared as part of the 'member' sub-object comparison. (class_decl::member_function_template::operator==): Move this out-of-line into src/abg-ir.cc. (class class_decl::member_class_template, struct class_decl::member_class_template_hash) (class_decl::{add_member_class_template, get_member_class_templates}): New declarations. (class_decl::member_class_templates_type): New typedef. * src/abg-reader.cc (build_class_decl): Support de-serializing member class templates. * src/abg-writer.cc (write_class_decl): Likewise, support serializing member class templates. * tests/data/test-read-write/test16.xml: New test input. * tests/test-read-write.cc (int_out_specs[]): Add the new test input to the list of inputs that are de-serialized and serialized back. * tests/Makefile.am: Add the new test input to the distribution. 2013-05-02 Dodji Seketeli Initial support of class templates * src/abg-ir.cc (class_template_decl::class_template_decl) (class_template_decl::set_pattern) (class_template_decl::operator==) (class_template_decl::~class_template_decl) (class_template_decl_hash::operator()) (class_tmpl_shared_ptr_hash::operator()): New definitions. * src/abg-ir.h (class class_template_decl, struct class_tmpl_shared_ptr_hash, struct class_tmpl_shared_ptr_hash): New declarations. * src/abg-reader.cc (read_context::const_class_tmpl_map_it): New typedef. (read_context::get_fn_tmpl_decl): Fix comment. (read_context::{get_class_tmpl_decl,key_class_tmpl_decl}) (build_class_template_decl, handle_class_template_decl): New definitions. (read_context::m_class_tmpl_map): New member. (handle_element): Support "class-template-decl" xml elements nodes. (build_class_decl): Add missing bits to comment. (build_function_template_decl): Fix spacing. * src/abg-writer.cc (class_tmpl_shared_ptr_map): New typedef. (write_context::m_class_tmpl_map): New member. (write_context::get_id_for_class_tmpl, write_class_template_decl): New definitions. (write_template_parameters): Factorize this this out from ... (write_function_template_decl): ... here. (write_decl): Support writing instances of class_template_decl. Fix spacing. * tests/data/test-read-write/test15.xml: New test input. * tests/Makefile.am: Add the new test15.xml input to the distribution. * tests/test-read-write.cc (in_out_specs): Add the new test15.xml test to the list of serialized output to be de-serialized and serialized back. 2013-05-02 Dodji Seketeli Fix function_tempalte_decl init & hashing * src/abg-ir.cc (function_template_decl::operator==): Compare the patterns, not a pointer to them. (function_template_decl_hash::operator()): Don't try to hash null patterns. * src/abg-ir.h (function_template_decl::function_template_decl): Use function_template_decl::set_pattern to set the pattern here. 2013-04-30 Dodji Seketeli Support member function templates * src:abg-ir.h: Move template declarations before class class_decl, so that class_decl can have member templates. (class class_decl::member_function_template) (class_decl::add_member_function_template) (class_decl::{base_specs_type, member_types_type, data_members_types, member_functions_type, member_function_templates_type}): New declarations. * src/abg-ir.cc (class_decl::add_member_function_template) (class_decl::member_function_template_hash::operator()): New definitions. (class_decl_hash::operator()): Support hashing for member function templates. * src/abg-reader.cc (build_class_decl): Use the new class_decl::{member_types_type, data_members_type, member_functions_type, base_specs_type} types. Support member function templates. * src/abg-writer.cc (write_cdtor_const_static): New definition. (write_class_decl): Support member function templates. * tests/data/test-read-write/test14.xml: New input data. * tests/Makefile.am: Add it to the distribution. * tests/test-read-write.cc (InOutSpec int_out_specs): De-serialize the new test input file, serialize it back and diff both results. 2013-04-25 Dodji Seketeli Inheritance fix * src/abg-ir.h (class template_non_type_parameter): Make this inherit decl_base virtually. 2013-04-25 Dodji Seketeli Small comment fix * src/abg-ir.h (class template_decl): Fix comment. 2013-04-25 Dodji Seketeli Add some decl predicates * src/abg-ir.h (is_at_global_scope): Rename is_decl_at_global_scope into this. (is_at_class_scope, is_at_template_scope) (is_template_parameter, is_type) (is_template_parm_composition_type) (is_function_template_pattern, is_template_decl): New declarations. * src/abg-ir.cc (is_at_global_scope): Rename is_decl_at_global_scope into this. (is_at_class_scope, is_at_template_scope, is_template_parameter) (is_type, is_template_parm_composition_type) (is_function_template_pattern, is_template_decl): New definitions. * src/abg-reader.cc (update_depth_info_of_read_context): Use the new is_at_class_scope decl. 2013-04-25 Dodji Seketeli Support composing template type parameters * src/abg-ir.h (class tmpl_parm_type_composition): New declaration. * src/abg-ir.cc (tmpl_parm_type_composition::tmpl_parm_type_composition) (tmpl_parm_type_composition::~tmpl_parm_type_composition): New definitions. * src/abg-reader.cc (build_tmpl_parm_type_composition): New function. (build_template_parameter): Support template parameter type composition. * src/abg-writer.cc (write_tmpl_parm_type_composition): New function. (write_template_non_type_parameter): Fix type-id attribute. (write_template_parameter): Support template parameter type composition. * tests/data/test-read-write/test13.xml: New test input. * tests/Makefile.am: Add it to the distribution. * tests/test-read-write.cc (InOutSpec in_out_spec): Add test13.xml to the list of xml file that are de-serialized and serialized back. 2013-04-24 Dodji Seketeli Fix depth management during the parsing * src/abg-ir.cc (decl_base_hash::operator()): Don't hash the context for decls in general. * src/abg-reader.cc (read_context::push_decl_to_current_scope) (read_context::push_and_key_type_decl): Add an overload that takes a node and update_depth_info boolean. (build_var_decl, build_type_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_enum_type_decl, build_type_decl) (build_template_type_parameter, build_template_non_type_parameter) (build_template_template_parameter, build_template_parameter) (build_type): Make these functions take an update_depth_info parameter. Pass it do read_context::push_and_key_type_decl or read_context::push_decl_to_current_scope rather than call update_read_context. (build_function_decl, build_class_decl) (build_function_template_decl): Change the seen_by_reader parameter into update_depth_info. Pass the update_depth_info bool to read_context::push_decl_to_current_scope rather than call update_depth_info here. (handle_class, handle_function_template_decl): Adjust. * tests/data/test-read-write/test12.xml: Add new test input. * tests/test-read-write.cc (InOutSpec in_out_specs): Add it to the list of input to de-serialize, serialize back and compare the two. * tests/Makefile.am: Add the new test input to the distribution. 2013-04-23 Dodji Seketeli Initial support for function templates * src/abg-ir.h (function_decl::set_return_type): New inline definition. (class template_decl, struct template_decl_hash, class template_parameter, struct template_parameter_hash, struct dynamic_template_parameter_hash, struct template_parameter_shared_ptr_hash, class template_type_parameter) (struct template_type_parameter_hash, class template_non_type_parameter, struct template_non_type_parameter_hash, class template_template_parameter, struct template_template_parameter_hash, class function_template_decl) (struct function_template_decl_hash, struct fn_tmpl_shared_ptr_hash): New declarations. * src/abg-ir.cc (dynamic_type_hash::operator()): Add hashing for template template, and template type parameters. (template_decl_hash::operator, template_decl::~template_decl) (template_decl::operator==, template_parameter::operator==) (template_parameter_hash::operator()) (dynamic_template_parameter_hash::operator()) (template_type_parameter::operator==) (template_type_parameter::~template_type_parameter) (template_type_parameter_hash::operator()) (template_non_type_parameter::operator==) (template_non_type_parameter::~template_non_type_parameter) (template_non_type_parameter_hash::operator()) (template_template_parameter::operator==) (template_template_parameter::~template_template_parameter) (template_template_parameter_hash::operator()) (function_template_decl::operator==) (function_template_decl_hash::operator()) (fn_tmpl_shared_ptr_hash::operator()) (function_template_decl::~function_template_decl()): New definitions. * src/abg-reader.cc (read_context::get_fn_tmpl_decl) (read_context::key_fn_tmpl_decl): New functions. (read_context::m_fn_tmpl_map): New data member. (read_context::key_type_decl): Renamed read_context::add_type_decl into this. (read_context::push_decl_to_current_scope): Renamed read_context::finish_decl_creation into this. Add an assert. (read_context::push_and_key_type_decl): Renamed read_context::finish_type_decl_creation into this. Adjust to the use of push_decl_to_current_scope and key_type_decl. (build_function_template_decl, build_template_type_parameter) (build_template_non_type_parameter) (build_template_template_parameter, build_template_parameter) (handle_function_template_decl): New functions. (handle_element): Call handle_function_template_decl. (build_function_decl): Take a bool parameter to update depth information in parsing context. Move instantiation of function_decl before parsing its xml sub-nodes. Update the depth info in the parsing context if necessary. Push the newly intantiated decl to scope. And then parse the sub nodes. Do not forget to add the fn parameters and return type using function_decl::add_parameter and function_decl::set_return_type. (build_var_decl, build_type_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_enum_type_decl, build_typedef_decl, handled_type_decl) (handle_qualified_type_decl, handle_pointer_type_def) (handle_reference_type_def, handle_enum_type_decl) (handle_typedef_decl, handle_var_decl, handle_function_decl) (handle_class_decl): Adjust. (build_class_decl): Take a bool parameter to update depth information in parsing context. Add comment. Wait for the class members to be built, before keying (and thus hashing it) the class. (build_type): Fix logic, and adjust. * src/abg-writer.cc (write_context::type_has_existing_id) (write_context::get_id_for_fn_tmpl, write_template_type_parameter) (write_template_non_type_parameter) (write_template_template_parameter, write_template_parameter) (write_function_template_decl): New functions. (write_context::get_id_for_type): Simplify logic. (write_decl): Support writing function template. * tests/data/test-read-write/test11.xml: New test input. * tests/test-read-write.cc (InoutSpec in_out_specs[]): De-serialize the new test11.xml test, serialize it back and diff output and input. * tests/Makefile.am: Add test11.xml to the distribution. 2013-04-23 Dodji Seketeli Mangled name of a scope_decl is its name * src/abg-ir.h (scope_decl::scope_decl): The mangled name is the name. 2013-04-23 Dodji Seketeli Update scope when adding class members * src/abg-ir.h (class_decl::add_member_type) (class_decl::add_data_member, class_decl::add_member_function): Move the inline implementation of these functions ... * src:abg-ir.cc (class_decl::add_member_type) (class_decl::add_data_member, class_decl::add_member_function): ... here. Augment their implementation to properly update the scope of the member. 2013-04-23 Dodji Seketeli Rename class_decl::member_type::get_type into as_type * src/abg-ir.h (class_decl::member_type::get_type): Rename this into class_decl::member_type::as_type. * src/abg-writer.cc (write_class_decl): Adjust. 2013-04-23 Dodji Seketeli Avoid having multiple sub-objects of base classes * src/abg-ir.cc (decl_base::decl_base): Remove useless definition. (type_base::type_base): Remove default arguments from parameters. (scope_type_decl::scope_type_decl) (namespace_decl::namespace_decl): Call the constructors for the virtual bases explicitly. * src/abg-ir.h (class scope_decl): Perform virtual inheritance of decl_base. (global_scope::global_scope): Call virtual base decl_base's constructor directly. (class type_decl): Inherit from decl_base and type_base virtually. (class scope_type_decl): Inherit from type_base virtually. (class qualified_type_def, pointer_type_def, reference_type_def) (class enum_type_decl, typedef_decl): Inherit from type_base and decl_base virtually. (class var_decl, function_decl): Inherit from decl_base virtually. (class class_decl::member): Don't inherit from anything and adjust constructor's mem-initializer accordingly. (class class_decl::member_type): Inherit from decl_base virtually and adjust constructor's mem-initializer accordingly. (class_decl::{data_member::data_member,member_function::member_function) (class_decl::class_decl): Call virtual base's constructor explicitly. 2013-04-22 Dodji Seketeli Move inline hashing functions out of line * src/abg-ir.h (decl_base_hash::operator()) (type_base_hash::operator(), type_decl_hash::operator()) (scope_type_decl_hash::operator()) (qualified_type_def_hash::operator()) (pointer_type_def_hash::operator()) (reference_type_def_hash::operator()) (enum_type_decl_hash::operator(), typedef_decl_hash::operator()) (var_decl_hash::operator(), function_decl_hash::operator()) (class_decl::member_type_hash::operator()) (class_decl::base_spec_hash::operator()) (class_decl::data_member_hash::operator()) (class_decl::member_function_hash::operator()): Move these inline definition ... * src/abg-ir.cc: ... here. 2013-04-22 Dodji Seketeli Various style nit fixes * src/abg-ir.cc: Move the emacs mode specifier for the file to the top of the file, otherwise, it's not effective. (struct location_manager::priv): Add end of struct comment. (class_decl_hash::operator()): Add fn comment. * src/abg-ir.h: Move the emacs mode specifier for the file to the top of the file, otherwise, it's not effective. (class scope_decl): Add end of class comment. * src/abg-reader.cc: Move the emacs mode specifier for the file to the top of the file, otherwise, it's not effective. (read_context::{get_type_decl,add_type_decl): Add comment. (handle_namespace_decl): Fix indent. * src/abg-writer.cc: Move the emacs mode specifier for the file to the top of the file, otherwise, it's not effective. 2013-04-12 Dodji Seketeli Remove .gitignore from VCS * .gitignore: Remove from revision control as different programmers might want to ignore different things. 2013-04-08 Benjamin Kosnik Add license * src/abg-*: Add license. * tests/test-*: Same. 2013-04-11 Dodji Seketeli Initial Support for class declarations * src/abg-ir.h (scope_decl::scope_decl) (scope_type_decl::scope_type_decl): Don't set mangled name for scope_decl instances as it doesn't make sense. (var_decl::var_decl): Pass the type shared pointer by value. (struct var_decl_hash, function_decl::parameter::operator==) (struct function_decl::parameter_hash, function_decl::operator==) (struct function_decl_hash, class class_decl, struct class_decl_hash): New declarations. * src/abg-ir.cc (scope_type_decl::scope_type_decl): Don't set the mangled name. It doesn't make sense for scope_decls. (dynamic_type_hash::operator): Fix comment. Run the hashing for scope_type_decl instances *after* running it for class_decl instance, otherwise, the class_decl instances case will never get hit. (var_decl::var_decl): Pass the type shared pointer by value. (function_decl::operator==, class_decl::operator==) (class_decl_hash::operator()): New fns. * src/abg-libxml-utils.h (get_xml_node_depth): Declare new fn. (XML_READER_GET_ATTRIBUTE): Fix comment. (XML_NODE_GET_ATTRIBUTE): New getter macro. * src/abg-libxml-utils.cc (get_xml_node_depth): New definition. * src/abg-reader.cc (update_read_context) (update_depth_info_of_read_context, read_visibility, read_binding) (read_access, read_size_and_alignment, read_static) (read_var_offset_in_bits, read_cdtor_const, build_function_decl) ( build_var_decl, build_type_decl, build_qualified_type_decl) (build_pointer_type_def, build_reference_type_def) (build_enum_type_decl, build_typedef_decl, build_class_decl) (build_type, handle_class_decl): New functions or overloads. (handle_element): Update to handle "class-decl" xml elements. * src/abg-writer.cc (write_size_and_alignment, write_access) (write_class, do_indent_to_level, get_indent_to_level): New fns. (write_decl): Update to serialize instances of class_decl. (write_type_decl, write_pointer_type_def) (write_reference_type_def): Use the new write_size_and_alignment instead of writing the attributes directly. * tests/data/test-read-write/test10.xml: New test file. * tests/Makefile.am: Add tests/data/test-read-write/test10.xml to the build system. * tests/test-read-write.cc (in_out_spec): De-serialize data/test-read-write/test10.xml, serialize it back into output/test-read-write/test10.xml, and compare the two output that should be identical. 2013-04-11 Dodji Seketeli Update enum decl representation as per the schema * src/abg-reader.cc (handle_enum_type_decl): The name of the element holding the underlying type is now "underlying-type", no more "base". * src/abg-writer.cc (write_enum_type_decl): Likewise. * tests/data/test-read-write/test6.xml: Likewise. 2013-04-10 Dodji Seketeli Add tests/data/test-read-write/test9.xml * tests/data/test-read-write/test9.xml: (Forgot to) Add this new test file. 2013-04-04 Dodji Seketeli Support function declarations * src/abg-ir.h (class function_decl): New declaration & inline definitions. * src/abg-ir.cc (function_decl::~function_decl): New definition. * src/abg-reader.cc (read_location): New overload to read location from an xmlNodePtr. (build_function_parameter, handle_function_decl): New definitions. (handle_element): Support "function-decl" elements. * src/abg-writer.cc (write_location): New overload to write a location directly, not from a decl. (write_function_decl): New definition. (write_binding): Support writing the binding attribute from a function_decl instance. (write_decl): support serializing function * tests/data/test-read-write/test9.xml: New test input file. * tests/Makefile.am: Add data/test-read-write/test9.xml to the build system. * tests/test-read-write.cc: De-serialize data/test-read-write/test9.xml, serialize it back and diff the output from the input. 2013-04-03 Dodji Seketeli Update in-vcs configure and docs/Makefile.in to recent configure * configure: Updated as re-generated by autoconf 2.69. * doc/Makefile.in: Updated as re-generated by automake 1.12.2. 2013-04-02 Benjamin Kosnik Add doc dir. Add Doxgen api generation rules. * doc: Add. * doc/Makefile.am (html, install-html): Add. * doc/Makefile.in: Add. * doc/api/libabigail.doxy: Add doxygen config. * src/abg-*: Add @file markup. 2013-04-03 Dodji Seketeli Introduce/use translation_unit & global_scope types * abg-corpus.h (abi_corpus::{get_decls, get_loc_mgr}): Remove. (abi_corpus::add): New function to add a translation unit. (abi_corpus::get_translation_units): New declaration. * abg-corpus.cc (abi_corpus::*): Remove all the definitions of abi_corpus for now, as the abi_corpus type is not used anymore -- for now at least. * src/abg-ir.h (add_decl_to_scope, get_global_scope) (get_translation_unit, is_global_scope, is_decl_at_global_scope) (class translation_unit, class global_scope): New declarations * src/abg-ir.cc (translation_unit::translation_unit) (translation_unit::get_global_scope) (translation_unit::get_loc_mgr, translation_unit::get_loc_mgr) (translation_unit::is_empty, get_global_scope) (get_translation_unit, is_global_scope, is_global_scope) (is_decl_at_global_scope, global_scope::~global_scope): New definitions. (scope_decl::scope_decl, scope_decl::scope_decl) (scope_decl::add_member_decl, scope_decl::get_member_decls): Move to abg-ir.h, inline. * src/abg-reader.h (read_file): Don't use abi_corpus in the api. Rather, use translation_unit. * src/abg-reader.cc (read_context::get_cur_scope): Now that we have a specific instance of global_scope to represent global scope, don't play games with empty scopes to detect a global scope. (read_context::get_translation_unit): New definition. (read_context::finish_decl_creation, finish_type_decl_creation): (read_input, read_file, read_location, handle_element) (handle_type_decl) (handle_namespace_decl, handle_qualified_type_decl) (handle_pointer_type_def, handle_reference_type_def) (handle_enum_type_decl, handle_typedef_decl, handle_var_decl): Don't use abi_corpus anymore. Rather, the translation unit a decl belongs to is accessible from the decl itself. * src/abg-writer.h (write_to_ostream): Use translation_unit in this API, rather than abi_corpus. * src/abg-writer.cc (write_translation_unit): Rename write_corpus into this. And stop using abi_corpus here. (write_to_ostream, write_corpus, write_location, write_decl) (write_type_decl, write_namespace_decl, write_qualified_type_def) (write_pointer_type_def, write_reference_type_def) (write_enum_type_decl, write_typedef_decl, write_var_decl): Stop using abi_corpus. Use the translation_unit that is accessible from the decl being serialized, if need be. * test-read-write.cc (main): De-serialize the input into an instance of translation_unit, not an abi_corpus anymore, and serialize that translation_unit. 2013-04-02 Dodji Seketeli Support var decl & mangled_name attributes * src/abg-ir.h (decl_base::binding, decl_base::get_mangled_name) (decl_base::set_mangled_name, decl_base::m_mangled_name): New declarations. (scope_decl::scope_decl: type_decl::type_decl) (scope_type_decl::scope_type_decl, typedef_decl::typedef_decl): Initialize mangled_name. (namespace_decl::namespace_decl): Initialize visibility. (class var_decl): New declaration. * src/abg-ir.cc (decl_base::decl_base, scope_decl::scope_decl) (type_decl::type_decl, scope_type_decl::scope_type_decl): Initialize mangled name. (namespace_decl::namespace_decl): Initialize visibility. (qualified_type_def::qualified_type_def) (pointer_type_def::pointer_type_def) (reference_type_def::reference_type_def): By default, set the visibility to the same as for the underlying type. (enum_type_decl::enum_type_decl, typedef_decl::typedef_decl): Initialize mangled name. (var_decl::var_decl, var_decl::operator==, var_decl::~var_decl): New definitions. * src/abg-reader.cc (read_visibility, read_binding, handle_var_decl): New definitions. (read_file): Handle var-decl elements. * src/abg-writer.cc (write_location): Rename write_decl_location into this. (write_var_decl, write_visibility, write_binding): New definitions. (write_decl, write_type_decl, write_qualified_type_def) (write_pointer_type_def, write_reference_type_def) (write_enum_type_decl, write_typedef_decl): Adjust to use write_location. * tests/data/test-read-write/test8.xml: New test input. * tests/test-read-write.cc: De-serialize the above and serialize it back and ensure both are equal. * tests/Makefile.am: add tests/data/test-read-write/test8.xml to the distribution. 2013-04-02 Dodji Seketeli Don't forget to init context & visibility in decl_base * src/abg-ir.cc (decl_base::decl_base): Initialize context and visibility on all the overloads of the constructor. 2013-03-31 Dodji Seketeli Fix some style * src/abg-ir.h (decl_base::get_scope): Really re-style. 2013-03-31 Dodji Seketeli Fix some style * src/abg-ir.h (decl_base::{get_location, set_location, get_name, set_name}): Re-style. 2013-03-31 Dodji Seketeli Basic support for type/decl visibility * src/abg-ir.h (enum decl_base::visibility) (decl_base::get_visibility, decl_base::set_visibility) (decl_base::m_visibility): New. (decl_base::decl_base, scope_decl::scope_decl) (type_decl::type_decl, enum_type_decl::enum_type_decl) (typedef_decl::typedef_decl): Pass visibility. * src/abg-ir.cc (decl_base::decl_base, scope_decl::scope_decl) (type_decl::type_decl, enum_type_decl::enum_type_decl) (typedef_decl::typedef_decl): Pass visibility. (qualified_type_def::qualified_type_def) (pointer_type_def::pointer_type_def) (reference_type_def::reference_type_def): Initialize visibility. 2013-03-31 Dodji Seketeli A type/decl shouldn't hold a reference on its scope * src/abg-ir.h (decl_base::m_context): Make this a naked pointer. (decl_base::set_scope, add_decl_to_scope): Pass the scope as a naked pointer. * src/abg-ir.cc (decl_base::decl_base): Initialize the context to 0. (decl_base::set_scope, add_decl_to_scope): Pass the scope as a naked pointer. * src/abg-reader.cc (read_context::get_cur_scope): Return a naked pointer. (handle_namespace_decl): Adjust accordingly. 2013-03-30 Dodji Seketeli Support typedef declarations * src/abg-ir.cc (dynamic_type_hash::operator()): Handle hashing of a pointer to an instance of typedef_decl. (typedef_decl::typedef_decl, typedef_decl::operator==) (typedef_decl::operator==, typedef_decl::get_underlying_type) (typedef_decl::~typedef_decl): New definitions. * src/abg-ir.h (class typedef_decl, struct typedef_decl_hash): New declarations. * src/abg-reader.cc (handle_typedef_decl): New definition. (handle_element): Handle de-serialization of typedef-decl element. * src/abg-writer.cc (write_typedef_decl): New definition. (write_decl): Handle serialization of an instance of typedef_decl. * tests/data/test-read-write/test7.xml: New test. * tests/Makefile.am: Add it to the distribution. * tests/test-read-write.cc: De-serialize the content of the new test, serialize it back and diff both. 2013-03-30 Dodji Seketeli Remove useless static_cast from hashing code * src/abg-ir.h (scope_type_decl_hash::operator()) (qualified_type_def_hash::operator()) (pointer_type_def_hash::operator()) (reference_type_def_hash::operator()): Remove useless static_cast. 2013-03-30 Dodji Seketeli Simplify equality operators * src/abg-ir.cc (qualified_type_def::operator==) (pointer_type_def::operator==, reference_type_def::operator==) (enum_type_decl::operator==): Simplify the code by safely assuming the underlying type is non-null. 2013-03-30 Dodji Seketeli Support enum type declarations * src/abg-ir.h (class enum_type_decl, struct enum_type_decl_hash): New declarations. * src/abg-ir.cc (dynamic_type_hash::operator()): Add hashing support for enum_type_decl. (enum_type_decl::enum_type_decl) (enum_type_decl::get_underlying_type) (enum_type_decl::get_enumerators, enum_type_decl::~enum_type_decl) (enum_type_decl::operator==): New definitions. * src/abg-reader.cc (handle_enum_type_decl): New definition. (handle_element): Handle "enum-decl" element. * src/abg-writer.cc (write_enum_type_decl): New. (write_decl): Add support to serialize enum_type_decl. * tests/test-read-write.cc: De-serialize and serialize data/test-read-write/test6.xml back. * tests/data/test-read-write/test6.xml: New test input. * tests/Makefile.am: Add it to the distribution. 2013-03-30 Dodji Seketeli Fix reference-type-def serialization * tests/test-read-write.cc: Really de-serialize and then serialize back data/test-read-write/test5.xml, not test4.xml. Sigh. * src/abg-writer.cc (write_reference_type_def): As a result of really trying to serialize reference type definitions fix the serialization code here. 2013-03-29 Dodji Seketeli Support reference types * src/abg-ir.h (class reference_type_def, struct pointer_type_def) (struct reference_type_def): New declaration. (type_base_hash::operator(), type_decl_hash::operator()) (scope_type_decl_hash::operator()) (qualified_type_def_hash::operator()): Include the typeid name in the hash. * src/abg-ir.cc (reference_type_def::reference_type_def) (reference_type_def::operator==) (reference_type_def::get_pointed_to_type) (reference_type_def::is_lvalue) (reference_type_def::~reference_type_def): New definitions. (dynamic_type_hash::operator): Hash pointer_type_def and reference_type_def instances. * src/abg-reader.cc (read_context::finish_decl_creation) (read_context::finish_type_decl_creation) (handle_reference_type_def): New definitions. (read_file): Handle "reference-type-def" elements. (handle_type_decl, handle_namespace_decl) (handle_qualified_type_decl, handle_pointer_type_def): Use the new read_context::finish_type_decl_creation or read_context::finish_decl_creation. * src/abg-writer.cc (write_reference_type_def): New definition. (write_decl): Supporting writing a pointer to an instance of reference_type_def. * tests/data/test-read-write/test5.xml: New test file. * tests/test-read-write.cc: (De)Serialize it. * tests/Makefile.am: Add it to the build system. 2013-03-28 Dodji Seketeli Support pointer types & Fix IR types equality * src/abg-ir.h (location::{operator==, operator<}) (decl_base::operator==, scope_decl::operator==) (type_base::operator==, struct type_shared_ptr_equal) (type_decl::operator==, scope_type::operator==) (qualified_type_def::operator==, class pointer_type_def): New declarations.. * src/abg-ir.cc (decl_base::operator==, scope_decl::operator==) (type_base::operator==, type_decl::operator==) (scope_type_decl::operator==, namespace_decl::operator==) (qualified_type_def::operator==) (pointer_type_def::pointer_type_def, pointer_type_def::operator==) (pointer_type_def::get_pointed_to_type) (pointer_type_def::~pointer_type_def): New definitions. * src/abg-reader.cc (handle_pointer_type_def): New definition. (read_input): Handle pointer-type-def elements. * src/abg-writer.cc (type_shared_ptr_map): Make this map use the use type_shared_ptr_equal predicate. (write_pointer_type_def): New definition. (write_decl): Improve logic. Support serializing a pointer to pointer_type_def. * tests/data/test-read-write/test4.xml: New test input file. * tests/Makefile.am: Add tests/data/test-read-write/test4.xml to the build system. * tests/test-read-write.cc: (De)serialize the new test file. 2013-03-27 Dodji Seketeli Support qualified types & Misc ancillary fixes * src/abg-ir.h (struct type_base_hash, struct dynamic_type_hash) (struct type_shared_ptr_hash, struct scope_type_decl_hash, class qualified_type_def, struct qualified_type_def_hash): New. (decl_base_hash::operator()): Constify. Don't crash if the scope of the decl we are hashing is null. (class type_decl): Add comment at the end. (type_decl_hash::operator()): Constify. Reuse the new type_base_hash hasher. (class namespace_decl): Add comment. * src/abg-ir.cc (qualified_type_def::qualified_type_def) (qualified_type_def::~qualified_type_def) (qualified_type_def::get_cv_quals) (qualified_type_def::set_cv_quals) (qualified_type_def::get_underlying_type) (dynamic_type_hash::operator()): New function definitions. * src/abg-reader.cc (handle_qualified_type_decl): New. (read_file): Handle elements named "qualified-type-def". (read::context::add_type_decl): Assert that the type being associated to the unique ID is non-null. (handle_type_decl): Fix this in the process; don't crash if some attributes are not present. Associate the unique id present in the xml document with the type we just parsed. (handle_namespace_decl): Add some comments. Don't crash if the name attribute is not present. * src/abg-writer.cc (write_context::get_id_for_type) (write_context::m_type_id_map, write_decl_location) (write_qualified_type_def): New. (write_decl): Handle instances of qualified_type_def. (write_type_decl): Use the new write_decl_location and write_context::get_id_for_type. * tests/data/test-read-write/test0.xml: Update id format since we are now using the new write_context::get_id_for_type to generate it. * tests/data/test-read-write/test1.xml: Likewise. * tests/data/test-read-write/test2.xml: Likewise. * tests/data/test-read-write/test3.xml: New test. * tests/test-read-write.cc: Test De-serializing tests/data/test-read-write/test3.xml and serializing it back. Also don't bail out if we fail on one input. * tests/Makefile.am: Add tests/data/test-read-write/test3.xml to the distribution. 2013-03-27 Benjamin Kosnik Various autotool adjustments * configure: Add. * configure.ac (AM_INIT_AUTOMAKE): Use gcc versions. (PKG_CHECK_MODULES): Re-use libjava/classpath solution, naming. * m4/pkg.m4: Add, take from classpath. * src/Makefile.am: Adjust names. 2013-03-26 Dodji Seketeli Remove the 'm_kind' member from the IR * src/abg-ir.{h,cc}: Remove use of the m_kind field. We are using full blown rtti so this uselessly just clutter the code. 2013-03-26 Dodji Seketeli Fix parallel build * tests/Makefile.am: Remove useless absolute reference to the current directory. 2013-03-26 Dodji Seketeli Fix depth handling during the parsing * src/abg-reader.cc (read_context::get_cur_scope): Remove useless const overload. Don't make this rely on m_cur_scope. Rather, use the path to the current decl (from the root element) to compute the cur scope. (read_context::m_cur_scope, read_context::set_cur_scope): Remove these. (update_read_context): Re-think logic. * tests/data/test-read-write/test2.xml: Add new test input. * tests/Makefile.am: Add data/test-read-write/test2.xml to the distribution. * tests/test-read-write.cc: Add data/test-read-write/test2.xml to the harness. 2013-03-25 Dodji Seketeli Debug read-write of a type-decl in a namespace-decl * abg-ir.{h,cc} (decl_base::decl_base, scope_decl::scope_decl) (type_decl::type_decl, namespace_decl::namespace_decl): Do not append a decl to its context from within its constructor. It's better doing that in a function that takes shared_ptrs to decl and context. That way we avoid memory management havoc. (decl_base::set_scope): New private function. (scope_decl::add_member_decl): Make this private. (add_decl_to_scope): New function, friend of decl_base and scope_decl. * abg-reader.cc (read_context::get_cur_scope): Add a non-const overload. (handle_type_decl, handle_namespace_decl): Use add_decl_to_scope. Adjust to new type_decl and namespace_decl constructor signature. * src/abg-writer.cc (write_type): Emit 'id', not 'xml:id'. (write_namespace_decl): Emit "namespace-decl", not "namespace-decl-name", as the name of namespace element. * tests/Makefile.am (test0.xml): Rename input0.xml into this. (test1.xml): New test input. * tests/data/test-read-write/test0.xml: Update to use 'id' as id attribute, rather than xml:id. * tests/data/test-read-write/test1.xml: New test. * test-read-write.cc (struct InOutSpec): New (main): Reorganize to give a list of input files to read and to write to an output file, have the test read the input files, write them, and diff the two. 2013-03-22 Dodji Seketeli Update tests/data/test-read-write/input0.xml * tests/data/test-read-write/input0.xml: Make this identical to how it would look like when serialized. 2013-03-22 Dodji Seketeli Debug type-decl serialization * src/abg-writer.cc (do_indent): New function. (write_corpus&): Use do_indent. Don't forget to close the abi-instr tag. (write_type_decl): Use do_indent. Handle null decls pointers. Emit the id at the end of the element. (write_namespace_decl): Use do_indent. Handle null decls pointers. * tests/test-utils.{h,cc} (get_src_dir,get_build_dir): Constify the returned reference to string. (is_dir, ensure_dir_path_created, ensure_parent_dir_created): New function definitions. * tests/test-read-write.cc (main): Augment the test to serialize the corpus too. 2013-03-21 Dodji Seketeli Debugged type-decl de-serialization * src/abg-ir.cc (namespace_decl::~namespace_decl): Add this missing virtual constructor definition. * src/abg-reader.cc (read_context::{get_cur_decl,pop_decl}): Return a null pointer when the decls stack is empty. (update_read_context): Don't try to de-reference a NULL cur_decl. (read_input): Don't try to poke at file validity here. What was I thinking. Really test for advance_cursor to return 1, expressing success. * src/abg-reader.h (read_file): Fix style. * Makefile.am: Add tests sub-directory. * configure.ac: Build with debugging-friendly options if the ABIGAIL_DEBUG env variable is set. Generate tests/Makefile. * tests/Makefile.am: New file. * tests/test-read-write.cc: Likewise. * tests/test-utils.{h,cc}: Likewise. * tests/data/test-read-write/input0.xml: Likewise. 2013-03-21 Dodji Seketeli Initial implementation of serialization of basic types and namespaces. * src/Makefile.am: Add abg-writer.{h,cc} and abg-config.{h,cc}. * src/abg-config.{h,cc}: New files. * src/abg-corpus.h (abi_corpus::decls_type): New typedef. (abi_corpus::{add,get_decls,get_loc_mgr}): Fix style. (abi_corpus::is_empty): Declare new function. * src/abg-corpus.cc (abi_corpus::add): really add the declaration to the corpus. (abi_corpus::is_empty): Define new function. * src/abg-ir.{h,cc} (location_manager::expand_location): Consti-fy this function. * src/abg-reader.cc (read_file): Add a corpus parameter. * src/abg-serialize.cc: Delete this file. * src/abg-writer.h (write_to_ostream): Rename write into this. Make it take a corpus and an ostream as parameters. * abg-writer.cc: New file. 2013-03-08 Dodji Seketeli Parse type-decl and namespace-decl elements * configure.ac: Add libxml2 dependencies. * src/abg-corpus.{h,cc}: New files. * src/abg-hash.{h,cc}: Likewise. * src/abg-libxml-utils.{h,cc}: Likewise. * src/abg-reader.{h,cc}: Likewise. * src/abg-serialize.{h,cc}: Likewise. * src/abg-writer.h: Likewise. * src/Makefile.am: Build the new files above. * src/abg-ir.h (class location): Add public accessors for the value, and a truth operator. Make the methods be inline. (class decl_base): Renamed decl into this. Renamed what_decl_kind into what_kind. Renamed get_context into get_scope. Add virtual destructor, accessors for location and name. (class {scope_decl, type_base, type_decl} ): Add virtual dtor. Re-style. (struct {decl_base_hash, type_decl_hash}): New hashing functors. (class {scope_type_decl, namespace_decl}): Add virtual dtor. * src/abg-ir.cc (location::*): Remove location definitions. There are now inline in the header. (class decl_base): Renamed decl into this. Remove most of the definitions from here as their are now inline in the header. (scope_decl::~scope_decl, type_base::~type_base) (type_decl::~type_decl, scope_type_decl::~scope_type_decl): New definitions. 2013-03-04 Dodji Seketeli Updated hierarchy up to namespace_decl * src/abg-ir.h (location): Make the default ctor public. (class decl): Declare data member and proper constructors. Make the context be a shared_ptr. Add a kind data member to avoid RTTI for now. (class scope_decl): Added protected constructor to handle the kind data member. (class type_base): Add data members proper and clean the iface up. (class type_decl, scope_type_decl, namespace_decl): Iron out constructors. * src/abg-ir.cc (class location): Fix style. (class decl, scope_decl, type_base, type_decl, scope_type_decl) (namespace_decl): Define these types. 2013-03-01 Dodji Seketeli Add missing autoconfiscation files into version control * config.guess: Added to VCS. * config.sub: Likewise. * depcomp: Likewise. * install-sh: Likewise. * ltmain.sh: Likewise. * missing: Likewise 2013-03-01 Dodji Seketeli Upload m4 file * m4/: Import this directory into version control. 2013-03-01 Dodji Seketeli Create and expand locations * src/abg-ir.h (class {location, location_manager, decl, scoped_decl, type_base, type_decl, scope_type_decl): Declare new types. * src/abg-ir.cc (class {location, location_manager}): Define new types. 2013-03-01 Dodji Seketeli Adjust src/Makefile.am after some file rename * src/Makefile.am: Update build system for renaming files from abgl-* into abg-*. 2013-03-01 Dodji Seketeli Update the README file * README: Update. 2013-02-28 Dodji Seketeli Initial AUTHORS and README * AUTHORS: * README: 2013-02-28 Dodji Seketeli Leave license stuff for later * COPYING: 2013-02-28 Dodji Seketeli Initial import Abigail * AUTHORS: * COPYING: * ChangeLog: * INSTALL: * Makefile.am: * NEWS: * README: * config.h.in: * configure.ac: * src/Makefile.am: * src/abg-ir.cc: * src/abg-ir.h: