On RHEL 6, make distcheck was trying to compile the C++ files that are
in tests/data. Having a dedicated tests/data Makefile.am which only
put the data files into an EXTRA_DIST variable fixes that.
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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:#️⃣:operator()): Hash the
enclosing template parameter. Avoid infinite recursion due to the
loop hash parameter -> hash template -> hash parameter.
(template_decl:#️⃣: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, }:#️⃣: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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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:#️⃣:operator)
(class_decl::base_spec:#️⃣:operator)
(type_composition:#️⃣: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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* configure.ac(AM_INIT_AUTOMAKE): Set the subdir-object option
here ..
* src/Makefile.am: ... not here.
* tests/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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<var_decl> rather than a bool.
(is_data_member): New overload that takes a shared_ptr<decl_base>.
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tests/data/test-alt-dwarf-file/test0-debug-dir/.build-id/16/7088580c513b439c9ed95fe6a8b29496495f26.debug:
Make this link be relative.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
ABGBZ#17193
* 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.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>