The Git repository of the Libabigail Project
Go to file
Dodji Seketeli fb92e0a322 dwarf-reader,ir: Improve detection of method types & implicit parms
There is a confusion in the DWARF reader about static member functions
and non-static member functions.  With recent versions of DWARF, a
member function with the DW_AT_object_pointer attribute is known to
have a this-pointer and thus designates a non-static member function.
DWARF emitted by gcc 4.4.x and previous compiler didn't emit the
DW_AT_object_pointer so we need to look at the first parameter of the
member function, make sure it's artificial and pointers to a pointer
to the same class as the class of the current member function.

This patch avoids to confuse static and non-static member functions by
telling apart types of static member functions, non-static member
function and non member functions. This fixes the representation of
several method types and function declaration signatures across the
test suite.

	* include/abg-ir.h (method_type::get_is_for_static_method): Add
	new method.
	* src/abg-dwarf-reader.cc (fn_die_first_parameter_die)
	(member_fn_die_has_this_pointer, die_peel_typedef): Define new
	static functions.
	(die_this_pointer_is_const): Make this support DIEs representing
	const pointers.
	(die_function_type_is_method_type): Use the new
	member_fn_die_has_this_pointer function rather than (wrongly) open
	coding its functionality.  If the (member) function DIE has no
	this pointer DIE and if the function is at class scope, then we
	are looking a static member function.
	(finish_member_function_reading): Use the new
	method::get_is_for_static_method method rather than open-coding
	its functionality.
	* src/abg-ir.cc (method_type::get_is_for_static_method): Define
	new method.
	(type_topo_comp::operator()): In this comparison
	operator for types, if two method types have the same string
	representation then if one method type is for a static method,
	then make the non-static method type come first.
	(function_type::get_first_non_implicit_parm): The first parameter
	of a function can only carry the "this pointer" if it's
	artificial.
	* tests/data/test-abidiff-exit/PR31513/reported/PR31513-reported-report-1.txt:
	Adjust.
	* tests/data/test-abidiff/test-struct1-report.txt: Likewise.
	* tests/data/test-abidiff/test-struct1-v0.cc.bi: Likewise.
	* tests/data/test-abidiff/test-struct1-v1.cc.bi: Likewise.
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-diff-dwarf-abixml/PR25409-librte_bus_dpaa.so.20.0.abi:
	Likewise.
	* tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi:
	Likewise.
	* tests/data/test-diff-dwarf/test42-PR21296-clanggcc-report0.txt:
	Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt:
	Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
	Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt:
	Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test35-pr18754-no-added-syms-report-1.txt:
	Likewise.
	* tests/data/test-diff-filter/test41-report-0.txt: Likewise.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2024-05-06 18:32:41 +02:00
.github Adding missing newline to build-container workflow 2022-05-17 09:46:16 +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 doc/api/libabigail.doxy: Update to newer version. 2024-04-18 17:52:22 +02:00
docker Add github actions to support workflows 2022-05-17 00:13:40 +02:00
include dwarf-reader,ir: Improve detection of method types & implicit parms 2024-05-06 18:32:41 +02:00
m4 Delete ltsugar.m4 and pkg.m4 files from m4/ 2015-01-06 09:54:45 +01:00
patches Emit & read undefined interfaces to & from ABIXML 2024-03-14 16:27:14 +01:00
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 dwarf-reader,ir: Improve detection of method types & implicit parms 2024-05-06 18:32:41 +02:00
tests dwarf-reader,ir: Improve detection of method types & implicit parms 2024-05-06 18:32:41 +02:00
tools fedabipkgdiff: Cleanup output of ABI comparison 2024-04-29 17:04:22 +02:00
.clang-format Tweak clang-format configuration 2021-10-19 12:59:18 +02:00
.gitignore .gitignore: Add libabigail-?.* *.orig files 2019-05-22 14:34:23 +02:00
.mailmap Add '.mailmap' 2021-12-17 20:12:20 +01:00
abigail.m4 Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
ABIXML-FORMAT-VERSIONS Bug 28450 - Fix cloned member function handling in DWARF 2021-11-12 18:31:28 +01:00
AUTHORS Initial AUTHORS and README 2013-02-28 13:25:20 +01:00
ChangeLog ChangeLog: Update for 2.5 release 2024-04-18 12:18:06 +02:00
COMMIT-LOG-GUIDELINES Update the COMMIT-LOG-GUIDELINES file 2016-05-22 23:20:12 +02:00
COMPILING Improve some grammar 2022-02-25 11:24:20 +01:00
configure.ac configure,abidb: Make the libarchive python module optional for abidb 2024-04-26 16:12:51 +02:00
CONTRIBUTING Improve some grammar 2022-02-25 11:24:20 +01:00
default.abignore Bug 31646: Fix type suppression tactics for webkit2gtk3 2024-04-16 17:46:19 +02:00
gen-changelog.py gen-changelog.py: Remove long standing debugging output 2023-10-20 18:35:59 +02:00
install-sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
libabigail.pc.in Make libxml2 a private dependency wrt pkconfig 2013-08-22 17:41:29 +02:00
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 Use xz as the default tarball compression format 2022-11-18 13:06:09 +01:00
NEWS NEWS: Update for 2.5 release 2024-04-18 12:17:30 +02:00
README Improve some grammar 2022-02-25 11:24:20 +01:00
README-DOCKER.md Add github actions to support workflows 2022-05-17 00:13:40 +02:00
release-text-template.txt release-text-template.txt: Modernize a little bit. 2023-05-10 16:29:55 +02:00
update-copyright.sh Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
VISIBILITY Improve some grammar 2022-02-25 11:24:20 +01:00

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.