mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-22 16:56:57 +00:00
The Git repository of the Libabigail Project
Consider the following construct: struct foo { long x; long y; }; Then change one of the types (but keep the size the same): struct foo { long x; unsigned long y; }; If I abidiff this with no suppressions, I get: [C] 'struct foo' changed: type size hasn't changed 1 data member change: type of 'long int y' changed: type name changed from 'long int' to 'unsigned long int' type size hasn't changed However, it seems like if I add any struct suppression involving data member insertions, it filters out the change. For example: [suppress_type] type_kind = struct has_data_member_inserted_at = offset_of(not_present) The "not_present" member isn't in "struct foo", so I would expect the diff to still be emitted, but it is not: Functions changes summary: 0 Removed, 0 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable Unreachable types summary: 0 removed, 0 changed (1 filtered out), 0 added type This is because during the evaluation of the "has_data_member_inserted_at" property, we fail to take into account that if no data member got inserted, evaluation of the "has_data_member_inserted_at" predicate is falsified, and thus, the type suppression is falsified. While looking at this, I also realized that when a data member replaces another one, we fail to consider that change as a data member insertion and so the evaluation of the "has_data_member_inserted_at" predicate is wrongly falsified. This patch fixes these two related issues. * include/abg-comparison.h (class_or_union_diff::changed_data_members): Declare new accessor. function. * src/abg-comparison.cc (class_or_union_diff::changed_data_members): Define new accessor. function. * src/abg-suppression.cc (type_suppression::suppresses_diff): If the type suppression specification contains a has_data_member_inserted_* property and yet the class contains no data member inserted or replacing an existing one, then the type suppression is falsified in the context of the current change. Also, when a data member replaces an existing one, consider that as an insertion for which the has_data_member_inserted_* predicate should be evaluated. Stop considering deleted data members because considering replaced data member is really what we meant. * tests/data/test-diff-suppr/test-has-data-member-inserted-at-2-report.[1-3].txt: New reference test output files. * tests/data/test-diff-suppr/test-has-data-member-inserted-at-2-report.txt: Likewise. * tests/data/test-diff-suppr/test-has-data-member-inserted-at-{2,3}-v{0,1}.o: New input test binaries. * tests/data/test-diff-suppr/test-has-data-member-inserted-at-{2,3}-v{0,1}.c: Source code of the new input test binaries. * tests/data/test-diff-suppr/test-has-data-member-inserted-at-2.2.suppr: New input test suppression specification. * tests/data/test-diff-suppr/test-has-data-member-inserted-at-2.suppr: Likewise. * tests/data/Makefile.am: Add the new test material above to source distribution. * tests/test-diff-suppr.cc (in_out_specs): Add the test input above to this test harness. Signed-off-by: Dodji Seketeli <dodji@redhat.com> Tested-by: John Moon <quic_johmoo@quicinc.com> |
||
---|---|---|
.github | ||
autoconf-archive | ||
bash-completion | ||
doc | ||
docker | ||
include | ||
m4 | ||
relicensing-scripts | ||
scripts | ||
src | ||
tests | ||
tools | ||
.clang-format | ||
.gitignore | ||
.mailmap | ||
abigail.m4 | ||
ABIXML-FORMAT-VERSIONS | ||
AUTHORS | ||
ChangeLog | ||
COMMIT-LOG-GUIDELINES | ||
COMPILING | ||
configure.ac | ||
CONTRIBUTING | ||
default.abignore | ||
gen-changelog.py | ||
install-sh | ||
libabigail.pc.in | ||
license-change-2020.txt | ||
LICENSE.txt | ||
ltmain.sh | ||
Makefile.am | ||
NEWS | ||
README | ||
README-DOCKER.md | ||
release-text-template.txt | ||
update-copyright.sh | ||
VISIBILITY |
This is the Application Binary Interface Generic Analysis and Instrumentation Library. It aims at constructing, manipulating, serializing and de-serializing ABI-relevant artifacts. The set of artifacts that we are intersted is made of quantities like types, variable, functions and declarations of a given library or program. For a given library or program this set of quantities is called an ABI corpus. This library aims at (among other things) providing a way to compare two ABI Corpora (apparently the plural of corpus is copora, heh, that's cool), provide detailed information about their differences, and help build tools to infer interesting conclusions about these differences. You are welcome to contribute to this project after reading the files CONTRIBUTING and COMMIT-LOG-GUIDELINES files in the source tree. Communicating with the maintainers of this project -- including sending patches to be include to the source code -- happens via email at libabigail@sourceware.org.