* 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>
* 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-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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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-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>
* 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>
* 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: 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>