The Git repository of the Libabigail Project
Go to file
Dodji Seketeli 623391a040 Add --enable-debug-type-canonicalization to configure
This configure option adds the possibility to debug the type
canonicalization process specifically.

When this new configure option is turned on, in
ir::get_canonical_type_for, when the type T, candidate for
canonicalization is compared to a given canonical type C, the
comparison is done twice; once using structural equality and once
using canonical equality whenever it's possible.  For all the
sub-types of T and C, structural equality and canonical equality must
yield the same result.  Otherwise, an error message is emitted and the
process aborts.

This all happens when using the abidw program with the --enable-tc or
--enable-type-canonicalization option.

This has proven to be very helpful to detect type canonicalization issues.

For instance, here is a trace of canonicalization issue that was
detected thanks to this patch:

    $ build/tools/abidw --debug-tc /usr/lib64/libwiretap.so.11.0.8
    structural & canonical equality different for type: function type void (wtap*)
    in compare_types_during_canonicalization at: /home/dodji/git/libabigail/PR28364/src/abg-ir.cc:13575: execution should not have reached this point!
    Abandon (core dumped)

This means that right after canonicalizing the type "void (wtap*)",
structural and canonical equality yield different results.  So it
means there is a problem with that type specifically that makes its
canonicalization "go wrong".  This requires further debugging to
understand, but at least, we are super close to the root cause of the
canonicalization problem.

	* configure.ac: Support the new
	--enable-debug-type-canonicalization option.  Define macro
	WITH_DEBUG_TYPE_CANONICALIZATION accordingly.
	* doc/manuals/abidw.rst: Update documentation.
	* include/abg-ir.h
	(environment::debug_type_canonicalization_is_on): Declare new
	member function if WITH_DEBUG_TYPE_CANONICALIZATION is defined.
	* src/abg-ir-priv.h
	(environment::priv::{use_canonical_type_comparison_,
	debug_type_canonicalization_}): Define new data members if
	WITH_DEBUG_TYPE_CANONICALIZATION is defined.
	(environment::priv::priv): Initialize them.
	* src/abg-ir.cc (try_canonical_compare): When
	WITH_DEBUG_TYPE_CANONICALIZATION is defined, perform comparison
	using either structural or canonical equality depending on the
	environment::priv::use_canonical_type_comparison_ flag.
	(environment::debug_type_canonicalization_is_on): Define member
	function when WITH_DEBUG_TYPE_CANONICALIZATION is defined.
	(compare_types_during_canonicalization): Define new function.
	(type_base::get_canonical_type_for): Use the new function
	compare_types_during_canonicalization.
	* tools/abidw.cc (options::debug_type_canonicalization): Define
	new data member.
	(option::option): Initialize it.
	(display_usage): Add help string for --debug-tc.
	(parse_command_line): Support new option --debug-tc or
	--debug-type-canonicalization.
	(load_corpus_and_write_abixml): Turn type canonicalization
	debugging on if --enable-tc is provided.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-10-18 09:40:15 +02:00
autoconf-archive Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
bash-completion Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
doc Add --enable-debug-type-canonicalization to configure 2021-10-18 09:40:15 +02:00
include Add --enable-debug-type-canonicalization to configure 2021-10-18 09:40:15 +02:00
m4
relicensing-scripts Bug 27512 - Remove broken zip-archive support 2021-03-19 10:52:57 +01:00
scripts Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
src Add --enable-debug-type-canonicalization to configure 2021-10-18 09:40:15 +02:00
tests Bug 27086 - Consider all C++ virtual destructors when there are many 2021-09-23 17:28:26 +02:00
tools Add --enable-debug-type-canonicalization to configure 2021-10-18 09:40:15 +02:00
.clang-format clang-format: Minor correction to not break parameters on the first line 2021-04-01 09:51:20 +02:00
.gitignore .gitignore: Add libabigail-?.* *.orig files 2019-05-22 14:34:23 +02:00
abigail.m4 Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
AUTHORS
ChangeLog Update ChangeLog for 2.0 2021-10-04 10:58:23 +02:00
COMMIT-LOG-GUIDELINES
COMPILING Fix typo in COMPILING. 2020-02-03 13:49:54 +01:00
configure.ac Add --enable-debug-type-canonicalization to configure 2021-10-18 09:40:15 +02:00
CONTRIBUTING Use C++11 for the code base 2020-12-03 14:04:23 +01:00
default.abignore Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
gen-changelog.py Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
install-sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
libabigail.pc.in
license-change-2020.txt Add a license-change-2020.txt file 2020-12-02 11:50:22 +01:00
LICENSE.txt Add the LICENSE.txt file 2020-12-02 11:49:33 +01:00
ltmain.sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
Makefile.am Fix tarball upload directory 2021-10-04 16:06:43 +02:00
NEWS Update NEWS file for 2.0 2021-10-04 10:57:24 +02:00
README
release-text-template.txt Update the release text template after 1.0 2017-11-22 15:55:43 +01:00
update-copyright.sh Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
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, fonctions 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.