]> sourceware.org Git - libabigail.git/log
libabigail.git
10 years agoFix some restructured text doc glitches in the fn suppression manual
Dodji Seketeli [Sat, 1 Nov 2014 12:02:54 +0000 (13:02 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoCleanup the mainpage of the API doc
Dodji Seketeli [Sat, 1 Nov 2014 12:02:12 +0000 (13:02 +0100)]
Cleanup the mainpage of the API doc

* include/abg-fwd.h: Cleanup text of the API doc mainpage.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoMake get_binary_load_address static
Dodji Seketeli [Sat, 1 Nov 2014 12:01:14 +0000 (13:01 +0100)]
Make get_binary_load_address static

* src/abg-dwarf-reader.cc (get_binary_load_address): Make this
function static.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoInitial support for variable suppressions
Dodji Seketeli [Sat, 1 Nov 2014 10:55:14 +0000 (11:55 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoUpdate the suppr-doc.txt file for variable suppressions
Dodji Seketeli [Sat, 1 Nov 2014 10:28:44 +0000 (11:28 +0100)]
Update the suppr-doc.txt file for variable suppressions

* doc/suppr-doc.txt: Add the suppress_variable section example.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoMake var_diff and function_decl_diff extend decl_diff_base
Dodji Seketeli [Sat, 1 Nov 2014 10:50:10 +0000 (11:50 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFix logic of type suppression evaluation
Dodji Seketeli [Sat, 1 Nov 2014 10:46:26 +0000 (11:46 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoRemove useless functions from the comparison engine
Dodji Seketeli [Sat, 1 Nov 2014 10:31:11 +0000 (11:31 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoSpit and polish variables presentation in diff report
Dodji Seketeli [Sat, 1 Nov 2014 10:15:37 +0000 (11:15 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFix various apidoc typos
Dodji Seketeli [Sat, 1 Nov 2014 10:36:49 +0000 (11:36 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFix regexp escaping section of manual
Dodji Seketeli [Sat, 1 Nov 2014 10:27:25 +0000 (11:27 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDoxygen shouldn't extract doc for static functions or private types
Dodji Seketeli [Sat, 1 Nov 2014 10:11:42 +0000 (11:11 +0100)]
Doxygen shouldn't extract doc for static functions or private types

* doc/api/libabigail.doxy: Do not extract doc for static
functions, local classes.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoUpdate .gitignore
Dodji Seketeli [Sat, 1 Nov 2014 10:11:06 +0000 (11:11 +0100)]
Update .gitignore

* .gitignore: Ignore *~ emacs files.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoSeparate alias targets with a comma
Dodji Seketeli [Wed, 29 Oct 2014 21:56:08 +0000 (22:56 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFix a typo in the manual about function suppressions
Dodji Seketeli [Tue, 28 Oct 2014 17:16:33 +0000 (18:16 +0100)]
Fix a typo in the manual about function suppressions

* doc/manuals/libabigail-concepts.rst: Fix a typo.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoInitial support for function suppressions
Dodji Seketeli [Tue, 28 Oct 2014 10:32:15 +0000 (11:32 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAdd missing virtual destructor in comparison engine code
Dodji Seketeli [Tue, 28 Oct 2014 11:03:15 +0000 (12:03 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoPimplify abigail::ir::function_type
Dodji Seketeli [Mon, 27 Oct 2014 20:07:35 +0000 (21:07 +0100)]
Pimplify abigail::ir::function_type

* include/abg-ir.h (function_type::priv_): Declare new data
member.
(function_type::<all the methods>): 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::<all the methods>): Move the previously inline
methods of function_type here.  Adjust them to tap into priv_->*
to get the private data members.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoLight style fix
Dodji Seketeli [Mon, 27 Oct 2014 19:45:32 +0000 (20:45 +0100)]
Light style fix

* include/abg-ir.h (function_decl::get_type): Change the return
type from shared_ptr<function_type> to function_type_sptr.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAllow white spaces in ini file property values
Dodji Seketeli [Mon, 27 Oct 2014 19:40:33 +0000 (20:40 +0100)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFix typo in suppression specification manual
Dodji Seketeli [Mon, 27 Oct 2014 19:24:25 +0000 (20:24 +0100)]
Fix typo in suppression specification manual

* doc/manuals/libabigail-concepts.rst: Fix name -> name_regexp.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoSupport comparing symbols not referenced by debug info
Dodji Seketeli [Wed, 22 Oct 2014 16:05:31 +0000 (18:05 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAllow comparison of shared_ptr of things
Dodji Seketeli [Wed, 22 Oct 2014 09:51:27 +0000 (11:51 +0200)]
Allow comparison of shared_ptr of things

* include/abg-diff-utils.h: Adjust copyright years.
(deep_ptr_eq_functor::operator()(const shared_ptr<T>, const
shared_ptr<T>)): New comparison operator.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoUse the "standard" equality operator when comparing variables
Dodji Seketeli [Fri, 17 Oct 2014 15:30:44 +0000 (17:30 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoYet another fix to the DWARF method "static-ness" detection heuristic
Dodji Seketeli [Thu, 16 Oct 2014 21:32:08 +0000 (23:32 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAvoid infinite loops in the comparison code for classes
Dodji Seketeli [Thu, 16 Oct 2014 20:38:04 +0000 (22:38 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoUpdate the manual for the suppression specification initial work
Dodji Seketeli [Wed, 15 Oct 2014 20:32:56 +0000 (22:32 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoProperly propagate {REDUNDANT, SUPPRESSED}_CATEGORY wrt local changes
Dodji Seketeli [Mon, 13 Oct 2014 14:27:28 +0000 (16:27 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoGain ability know if a diff node has local changes
Dodji Seketeli [Mon, 13 Oct 2014 14:19:34 +0000 (16:19 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoWrite comparison functions that hint at the kind of changes they see
Dodji Seketeli [Mon, 13 Oct 2014 14:16:12 +0000 (16:16 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFix struct type kind suppression support
Dodji Seketeli [Mon, 22 Sep 2014 09:51:23 +0000 (11:51 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoReplace is_typedef by type_kind property in type suppressions
Dodji Seketeli [Mon, 22 Sep 2014 06:03:02 +0000 (08:03 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoInitial support for type suppressions
Dodji Seketeli [Fri, 19 Sep 2014 09:55:49 +0000 (11:55 +0200)]
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.

10 years agoMake all type diff types extend new type_diff_base type
Dodji Seketeli [Fri, 19 Sep 2014 09:01:00 +0000 (11:01 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoRename abigail::ini::config::section_vector to sections_type
Dodji Seketeli [Thu, 18 Sep 2014 16:24:51 +0000 (18:24 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoImplement the abigail::ini::config abstraction
Dodji Seketeli [Mon, 8 Sep 2014 10:15:09 +0000 (12:15 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoInitial support of ini-style file parsing
Dodji Seketeli [Fri, 5 Sep 2014 14:29:18 +0000 (16:29 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoInitial examples of suppression list specifications
Dodji Seketeli [Wed, 3 Sep 2014 10:22:06 +0000 (12:22 +0200)]
Initial examples of suppression list specifications

* doc/suppr-doc.txt: New file.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoPut IR artifacts in the abigail::ir namespace
Dodji Seketeli [Sat, 11 Oct 2014 09:27:59 +0000 (11:27 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoMisc style cleanups
Dodji Seketeli [Mon, 13 Oct 2014 14:33:16 +0000 (16:33 +0200)]
Misc style cleanups

* src/abg-comparison.cc: ({pointer_diff, reference_diff}::length):
Add some vertical spaces here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoconstify dm_context_rel::operator==
Dodji Seketeli [Mon, 13 Oct 2014 09:46:45 +0000 (11:46 +0200)]
constify dm_context_rel::operator==

* include/abg-ir.h (dm_context_rel::operator==): Make this const.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoA distinct_diff node has no children node
Dodji Seketeli [Mon, 13 Oct 2014 14:32:28 +0000 (16:32 +0200)]
A distinct_diff node has no children node

* src/abg-comparison.cc (distinct_diff::chain_into_hierarchy): Do
not append any children node here.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoRemove useless redundant_filter
Dodji Seketeli [Mon, 13 Oct 2014 09:37:04 +0000 (11:37 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoSort diff reports about function parameters by their indexes
Dodji Seketeli [Fri, 10 Oct 2014 15:03:53 +0000 (17:03 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDon't be too eager to use distinct_diff
Dodji Seketeli [Fri, 10 Oct 2014 14:59:17 +0000 (16:59 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoImplement generic diff tree walking and port categorization over it
Dodji Seketeli [Fri, 10 Oct 2014 11:15:40 +0000 (13:15 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoUpdate copyright notice for tests/test-diff2.cc
Dodji Seketeli [Fri, 10 Oct 2014 11:14:42 +0000 (13:14 +0200)]
Update copyright notice for tests/test-diff2.cc

* tests/test-diff2.cc: Update copyright year.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDo not crash on function_decl_diff for fns that have no symbol
Dodji Seketeli [Thu, 9 Oct 2014 13:27:42 +0000 (15:27 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAvoid broken output for virtual member fns w/o symbols
Dodji Seketeli [Thu, 9 Oct 2014 13:13:37 +0000 (15:13 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoSort added/removed/changed functions reported by the comparison engine
Dodji Seketeli [Thu, 2 Oct 2014 15:56:15 +0000 (17:56 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoMention virtual-ness of member function in their pretty representation
Dodji Seketeli [Thu, 2 Oct 2014 10:30:54 +0000 (12:30 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDo not crash when reporting diffs about virtual member fns that have no symbol
Dodji Seketeli [Thu, 2 Oct 2014 10:29:02 +0000 (12:29 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFixup member functions which virtual-ness has just been set
Dodji Seketeli [Thu, 2 Oct 2014 10:17:48 +0000 (12:17 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAssert that only decls with elf symbols are part of comparison
Dodji Seketeli [Thu, 2 Oct 2014 08:15:00 +0000 (10:15 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoEmit all virtual member functions in group
Dodji Seketeli [Thu, 2 Oct 2014 08:13:47 +0000 (10:13 +0200)]
Emit all virtual member functions in group

* src/abg-writer.cc (write_class_decl): Emit virtual member
functions contiguously.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAlways emit vtable offset for virtual member function
Dodji Seketeli [Thu, 2 Oct 2014 08:12:40 +0000 (10:12 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDo not forget priv_->in_pub_sym_tab_ when copying decl_base
Dodji Seketeli [Thu, 2 Oct 2014 08:10:45 +0000 (10:10 +0200)]
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_.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFix reading several clones of the same member function from DWARF
Dodji Seketeli [Wed, 1 Oct 2014 15:42:45 +0000 (17:42 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDo not crash when comparing functions that have no symbol
Dodji Seketeli [Wed, 1 Oct 2014 11:49:32 +0000 (13:49 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoRename member_function_is_virtual to get_member_function_is_virtual
Dodji Seketeli [Tue, 30 Sep 2014 16:16:03 +0000 (18:16 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFactorize a no-op deleter for shared pointer
Dodji Seketeli [Tue, 30 Sep 2014 16:04:14 +0000 (18:04 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoLink manuals from the main web page
Dodji Seketeli [Tue, 30 Sep 2014 15:53:35 +0000 (17:53 +0200)]
Link manuals from the main web page

* doc/website/mainpage.txt: Add a link to the manuals.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoInitial documentation for libabigail
Dodji Seketeli [Fri, 26 Sep 2014 15:02:46 +0000 (17:02 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDo not install the abisym program
Dodji Seketeli [Fri, 26 Sep 2014 14:14:18 +0000 (16:14 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoRename bi* tools to abi* tools
Dodji Seketeli [Fri, 26 Sep 2014 08:58:16 +0000 (10:58 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoLight cleanup in abg-corpus.cc
Dodji Seketeli [Fri, 19 Sep 2014 09:36:37 +0000 (11:36 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoPimplify abigail::comparison::diff type
Dodji Seketeli [Thu, 18 Sep 2014 13:43:03 +0000 (15:43 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoRename shared_ptr<regex_t> into regex_t_sptr
Dodji Seketeli [Thu, 18 Sep 2014 20:45:18 +0000 (22:45 +0200)]
Rename shared_ptr<regex_t> into regex_t_sptr

* include/abg-sptr-utils.h (build_sptr()): Rename the return type
from shared_ptr<regex_t> to regex_t_sptr.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFix a comment in abg-comparison.h
Dodji Seketeli [Fri, 19 Sep 2014 09:35:05 +0000 (11:35 +0200)]
Fix a comment in abg-comparison.h

* include/abg-comparison.h (class base_diff): Fix comment.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoLight style cleanup in tools/bidiff.cc
Dodji Seketeli [Fri, 5 Sep 2014 14:34:05 +0000 (16:34 +0200)]
Light style cleanup in tools/bidiff.cc

* tools/bidiff.cc (display_usage): Remove useless space before '&'.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agosrc/Makefile.am cleanup
Dodji Seketeli [Fri, 5 Sep 2014 14:33:27 +0000 (16:33 +0200)]
src/Makefile.am cleanup

* src/Makefile.am: Remove the unused 'headers' variable.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoEmit reports about not-yet categorized diff nodes
Dodji Seketeli [Tue, 16 Sep 2014 13:14:35 +0000 (15:14 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoBetter support for inline related diffs
Dodji Seketeli [Tue, 16 Sep 2014 12:53:30 +0000 (14:53 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoBetter support for enum diffs
Dodji Seketeli [Tue, 16 Sep 2014 11:40:35 +0000 (13:40 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAdd constness to elf_symbol::operator==
Dodji Seketeli [Tue, 16 Sep 2014 09:21:47 +0000 (11:21 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoMisc style cleanups
Dodji Seketeli [Mon, 15 Sep 2014 10:48:52 +0000 (12:48 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoConstify some function parameters in abg-comp-filter.cc
Dodji Seketeli [Mon, 15 Sep 2014 10:44:24 +0000 (12:44 +0200)]
Constify some function parameters in abg-comp-filter.cc

* src/abg-comp-filter.cc (type_size_changed): Now take const
          parameters.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAdd .gitignore files.
Jan Engelhardt [Tue, 9 Sep 2014 10:40:57 +0000 (12:40 +0200)]
Add .gitignore files.

* .gitignore: Add new file.
* m4/.gitignore: Likewise.
* tools/.gitignore: Likewise.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
10 years agoPlace -L/-l flags into *_LIBADD/*_LDADD
Jan Engelhardt [Tue, 9 Sep 2014 11:05:52 +0000 (13:05 +0200)]
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.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
10 years agoAdd libelf to libabigail.la's linker line
Jan Engelhardt [Tue, 9 Sep 2014 12:53:41 +0000 (14:53 +0200)]
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.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
10 years agoDrop hardcoded substitutions
Jan Engelhardt [Tue, 9 Sep 2014 11:04:45 +0000 (13:04 +0200)]
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@.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
10 years agoReplace indirect variable assignments
Jan Engelhardt [Tue, 9 Sep 2014 10:52:07 +0000 (12:52 +0200)]
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.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
10 years agoRemove empty and autogenerated files from git repository
Jan Engelhardt [Tue, 9 Sep 2014 10:48:39 +0000 (12:48 +0200)]
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.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
10 years agoSet automake options globally
Jan Engelhardt [Tue, 9 Sep 2014 10:48:02 +0000 (12:48 +0200)]
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.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
10 years agoStash some autogenerated tools in build-aux/
Jan Engelhardt [Tue, 9 Sep 2014 10:36:24 +0000 (12:36 +0200)]
Stash some autogenerated tools in build-aux/

* configure.ac: Reduce the pollution in the top-level directory a
bit.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
10 years agoFix memory leaks due to cycles in types ownership
Dodji Seketeli [Wed, 10 Sep 2014 15:09:47 +0000 (17:09 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoCompare class names when comparing methods
Dodji Seketeli [Wed, 10 Sep 2014 16:07:11 +0000 (18:07 +0200)]
Compare class names when comparing methods

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoSlight white space fix
Dodji Seketeli [Wed, 10 Sep 2014 16:07:33 +0000 (18:07 +0200)]
Slight white space fix

* src/abg-hash.cc (method_type::hash::operator()(const
method_type&)): White space fix.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoUpdate copyright notice
Dodji Seketeli [Wed, 10 Sep 2014 12:00:46 +0000 (14:00 +0200)]
Update copyright notice

* include/abg-ir.h: Update year of copyright notice.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoUnite help output for tools
Ondrej Oprala [Sat, 5 Jul 2014 20:17:01 +0000 (22:17 +0200)]
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.

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAdjust copyright year
Dodji Seketeli [Wed, 3 Sep 2014 07:25:54 +0000 (09:25 +0200)]
Adjust copyright year

* tests/test-diff-dwarf.cc: Adjust year in copyright notice.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoSort reported changed data members by increasing offset
Dodji Seketeli [Wed, 3 Sep 2014 06:46:58 +0000 (08:46 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDo not filter out diff nodes that are only in NOT_REDUNDANT_CATEGORY
Dodji Seketeli [Tue, 2 Sep 2014 22:13:46 +0000 (00:13 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoWhite space cleanup
Dodji Seketeli [Tue, 2 Sep 2014 22:05:31 +0000 (00:05 +0200)]
White space cleanup

* src/abg-ir.cc (get_data_member_offset): Remove useless
horizontal white space.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAdd some comments in the comparison engine
Dodji Seketeli [Tue, 2 Sep 2014 22:02:44 +0000 (00:02 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoRemove useless new line from comparison engine's report
Dodji Seketeli [Tue, 2 Sep 2014 21:50:20 +0000 (23:50 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoAdjust copyright years
Dodji Seketeli [Mon, 1 Sep 2014 13:15:47 +0000 (15:15 +0200)]
Adjust copyright years

* src/abg-corpus.cc: Adjust copyright years.
* src/abg-libzip-utils.cc: Likewise.
* src/abg-writer.cc: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoFactorize basic redundancy detection in diff report
Dodji Seketeli [Mon, 1 Sep 2014 13:04:37 +0000 (15:04 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoDisplay package configuration at the end of configure
Dodji Seketeli [Sun, 31 Aug 2014 09:17:03 +0000 (11:17 +0200)]
Display package configuration at the end of configure

* configure.ac: Display the configure of the package at the end of
the configure script.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
10 years agoMake zip archive support optional
Dodji Seketeli [Sun, 31 Aug 2014 08:34:11 +0000 (10:34 +0200)]
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.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This page took 0.086656 seconds and 5 git commands to generate.