* src/abg-comparison.cc
(class_diff::ensure_lookup_tables_populated): Use the virtual
member functions here, not the member functions in general.
(compute_diff): Consider virtual member functions only, not
non-virtual ones.
* src/abg-ir.cc (class_decl::operator==): Do not compare
non-virtual member functions. Only compare virtual member
functions.
* tests/data/test-bidiff/test-struct1-report.txt: New test input.
* tests/data/test-diff-dwarf/test0-report.txt: New test input.
* tests/data/test-diff-filter/test0-report.txt: New test input.
* tests/data/test-diff-filter/test01-report.txt: New test input.
* tests/data/test-diff-filter/test10-report.txt: New test input.
* tests/data/test-diff-filter/test11-report.txt: New test input.
* tests/data/test-diff-filter/test2-report.txt: New test input.
* tests/data/test-diff-filter/test9-report.txt: New test input.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-fwd.h (get_data_member_offset): Declare new overload for
decl_base_sptr.
* include/abg-comparison.h (unsigned_decl_base_sptr_map)
(unsigned_changed_type_or_decl_map): New typedefs.
* src/abg-ir.cc (get_data_member_offset): Define new overload for decl_base_sptr.
* src/abg-comparison.cc (diff_kind::subtype_change_kind): New
enumerator for a change about a type or sub-type of a member of a
structure/enum.
(report_mem_header): Handle the new enumerator above.
(class_diff::priv::{deleted_dm_by_offset_, inserted_dm_by_offset_,
changed_dm_}): New data members.
(class_diff::priv::subtype_changed_dm_): Renamed
class_diff::priv::changed_data_members_ into this.
(class_diff::priv::subtype_changed_dm): Renamed
class_diff::priv::data_member_has_changed into this. Adjust.
(class_diff::count_filtered_subtype_changed_dm): Renamed
count_filtered_data_members into this. Adjust.
(class_diff::priv::count_filtered_changed_dm): New member
function.
(class_diff::lookup_tables_empty): Adjust.
(class_diff::ensure_lookup_tables_populated): Adjust. Detect when
a data member is deleted and added back to offset N, and be
prepared to present that as a change of data member at offset N.
(class_diff::report): Adjust. Report data members of a given
offset that have changed.
* tests/data/test-diff-dwarf/test6-report.txt: New reference
report for new test input.
* tests/data/test-diff-dwarf/test6-v0.cc: Source code for new test
input binary.
* tests/data/test-diff-dwarf/test6-v0.o: New test input binary.
* tests/data/test-diff-dwarf/test6-v1.cc: Source code for new test
input binary.
* tests/data/test-diff-dwarf/test6-v1.o: New test input binary.
* tests/test-diff-dwarf.cc: Adjust to include the new test inputs above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-ir.cc (compare_function_types): Compare return types,
unless this is a method and the return type is the same type as
the containing class type.
* tests/data/test-diff-dwarf/test5-report.txt: Reference report
for the comparison of the two input binaries below.
* tests/data/test-diff-dwarf/test5-v0.cc: Source code for the
input binary below.
* tests/data/test-diff-dwarf/test5-v0.o: Test input binary.
* tests/data/test-diff-dwarf/test5-v1.cc: Source code for the
input binary below.
* tests/data/test-diff-dwarf/test5-v1.o: Test input binary.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tests/data/test-diff-dwarf/test4-report.txt: Adjust.
* tests/test-diff-dwarf.cc: Run tests for
data/test-diff-dwarf/test3-report.txt" and
data/test-diff-dwarf/test4-report.txt.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.cc (report_size_and_alignment_changes): Split
this static function out of ...
(report_name_size_and_alignment_changes): ... this one.
(distinct_diff::report): If the typedef-stripped variants of the
diff subjects are of the same kind, display their diff.
Otherwise, tell explicitly is the distinct type diff involves a
type size change.
(distinct_diff::traverse): If the typedef-stripped variants of the
diff subjects are of the same kind, traverse that underlying diff
sub-tree and propagate the categorizing possibly resulting from
that traversal.
* tests/data/test-diff-dwarf/test4-v0.o: New test input binary.
* tests/data/test-diff-dwarf/test4-v0.cc: Source code for the
input binary above.
* tests/data/test-diff-dwarf/test4-v1.o: New test input binary.
* tests/data/test-diff-dwarf/test4-v1.cc: Source code for the
input binary above.
* tests/data/test-diff-dwarf/test4-report.txt: Reference report
for the difference between the two binaries above.
* tests/data/test-diff-filter/test5-v0.o: New test input binary.
* tests/data/test-diff-filter/test5-v0.cc: Source code for the
input binary above.
* tests/data/test-diff-filter/test5-v1.o: New test input binary.
* tests/data/test-diff-filter/test5-v1.cc: Source code for the
input binary above.
* tests/data/test-diff-filter/test5-report.txt: Reference report
for the difference between the two binaries above.
* tests/test-diff-filter.cc: Adjust to produce a filtered diff for
the two input binaries above.
* tests/Makefile.am: Adjust to add missing test files to the
distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.cc
(function_decl_diff::ensure_lookup_tables_populated): Function
parameters that are diff'ed start at the first non-implicit
parameter, not at the first parameter. Oops.
* tests/data/test-diff-dwarf/test3-v0.o: New test input binary.
* tests/data/test-diff-dwarf/test3-v0.cc: Source code for the
binary above.
* tests/data/test-diff-dwarf/test3-v1.o: New test input binary.
* tests/data/test-diff-dwarf/test3-v1.cc: Source code for the
binary above.
* tests/data/test-diff-dwarf/test3-report.txt: Reference report
for the diff of the new test inputs.
* tests/test-diff-dwarf.cc: Use the test inputs above to run new
tests.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.cc
(function_decl_diff::ensure_lookup_tables_populated): A parm
change is valid only when the added parm has a different name from
the removed parm. Both have the same index, of course. In that
case, do not try to remove the corresponding parm sub-type change.
* tests/data/test-bidiff/test-enum0-report.txt: Adjust.
* tests/data/test-bidiff/test-enum1-report.txt: Adjust.
* tests/data/test-bidiff/test-qual-type0-report.txt: Adjust.
* tests/data/test-bidiff/test-struct0-report.txt: Adjust.
* tests/data/test-diff-dwarf/test0-report.txt: Adjust.
* tests/data/test-diff-dwarf/test1-report.txt: Adjust.
* tests/data/test-diff-filter/test0-report.txt: Adjust.
* tests/data/test-diff-filter/test01-report.txt: Adjust.
* tests/data/test-diff-filter/test1-report.txt: Adjust.
* tests/data/test-diff-filter/test2-report.txt: Adjust.
* tests/data/test-diff-filter/test3-report.txt: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* include/abg-comparison.h (unsigned_changed_parm_map)
(unsigned_parm_map): New typedefs.
* src/abg-comparison.cc
(function_decl_diff::subtype_changed_parms): Renamed this from
changed_parms.
(function_decl_diff::priv::subtype_changed_parms_}): Renamed this
from changed_parms_;
(function_decl_diff::priv::{deleted_parms_by_id_,
added_parms_by_id_, changed_parms_by_id_}): New members.
(function_decl_diff::ensure_lookup_tables_populated): Update the
new priv::changed_parms_by_id_ member to contain the parameters
that got changed, as opposed to the subtype_changed_parms_ member
that contain parameters that got a sub-type change. The other
priv::*_by_id_ members are helpers for this. Update them too.
(function_decl_diff::subtype_changed_parms): Renamed this from
::changed_parms.
(function_decl_diff::report): Report separately about parameters
having a sub-type change, and parameters that got changed. Note
that in both cases, the change is necessarily to a compatible
type.
* data/test-diff-dwarf/test2-v0.cc: New test file.
* data/test-diff-dwarf/test2-v0.o: Likewise.
* data/test-diff-dwarf/test2-v1.cc: Likewise.
* data/test-diff-dwarf/test2-v1.o: Likewise.
* data/test-diff-dwarf/test2-report.txt: Likewise.
* tests/Makefile.am: Add the new test files above to the
distribution.
* tests/test-diff-dwarf.cc: Consume the input files above to
actually perform a regression test.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* src/abg-comparison.cc (represent): For member var_decls, add a
missing apostrophe after the access.
* tests/data/test-diff-dwarf/test0-report.txt: Update test report.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
* tests/test-diff-dwarf.cc: New dwarf diffing regression test
harness.
* tests/data/test-diff-dwarf/test0-report.txt: New test input.
* tests/data/test-diff-dwarf/test0-v0.cc: Likewise.
* tests/data/test-diff-dwarf/test0-v0.o: Likewise.
* tests/data/test-diff-dwarf/test0-v1.cc: Likewise.
* tests/data/test-diff-dwarf/test0-v1.o: Likewise.
* tests/Makefile.am: Add the new test inputs from
tests/test-diff-dwarf.cc and tests/data/test-diff-dwarf/* to
the build system.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>