Commit Graph

2858 Commits

Author SHA1 Message Date
Dodji Seketeli
f5c304427d Remove python3-mock dependency and use unittest.mock instead
As explained in
https://fedoraproject.org/wiki/Changes/RemovePythonMockUsage,
python-mock is now deprecated.  We ought to use mock from the python
standard library instead.

Maxwell G submitted a patch to libabigail's Fedora package in Rawhide
at 405c5046d8.

I am applying this patch inspired from his work here.

	* configure.ac: Do not require python-mock anymore.
	* tests/mockfedabipkgdiff.in: Use unittest.mock, not mock from
	python-mock.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2024-01-26 12:51:40 +01:00
Dodji Seketeli
1053262eee Bug 31279 - Acknowledge that opaque types are always decl-only
When handling a decl-only base class, add_or_update_class_type asserts
that we need to try to resolve the decl-only base class to its
definition.  That makes sense in most cases.

However, in cases where the base class is actually an opaque class
resulting from the use of the --header-dir{1,2} option of abidiff, the
opaque type is by definition a decl-only class artificially created
from a fully defined class.

When the opaque class is anonymous (later named by a typedef),
maybe_schedule_declaration_only_class_for_resolution schedules a
decl-only class named by the empty string for resolution to its
definition.  Later when add_or_update_class_type handles the decl-only
base class (now named by a typedef),
reader::is_decl_only_class_scheduled_for_resolution looks for the
typedef name; as the class scheduled for resolution by
maybe_schedule_declaration_only_class_for_resolution was then
anonymous, reader::is_decl_only_class_scheduled_for_resolution returns
false and the assert in add_or_update_class_type fails.  It's the
problem reported in this issue.  Oops.

When the opaqued decl-only type is anonymous,
maybe_schedule_declaration_only_{class,enum}_for_resolution must NOT
schedule it for resolution to its definition because the scheduled
types for resolution are designated by name.  This patch now enforces
that.

It just doesn't make sense to schedule an anonymous type for
resolution to its definition.  When the type is later named by a
typedef however, then it's scheduled for resolution to its definition,
as it's no more anonymous at that point.  The patch enforces that as
well.

The patch ends up making sure that add_or_update_class_type does /not/
assert that an /anonymous/ decl-only base class is scheduled for
resolution to its definition.

These changes should fix the problem reported at
https://sourceware.org/bugzilla/show_bug.cgi?id=31279.

	* src/abg-dwarf-reader.cc
	(reader::maybe_schedule_declaration_only_{class,enum}_for_resolution):
	Do not schedule anonymous decl-only types for resolution to their
	definition.
	(build_typedef_type): When an anonymous decl-only type has just
	been named by a typedef, schedule it for resolution to its
	definition.
	(add_or_update_class_type): Do not assert that /anonymous/
	decl-only types are scheduled for resolution to their definition.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2024-01-26 11:16:56 +01:00
Dodji Seketeli
2f038ab3d4 Bug 31236 - Fix removing a member declaration from its scope
In some C++ binaries, DWARF can represent a member variable using a
global variable /definition/ DIE not having a reference attribute
pointing back to the member variable declaration DIE.  The only way we
know that the global variable is a definition DIE for a member
variable is because its linkage name demangles to
"foo::bar::var_name", with foo::bar being a class name.

So, for each translation unit, when the DWARF reader reads a global
variable DIE, it builds a variable IR node for it and stashes it on
the side.

Then, when the translation unit is built, the DWARF reader looks at
all the stashed global variables, detects those that are actually
member variables and adds them to their class.  But then, before
adding a (former global) variable to its class, the reader has first
to remove it from its global scope.  This removal is done by the
function remove_decl_from_scope, which calls
scope_decl::remove_member_decl.

The issue here is that remove_decl_from_scope forgets to unset the
translation unit property of the global variable.

Then, in the particular case of this problem report, when
scope_decl::add_member_decl is called to add the variable to its
class, it detects that the variable belongs to /another/ translation
unit and (rightfully) aborts.  Ooops.

This patch fixes the issue by making remove_decl_from_scope remove the
variable from its translation unit too, not just from its scope.  The
patch actually delegates the scope & translation unit resetting to
scope_decl::remove_member_decl because it appears to me that this is
where these ought to be handled.

To ensure that the issue is fixed, one needs to unpack the package
webkit2gtk3-2.40.5-1.el9_3.1.x86_64.rpm and run abidw on the binary
$prefix/usr/lib64/libwebkit2gtk-4.0.so.37 like:

   $ abidw --noout $prefix/usr/lib64/libwebkit2gtk-4.0.so.37

Given the size of the library, this takes three hours and a half as
well as ~50GB of ram to complete on my system using a non-optimized
debug build of libabigail.  We definitely need to invest in more speed
optimizations to handle webkit.  That would be for another day, I
guess.

	* src/abg-ir.cc (scope_decl::remove_member_decl): Reset the
	translation unit and the scope of the removed decl.
	(remove_decl_from_scope): Do not reset the scope of the removed
	decl here as it's now done above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2024-01-16 09:38:37 +01:00
Mark Wielaard
cdd1113632 Recognize EM_RISCV in e_machine_to_string
Check that EM_RISCV is defined in elf.h and if it is then recognize
it in e_machine_to_string, producing "elf-riscv".

	* configure.ac: Defining HAVE_EM_RISCV_MACRO if EM_RISCV
	is defined in elf.h.
	* src/abg-dwarf-reader.cc (e_machine_to_string): Handle
	EM_RISCV if HAVE_EM_RISCV_MACRO is defined.

Signed-off-by: Mark Wielaard <mark@klomp.org>
2024-01-08 16:02:18 +01:00
Mark Wielaard
f16e4631c1 Fix ABG_ASSERT in build_ir_node_from_die for DW_TAG_member
When the die is a member, it is the CU of the die that should not be
in the C language, not the dwarf reader current translation unit.

	* src/abg-dwarf-reader.cc (build_ir_node_from_die): ABG_ASSERT
	!rdr.die_is_in_c(), not rdr.cur_transl_unit().

Signed-off-by: Mark Wielaard <mark@klomp.org>
2024-01-08 16:02:18 +01:00
Giuliano Procida
fba8af7d70 website: doxygen: set PROJECT_NAME to libabigail
This changes the project name from the default "My Project" to
"libabigail".

	* doc/website/libabigail-website.doxy: Set PROJECT_NAME to
	libabigail.

Signed-off-by: Giuliano Procida <gprocida@google.com>
2024-01-08 09:31:34 -05:00
Dodji Seketeli
2c6b109f50 Bump LIBABIGAIL_SO_CURRENT version to 4
Recent patches change the ABI of the library, namely, by adding
parameters to functions like is_pointer_type or adding virtual member
functions to classes in the IR.  Thus the LIBABIGAIL_SO_CURRENT
version has to be bumped from 3 to 4.

	* configure.ac: Set LIBABIGAIL_SO_CURRENT to 4.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-01 15:43:53 +01:00
Dodji Seketeli
bf6fae3a52 Bump abixml version to 2.3
An older version of libabigail won't be able to grok new abixml files
containing the recently added support for pointer-to-member types.

It's thus needed to bump the minor version number of the abixml
format.  The new version is thus 2.3.  As a result, this patch also
updates the version numbers shown in the various abixml files of the
test suite.

	* configure.ac: Bump ABIXML_VERSION_MINOR to 3.
	* tests/data/test-annotate/PR29443-missing-xx.o.annotated.abi:
	Adjust.
	* tests/data/test-annotate/libtest23.so.abi: Likewise
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise
	* tests/data/test-annotate/test-anonymous-members-0.o.abi:
	Likewise
	* tests/data/test-annotate/test-pointer-to-member-1.o.annotated.abi:
	Likewise
	* tests/data/test-annotate/test0.abi: Likewise
	* tests/data/test-annotate/test1.abi: Likewise
	* tests/data/test-annotate/test13-pr18894.so.abi: Likewise
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise
	* tests/data/test-annotate/test17-pr19027.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/test2.so.abi: Likewise
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise
	* tests/data/test-annotate/test3.so.abi: Likewise
	* tests/data/test-annotate/test4.so.abi: Likewise
	* tests/data/test-annotate/test5.o.abi: Likewise
	* tests/data/test-annotate/test6.so.abi: Likewise
	* tests/data/test-annotate/test7.so.abi: Likewise
	* tests/data/test-annotate/test8-qualified-this-pointer.so.abi:
	Likewise
	* tests/data/test-read-btf/test0.o.abi: Likewise
	* tests/data/test-read-btf/test1.o.abi: Likewise
	* tests/data/test-read-ctf/PR27700/test-PR27700.abi: Likewise
	* tests/data/test-read-ctf/test-PR26568-1.o.abi: Likewise
	* tests/data/test-read-ctf/test-PR26568-2.o.abi: Likewise
	* tests/data/test-read-ctf/test-alias.o.abi: Likewise
	* tests/data/test-read-ctf/test-ambiguous-struct-A.o.hash.abi:
	Likewise
	* tests/data/test-read-ctf/test-ambiguous-struct-B.o.hash.abi:
	Likewise
	* tests/data/test-read-ctf/test-anonymous-fields.o.abi: Likewise
	* tests/data/test-read-ctf/test-array-mdimension.abi: Likewise
	* tests/data/test-read-ctf/test-array-of-pointers.abi: Likewise
	* tests/data/test-read-ctf/test-array-size.abi: Likewise
	* tests/data/test-read-ctf/test-bitfield-enum.abi: Likewise
	* tests/data/test-read-ctf/test-bitfield.abi: Likewise
	* tests/data/test-read-ctf/test-callback.abi: Likewise
	* tests/data/test-read-ctf/test-callback2.abi: Likewise
	* tests/data/test-read-ctf/test-conflicting-type-syms-a.o.hash.abi:
	Likewise
	* tests/data/test-read-ctf/test-conflicting-type-syms-b.o.hash.abi:
	Likewise
	* tests/data/test-read-ctf/test-const-array.abi: Likewise
	* tests/data/test-read-ctf/test-dynamic-array.o.abi: Likewise
	* tests/data/test-read-ctf/test-enum-many.o.hash.abi: Likewise
	* tests/data/test-read-ctf/test-enum-symbol.o.hash.abi: Likewise
	* tests/data/test-read-ctf/test-enum.o.abi: Likewise
	* tests/data/test-read-ctf/test-fallback.abi: Likewise
	* tests/data/test-read-ctf/test-forward-type-decl.abi: Likewise
	* tests/data/test-read-ctf/test-functions-declaration.abi:
	Likewise
	* tests/data/test-read-ctf/test-linux-module.abi: Likewise
	* tests/data/test-read-ctf/test-list-struct.abi: Likewise
	* tests/data/test-read-ctf/test0.abi: Likewise
	* tests/data/test-read-ctf/test0.hash.abi: Likewise
	* tests/data/test-read-ctf/test1.so.abi: Likewise
	* tests/data/test-read-ctf/test1.so.hash.abi: Likewise
	* tests/data/test-read-ctf/test2.so.abi: Likewise
	* tests/data/test-read-ctf/test2.so.hash.abi: Likewise
	* tests/data/test-read-ctf/test3.so.abi: Likewise
	* tests/data/test-read-ctf/test3.so.hash.abi: Likewise
	* tests/data/test-read-ctf/test4.so.abi: Likewise
	* tests/data/test-read-ctf/test4.so.hash.abi: Likewise
	* tests/data/test-read-ctf/test5.o.abi: Likewise
	* tests/data/test-read-ctf/test7.o.abi: Likewise
	* tests/data/test-read-ctf/test8.o.abi: Likewise
	* tests/data/test-read-ctf/test9.o.abi: 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/PR24378-fn-is-not-scope.abi: Likewise
	* tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise
	* tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi:
	Likewise
	* tests/data/test-read-dwarf/PR26261/PR26261-exe.abi: Likewise
	* tests/data/test-read-dwarf/PR27700/test-PR27700.abi: Likewise
	* tests/data/test-read-dwarf/PR28584/PR28584-smv.clang.o.abi:
	Likewise
	* tests/data/test-read-dwarf/PR29443-missing-xx.o.abi: Likewise
	* tests/data/test-read-dwarf/PR29692-kdelibs3-libkjava.so.1.0.0.abi:
	Likewise
	* tests/data/test-read-dwarf/libtest23.so.abi: Likewise
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise
	* tests/data/test-read-dwarf/test-PR26568-1.o.abi: Likewise
	* tests/data/test-read-dwarf/test-PR26568-2.o.abi: Likewise
	* tests/data/test-read-dwarf/test-fallback.abi: Likewise
	* tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise
	* tests/data/test-read-dwarf/test-pointer-to-member-1.o.abi:
	Likewise
	* tests/data/test-read-dwarf/test-suppressed-alias.o.abi: Likewise
	* tests/data/test-read-dwarf/test0.abi: Likewise
	* tests/data/test-read-dwarf/test0.hash.abi: Likewise
	* tests/data/test-read-dwarf/test1.abi: Likewise
	* tests/data/test-read-dwarf/test1.hash.abi: Likewise
	* tests/data/test-read-dwarf/test10-pr18818-gcc.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/test13-pr18894.so.abi: Likewise
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise
	* tests/data/test-read-dwarf/test17-pr19027.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/test2.so.abi: Likewise
	* tests/data/test-read-dwarf/test2.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise
	* tests/data/test-read-dwarf/test3-alias-1.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test3-alias-2.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test3-alias-3.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test3-alias-4.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test3.so.abi: Likewise
	* tests/data/test-read-dwarf/test3.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test4.so.abi: Likewise
	* tests/data/test-read-dwarf/test4.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test5.o.abi: Likewise
	* tests/data/test-read-dwarf/test5.o.hash.abi: Likewise
	* tests/data/test-read-dwarf/test6.so.abi: Likewise
	* tests/data/test-read-dwarf/test6.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test7.so.abi: Likewise
	* tests/data/test-read-dwarf/test7.so.hash.abi: Likewise
	* tests/data/test-read-dwarf/test8-qualified-this-pointer.so.abi:
	Likewise
	* tests/data/test-read-dwarf/test8-qualified-this-pointer.so.hash.abi:
	Likewise
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise
	* tests/data/test-read-write/test-crc.xml: Likewise
	* tests/data/test-read-write/test26.xml: Likewise
	* tests/data/test-read-write/test27.xml: Likewise
	* tests/data/test-read-write/test28-without-std-fns-ref.xml:
	Likewise
	* tests/data/test-read-write/test28-without-std-vars-ref.xml:
	Likewise

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-01 15:43:53 +01:00
Dodji Seketeli
d4ca1088e4 Bug 30260 - Support pointer-to-member type
This adds support for C++ pointer-to-member types.

Here is a screenshot of what this patch enables libabigail to do:

    $ cat -n test-ptr-to-mbr-v0.cc
	 1	struct X
	 2	{
	 3	  void f(int);
	 4	  int a;
	 5	};
	 6
	 7	int X::* pmi = &X::a;
	 8	void (X::* pmf)(int) = &X::f;
	 9

    $ diff -u test-ptr-to-mbr-v0.cc test-ptr-to-mbr-v1.cc
    --- test-ptr-to-mbr-v0.cc	2023-11-22 15:22:04.258260701 +0100
    +++ test-ptr-to-mbr-v1.cc	2023-11-22 15:23:02.482621214 +0100
    @@ -1,9 +1,8 @@
     struct X
     {
    -  void f(int);
    -  int a;
    +  void f(int, char);
    +  char a;
     };

    -int X::* pmi = &X::a;
    -void (X::* pmf)(int) = &X::f;
    -
    +auto pmi = &X::a;
    +auto pmf = &X::f;

    $ abidiff test-ptr-to-mbr-v0.o test-ptr-to-mbr-v1.o
    Functions changes summary: 0 Removed, 0 Changed, 0 Added function
    Variables changes summary: 0 Removed, 2 Changed, 0 Added variables

    2 Changed variables:

      [C] 'void (X::* pmf)(int)' was changed to 'void (X::* pmf)(int, char)' at test-ptr-to-mbr-v1.cc:8:1:
	type of variable changed:
	  pointer-to-member type changed from: 'void (X::*)(int) to: 'void (X::*)(int, char)'
	  in containing type 'struct X' of pointed-to-member type 'void (X::*)(int)' at test-ptr-to-mbr-v1.cc:1:1:
	    type size changed from 32 to 8 (in bits)
	    1 data member change:
	      type of 'int a' changed:
		type name changed from 'int' to 'char'
		type size changed from 32 to 8 (in bits)

      [C] 'int X::* pmi' was changed to 'char X::* pmi' at test-ptr-to-mbr-v1.cc:7:1:
	type of variable changed:
	  pointer-to-member type changed from: 'int X::* to: 'char X::*'
	  in data member type 'int' of pointed-to-member type 'int X::*':
	    type name changed from 'int' to 'char'
	    type size changed from 32 to 8 (in bits)
	  containing type of pointer-to-member 'struct X' changed at test-ptr-to-mbr-v0.cc:1:1, as reported earlier

    $

	* include/abg-comparison.h (class ptr_to_mbr_diff): Declare new
	class.
	(ptr_to_mbr_diff_sptr): Declare new typedef.
	(compute_diff): Declare new overload for ptr_to_mbr_diff.
	(ptr_to_mbr_type_sptr): Declare new typedef.
	* src/abg-comparison-priv.h (struct ptr_to_mbr_diff::priv): Define
	* src/abg-comparison.cc (compute_diff_for_types): Support new
	ptr_to_mbr_type type.
	(ptr_to_mbr_diff::{ptr_to_mbr_diff, first_ptr_to_mbr_type,
	second_ptr_to_mbr_type, member_type_diff, containing_type_diff,
	has_changes, has_local_changes, get_pretty_representation, report,
	chain_into_hierarchy, ~ptr_to_mbr_diff}): Define member functions
	of class ptr_to_mbr_diff.
	(compute_diff): Define overload for ptr_to_mbr_type_sptr.
	* include/abg-fwd.h (ptr_to_mbr_type_sptr): Declare new typedef.
	(is_ptr_to_mbr_type, is_pointer_to_ptr_to_mbr_type)
	(is_typedef_of_maybe_qualified_class_or_union_type): Declare new
	functions.
	* include/abg-ir.h (type_maps::ptr_to_mbr_types): Declare new
	accessor.
	(POINTER_TO_MEMBER_TYPE): Add new enumerator to enum
	type_or_decl_base::type_or_decl_kind.
	(class ptr_to_mbr_type): Declare new class.
	(equals): Declare new overload for ptr_to_mbr_type.
	(ir_node_visitor::visit_{begin,end}): Declare new member
	functions.
	* src/abg-ir.cc (ptr_to_mbr_declaration_name)
	(ptr_to_mbr_declaration_name, add_outer_ptr_to_mbr_type_expr)
	(add_outer_pointer_to_ptr_to_mbr_type_expr): Define new static
	functions.
	(type_maps::priv::ptr_to_mbr_types_): Define new
	data member.
	(type_maps::ptr_to_mbr_types): Define new accessor.
	(is_ptr_to_mbr_type, is_pointer_to_ptr_to_mbr_type)
	(is_typedef_of_maybe_qualified_class_or_union_type): Define new
	functions.
	(maybe_update_types_lookup_map, equals): Define new overloads for
	ptr_to_mbr_type_sptr.
	(is_npaf_type): Use is_ptr_to_mbr_type.
	(maybe_update_types_lookup_map): In the overload for
	decl_base_sptr, call the new overload for ptr_to_mbr_type_sptr
	above.
	(struct ptr_to_mbr_type::priv): Define new struct.
	(ptr_to_mbr_type::{ptr_to_mbr_type, get_member_type,
	get_containing_type, operator==, get_qualified_name, traverse,
	~ptr_to_mbr_type}): Define member functions of ptr_to_mbr_type.
	(types_have_similar_structure): Support the new ptr_to_mbr_type
	type.
	(ir_node_visitor::visit_{begin,end}): Add new member functions.
	(var_decl::get_pretty_representation): Support pretty-printing
	pointer-to-member types.
	(pointer_declaration_name, array_declaration_name): Likewise.
	* include/abg-reporter.h ({reporter_base, default_reporter,
	leaf_reporter}::report): Add an overload for ptr_to_mbr_diff.
	(default_reporter::report_local_ptr_to_mbr_type_changes): Declare
	a member function.
	private data class of ptr_to_mbr_diff.
	* src/abg-default-reporter.cc
	(default_reporter::report_local_ptr_to_mbr_type_changes): Define
	member functions.
	(default_reporter::report): Define an overload for
	ptr_to_mbr_diff.
	* src/abg-leaf-reporter.cc (leaf_reporter::report): Likewise.
	* src/abg-dwarf-reader.cc (build_ptr_to_mbr_type): Define new
	function.
	(build_ir_node_from_die): Use the new build_ptr_to_mbr_type
	function.
	* src/abg-reader.cc (build_ptr_to_mbr_type): Define new function.
	(build_type): Use the new build_ptr_to_mbr_type above.
	* src/abg-writer.cc (write_ptr_to_mbr_type): Define new function.
	(write_type, write_decl, write_member_type): Use the new
	write_ptr_to_mbr_type above.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr1-output-1.txt:
	Add new test material.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr1-v0.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr1-v0.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr1-v1.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr1-v1.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr2-output-1.txt:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr2-v0.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr2-v0.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr2-v1.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr2-v1.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr3-output-1.txt:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr3-v0.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr3-v0.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr3-v1.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr3-v1.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr4-output-1.txt:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr4-v0.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr4-v0.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr4-v1.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr4-v1.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr5-output-1.txt:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr5-v0.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr5-v0.o:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr5-v1.cc:
	Likewise.
	* tests/data/test-abidiff-exit/pointer-to-member/test-ptr-to-mbr5-v1.o:
	Likewise.
	* tests/data/test-read-dwarf/test-pointer-to-member-1.cc:
	Likewise.
	* tests/data/test-read-dwarf/test-pointer-to-member-1.o: Likewise.
	* tests/data/test-read-dwarf/test-pointer-to-member-1.o.abi:
	Likewise.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-abidiff-exit.cc (in_out_specs): Add the test material
	above to this test harness.
	* tests/test-annotate.cc (in_out_specs): Likewise.
	* tests/test-read-dwarf.cc: Likewise.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Adjust.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-01 15:43:53 +01:00
Dodji Seketeli
19d4131964 Improve type naming
There are a number of glitches when pretty-printing type names.

This is particularly true for derived types like pointer to functions,
array of pointer to functions and the likes.

For instance, we can see in
tests/data/test-abidiff-exit/PR30048-test-2-report-1.txt that a
function N that takes no parameter and returns a pointer to an array
of 7 int is pretty-printed as:

    int[7]* N()

That obviously doesn't respect the type naming rules of C or C++.

With this patch, function N is declared as:

    int(*N(void))[7]

To learn more about the impact of the patch on how types are
pretty-printed, you can look at the parts of the patch that are
adjustments to the expected output of the regression tests.

For instance, here is how the expected output of type pretty-printing
in tests/data/test-abidiff-exit/PR30048-test-2 is modified by this
patch:

    diff --git a/tests/data/test-abidiff-exit/PR30048-test-2-report-1.txt b/tests/data/test-abidiff-exit/PR30048-test-2-report-1.txt
    index 2650b5a0..7bbbc2e2 100644
    --- a/tests/data/test-abidiff-exit/PR30048-test-2-report-1.txt
    +++ b/tests/data/test-abidiff-exit/PR30048-test-2-report-1.txt
    @@ -3,22 +3,22 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

     7 functions with some indirect sub-type change:

    -  [C] 'function int[7]* N()' at PR30048-test-2-v0.cc:62:1 has some indirect sub-type changes:
    +  [C] 'function int(*N(void))[7]' at PR30048-test-2-v0.cc:62:1 has some indirect sub-type changes:
	 return type changed:
    -      entity changed from 'int[7]*' to 'int'
    +      entity changed from 'int(*)[7]' to 'int'
	   type size changed from 64 to 32 (in bits)

    -  [C] 'function int* O()' at PR30048-test-2-v0.cc:64:1 has some indirect sub-type changes:
    +  [C] 'function int* O(void)' at PR30048-test-2-v0.cc:64:1 has some indirect sub-type changes:
	 return type changed:
	   entity changed from 'int*' to 'int'
	   type size changed from 64 to 32 (in bits)

    -  [C] 'function int ()* P()' at PR30048-test-2-v0.cc:67:1 has some indirect sub-type changes:
    +  [C] 'function int (*P(void))(void)' at PR30048-test-2-v0.cc:67:1 has some indirect sub-type changes:
	 return type changed:
    -      entity changed from 'int ()*' to 'int'
    +      entity changed from 'int (*)(void)' to 'int'
	   type size changed from 64 to 32 (in bits)

Note that the change to the CTF test
tests/data/test-read-ctf/test9.o.abi is triggered by a change in the
sorting of types because types are sorted alphabetically.

All in all, this is clearly an overdue improvement to the type name
pretty-printing.

	* include/abg-fwd.h (is_npaf_type, is_pointer_to_function_type)
	(is_pointer_to_array_type, is_pointer_to_npaf_type): Declare new
	functions.
	(is_pointer_type, is_reference_type, is_array_type): Take a
	boolean parameter to look through qualifiers.
	* include/abg-ir.h (is_pointer_type): Do not make this function a
	friend of the type_or_decl_base class anymore.
	* src/abg-ir.cc (pointer_declaration_name, array_declaration_name)
	(stream_pretty_representation_of_fn_parms)
	(add_outer_pointer_to_fn_type_expr)
	(add_outer_pointer_to_array_type_expr): Define new static
	functions.
	(is_npaf_type, is_pointer_to_function_type)
	(is_pointer_to_array_type, is_pointer_to_npaf_type): Define new
	functions.
	(get_type_representation): Remove the overload for array_type_def.
	(get_function_type_name, get_method_type_name)
	(function_decl::get_pretty_representation_of_declarator): Use the
	new stream_pretty_representation_of_fn_parms.  This actually
	factorizes parameters pretty-printing by reusing
	stream_pretty_representation_of_fn_parms.
	(is_pointer_type, is_reference_type, is_array_type): Take a
	boolean parameter to look through qualifiers.
	(is_void_pointer_type): Use const where it's due.
	(pointer_type_def::get_qualified_name): Use the new
	pointer_declaration_name in lieu of the old and removed
	get_name_of_pointer_to_type.
	(array_type_def::{get_pretty_representation, get_qualified_name}):
	Use the new array_declaration_name instead of the old and removed
	get_type_representation.
	(var_decl::get_pretty_representation): Use the new
	array_declaration_name and pointer_declaration_name.
	(function_decl::get_pretty_representation): Use the new
	add_outer_pointer_to_array_type_expr, and
	add_outer_pointer_to_array_type_expr function to support the
	proper syntax for function returning pointers and arrays.
	(function_decl::parameter::get_pretty_representation): Fix the
	pretty-printing of each function parameter.
	* tests/data/test-abicompat/test0-fn-changed-report-0.txt: Adjust.
	* tests/data/test-abicompat/test0-fn-changed-report-2.txt:
	Likewise.
	* tests/data/test-abicompat/test1-fn-removed-report-0.txt:
	Likewise.
	* tests/data/test-abicompat/test3-fn-removed-report-0.txt:
	Likewise.
	* tests/data/test-abidiff-exit/PR30048-test-2-report-1.txt: Likewise.
	* tests/data/test-abidiff-exit/PR30048-test-report-0.txt: Likewise.
	* tests/data/test-abidiff-exit/PR30329/PR30329-report-1.txt: Likewise.
	* tests/data/test-abidiff-exit/PR30503/libsdl/libsdl-1.2.60-1.2.64-report.txt: Likewise.
	* tests/data/test-abidiff-exit/ada-subrange/test1-ada-subrange/test1-ada-subrange-report-1.txt: Likewise.
	* tests/data/test-abidiff-exit/ada-subrange/test1-ada-subrange/test1-ada-subrange-report-2.txt: Likewise.
	* tests/data/test-abidiff-exit/qualifier-typedef-array-report-1.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test-fun-param-report.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test-ld-2.28-210.so--ld-2.28-211.so.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test-leaf-fun-type-report.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test-leaf-more-report.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test-leaf-peeling-report.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test-leaf-stats-report.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test-net-change-report0.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test-net-change-report2.txt:
	Likewise.
	* tests/data/test-abidiff-exit/test2-filtered-removed-fns-report0.txt:
	Likewise.
	* tests/data/test-abidiff/test-PR18791-report0.txt: Likewise.
	* tests/data/test-abidiff/test-crc-report-0-1.txt: Likewise.
	* tests/data/test-abidiff/test-crc-report-1-0.txt: Likewise.
	* tests/data/test-abidiff/test-crc-report-1-2.txt: Likewise.
	* tests/data/test-annotate/test13-pr18894.so.abi: Likewise.
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.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-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-annotate/test7.so.abi: Likewise.
	* tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test-23-diff-arch-report-0.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test18-alias-sym-report-0.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test19-soname-report-0.txt: Likewise.
	* tests/data/test-diff-dwarf/test24-added-fn-parms-report-0.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test32-fnptr-changes-report-0.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test33-fnref-changes-report-0.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test41-PR20476-hidden-report-0.txt:
	Likewise.
	* tests/data/test-diff-dwarf/test5-report.txt: Likewise.
	* tests/data/test-diff-filter/test-PR26739-2-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test26-qualified-redundant-node-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test26-qualified-redundant-node-report-1.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/test31-pr18535-libstdc++-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.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-diff-filter/test6-report.txt: Likewise.
	* tests/data/test-diff-filter/test7-report.txt: Likewise.
	* tests/data/test-diff-pkg/GtkAda-gl-2.24.2-29.fc29.x86_64--2.24.2-30.fc30.x86_64-report-0.txt:
	Likewise.
	* tests/data/test-diff-pkg/PR24690/PR24690-report-0.txt: Likewise.
	* tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt:
	Likewise.
	* tests/data/test-diff-pkg/libxcrypt-4.1.1-6.el8.x86_64--libxcrypt-compat-4.4.18-3.el9.x86_64-report-1.txt:
	Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt:
	Likewise.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt:
	Likewise.
	* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt:
	Likewise.
	* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt:
	Likewise.
	* tests/data/test-diff-pkg-ctf/gmp-6.x.x86_64-report-0.txt:
	Likewise.
	* tests/data/test-diff-pkg-ctf/test-rpm-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-3.txt:
	Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-7.txt:
	Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-2.txt:
	Likewise.
	* tests/data/test-diff-suppr/test15-suppr-added-fn-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-3.txt:
	Likewise.
	* tests/data/test-diff-suppr/test16-suppr-removed-fn-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test27-add-aliased-function-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test27-add-aliased-function-report-3.txt:
	Likewise.
	* tests/data/test-diff-suppr/test27-add-aliased-function-report-4.txt:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-report-0.txt:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-report-1.txt:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-report-2.txt:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-report-4.txt:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test30-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test32-report-0.txt: Likewise.
	* tests/data/test-diff-suppr/test32-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test44-suppr-sym-name-not-regexp-report-1.txt:
	Likewise.
	* tests/data/test-fedabipkgdiff/vte291-0.39.1-1.fc22.x86_64--vte291-0.39.90-1.fc22.x86_64-report-0.txt:
	Likewise.
	* tests/data/test-read-ctf/test9.o.abi: Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise.
	* tests/data/test-read-dwarf/test-libaaudio.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/test13-pr18894.so.abi: Likewise.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test7.so.abi: Likewise.
	* tests/data/test-read-dwarf/test7.so.hash.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-01 15:43:53 +01:00
Dodji Seketeli
d02fa5ca6d abilint: Alphabetically sort programs options
It's a mess to find an option you are looking for both in the manual
or when doing abilint --help.  So how about sorting the options of the
various libabigail programs, starting from abilint?  Here we go.

	* doc/manuals/abilint.rst: Alphabetically sort options in the
	manual.
	* tools/abilint.cc (display_usage): Likewise for the help strings.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-01 15:43:41 +01:00
Dodji Seketeli
ba094de49e abilint: Support --annotate
It turns out abilint doesn't support the "--annotate" option like
abidw does.  Annoying.  Added thus.

	* tools/abilint.cc (options::annotate): Define new data member.
	(options::options): Initialize.
	(display_usage): Add help string.
	(parse_command): Support the --annotate command options.
	(main): Set the annotate option on the context.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-01 15:43:33 +01:00
Dodji Seketeli
89ab39de78 suppression: Add "has_strict_flexible_array_data_member_conversion" property
In the past, it was common to have a "fake flex array" at the end of a
structure. Like this:

Nowadays, with improved compiler support, it's more common to use a real
flex array. As this is a common change which changes ABI representation
in a compatible way, we should have a suppression for it.

For example, if you have a change like this:

struct foo
{
  int x;
  int flex[1];
};

...

struct foo
{
  int x;
  int flex[];
};

abidiff reports:

  [C] 'struct foo' changed:
    type size changed from 64 to 32 (in bits)
    1 data member change:
      type of 'int flex[1]' changed:
        type name changed from 'int[1]' to 'int[]'
        array type size changed from 32 to 'unknown'
        array type subrange 1 changed length from 1 to 'unknown'

With a new has_strict_flexible_array_data_member_conversion property,
users can specify a suppression which stops abidiff from emitting
this diff for any "fake" flex arrays being converted to real ones:

[suppress_type]
  type_kind = struct
  has_size_change = true
  has_strict_flexible_array_data_member_conversion = true

	* include/abg-comp-filter.h (has_strict_fam_conversion): Declare
	new functions.
	* include/abg-fwd.h
	(ir::has_fake_flexible_array_data_member): Declare new accessor
	functions.
	* include/abg-suppression.h
	(type_suppression::{,set_}has_strict_fam_conversion): Declare new
	accessor functions.
	* src/abg-comp-filter.cc (has_strict_fam_conversion): Define new
	functions.
	* src/abg-ir.cc
	(ir::has_fake_flexible_array_data_member): Define new accessor
	functions.
	* src/abg-suppression-priv.h
	(type_suppression::priv::has_strict_fam_conv_): Define new
	data member.
	* src/abg-suppression.cc
	(type_suppression::{,set_}has_strict_fam_conversion): Define new
	accessor functions.
	(type_suppression::suppresses_diff): For a type suppression to
	match a fake flex array conversion, either the size of the type
	hasn't change or has_size_change must be true and then the type
	must change from a fake flex array to a real flex array.
	(read_type_suppression): Parse the new
	'has_strict_flexible_array_data_member_conversion' property to
	set the type_suppression::set_has_strict_fam_conversion property.
	* doc/manuals/libabigail-concepts.rst: Add an entry for the new
	'has_strict_flexible_array_data_member_conversion' property.
	* tests/data/test-diff-suppr/test-has-strict-flexible-array-data-member-conversion-{1,2}.suppr:
	Add new test suppression files.
	* tests/data/test-diff-suppr/test-has-strict-flexible-array-data-member-conversion-report-{1,2}.txt:
	Add new test reference output files.
	* tests/data/test-diff-suppr/test-has-strict-flexible-array-data-member-conversion-v{0,1}.c:
	Add source code for new binary test input files.
	* tests/data/test-diff-suppr/test-has-strict-flexible-array-data-member-conversion-v{0,1}.o:
	Add new binary test input files.
	* tests/data/Makefile.am: Add the new test files to the source
	distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Add the new test input
	files to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2023-11-15 09:55:08 +01:00
Dodji Seketeli
0d5149fcd2 Bug 31045 - Don't try setting translation unit for unique types
Unique types (void, pointer to void and variadic parameter types)
should not have their translation unit set whenever they are being
added to a scope.  This is because they are supposed to be created
independently from any translation unit, even if technically, they are
set to the translation unit they are referenced from, for the first
time.

To handle this, a new function maybe_set_translation_unit is created
to handle the setting of the translation unit for decls added to a
scope by scope_decl::{add,insert}_member_decl.  That new function
asserts that unique types should have their translation unit be set.

	* src/abg-ir.cc (maybe_set_translation_unit): Define new static
	function.
	(scope_decl::{add,insert}_member_decl): Use it.
	* tests/data/test-abidiff-exit/PR31045/zfs-abigail-2.4/libnvpair.{abi,so,suppr}:
	New test input files.
	* tests/data/test-abidiff-exit/PR31045/zfs-abigail-2.4/test-PR31045-report-1.txt:
	New reference test output.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-abidiff-exit.cc (in_out_specs): Add the input above
	to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Tested-by: Paolo Pisati <paolo.pisati@canonical.com>
2023-11-09 13:24:37 +01:00
Dodji Seketeli
ab395a56c5 configure: Bump development version to 2.5
* configure.ac: Bump version to 2.5

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-21 00:36:07 +02:00
Dodji Seketeli
067bb0f522 ChangeLog: Update for 2.4 release
* ChangeLog: Update automatically with make update-changelog.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-20 18:40:33 +02:00
Dodji Seketeli
f044d3caf4 Update NEWS file for 2.4 release
* NEWS: Update for 2.4 release.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-20 18:40:33 +02:00
Dodji Seketeli
86b8a24484 doc/website/mainpage.txt: Update for 2.4 release
* doc/website/mainpage.txt: Update download link for 2.4 release.
	Use the .xz tarball.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-20 18:40:27 +02:00
Dodji Seketeli
897620388b gen-changelog.py: Remove long standing debugging output
* gen-changelog.py (gen-changelog.py): Remove debugging output.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-20 18:35:59 +02:00
Dodji Seketeli
9a40b69c36 gen-changelog.py: Fix a long standing typo
While looking at something else, I stumbled upon a long standing
copy-paste typo where we refer to original GNET (from gstreamer) in
lieu of libabigail.  Fixed thus.

	* gen-changelog.py (get_rel_tags): It's libabigail, not GNET.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-20 18:22:27 +02:00
Dodji Seketeli
3459495617 gen-changelog.py: Don't escaping '/' with '\' in regexp
Python 3.12 on Fedora 39 complains that we should not escape the '/' character with
a '\' character in a regular expression.  Fixed thus.

	* gen-changelog.py (get_rel_tags): Do not escape '/' with '\' in
	regexp.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-20 18:22:27 +02:00
Dodji Seketeli
306056da14 ir: Fix compilation error with GCC 4.8.5
* src/abg-ir.cc (enum_type_decl::get_sorted_enumerators): Add
	const to parameters of the lambda function.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-20 17:15:57 +02:00
Dodji Seketeli
6ec8e34c32 suppression: Make the "end" data member offset selector be named boundary
Now that we have what is called a "named boundary", introduced by
commit [1], this patch re-writes the handling of the "end" data member
offset selector (used in expressions like: offset_of(end) in
suppression specifications) in terms of the new "named boundary"
infrastructure.  In other words, the "end" keyword is now a named
boundary constant, just like the
"offset_of_flexible_array_data_member" is a named boundary constant.

[1]: The patch that introduced the concept of "named boundary" is this
one:

    commit b12ba51e62
    Author: Dodji Seketeli <dodji@redhat.com>
    Date:   Thu Oct 5 13:32:21 2023 +0200

	Support suppressing data member insertion before a flexible array member

	* src/abg-suppression.cc (END_STRING): Define new static string
	constant accessor.
	(type_suppression::insertion_range::eval_boundary): Eval the "end"
	named boundary as having a numerical value of
	std::numeric_limits<uint64_t>::max().
	(read_type_suppression): Parse the "end" token as a named
	boundary.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-18 11:57:56 +02:00
Dodji Seketeli
b12ba51e62 Support suppressing data member insertion before a flexible array member
Consider this code example:

    $ cat test-v0.c
     1	struct foo
     2	{
     3	  int member0;
     4	  char pad[]; /* <-- flexible array member.  */
     5	};
     6
     7	void
     8	foo(struct foo * p __attribute__((unused)))
     9	{
    10	}
    $

Consider this new version of the code where a data member has been
added right before the flexible array member:

    $ cat -n test-v1.c
     1	struct foo
     2	{
     3	  int member0;
     4	  char member1; /*<-- added member.  */
     5	  char pad[]; /* <-- flexible array member.  */
     6	};
     7
     8	void
     9	foo(struct foo * p __attribute__((unused)))
    10	{
    11	}
    $

Here is what abidiff reports about the change:

    $ abidiff test-v0.o test-v1.o || echo "returned value: $?"
    Functions changes summary: 0 Removed, 1 Changed, 0 Added function
    Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

    1 function with some indirect sub-type change:

      [C] 'function void foo(foo*)' at test-v0.c:8:1 has some indirect sub-type changes:
	parameter 1 of type 'foo*' has sub-type changes:
	  in pointed to type 'struct foo' at test-v1.c:1:1:
	    type size changed from 32 to 64 (in bits)
	    1 data member insertion:
	      'char member1', at offset 32 (in bits) at test-v1.c:4:1
	    1 data member change:
	      'char pad[]' offset changed from 32 to 40 (in bits) (by +8 bits)

    returned value: 4
    $

This patch allows users to suppress this change report using a new
property value to the "has_data_member_inserted_at" property of the
[suppress_type] directive.  The resulting suppression specification
reads:

    $ cat -n foo.suppr
	 1	[suppress_type]
	 2	 type_kind = struct
         3       name = foo
	 4	 has_data_member_inserted_at = offset_of_flexible_array_data_member
	 5	 has_size_change = yes
    $

With this suppression specification the previous command now gives:

    $ abidiff --suppr foo.suppr test-v0.o test-v1.o && echo "returned value: $?"
    Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function
    Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

    returned value: 0
    $

The patch adds new test cases and updates the documentation to add a
mention to the new offset_of_flexible_array_data_member named
boundary.

	* doc/manuals/libabigail-concepts.rst: Add documentation for the
	new "offset_of_flexible_array_data_member" named boundary.
	* include/abg-fwd.h (has_flexible_array_data_member): Declare new
	function.
	* src/abg-ir.cc (has_flexible_array_data_member): Define it.
	* include/abg-suppression.h
	(type_suppression::insertion_range::named_boundary_sptr): Define
	new typedef.
	(type_suppression::insertion_range::create_named_boundary): Declare
	new static function member function.
	(is_named_boundary): Declare new function.
	(class type_suppression::insertion_range::named_boundary): Declare
	new type.
	* src/abg-suppression.cc
	(struct type_suppression::insertion_range::named_boundary::priv):
	Define new private type.
	(OFFSET_OF_FLEXIBLE_ARRAY_DATA_MEMBER_STRING): Define new static
	constant string getter function.
	(type_suppression::insertion_range::create_named_boundary): Define
	new static member function.
	(is_named_boundary): Define new function.
	(read_type_suppression): Parse the new
	"offset_of_flexible_array_data_member" named boundary.
	(type_suppression::insertion_range::eval_boundary): Evaluate the
	new "offset_of_flexible_array_data_member" named boundary.
	* tests/data/test-abidiff-exit/test-fam1-report-[1-5].txt: New
	reference test output.
	* tests/data/test-abidiff-exit/test-fam2-report-1.txt: Likewise.
	* tests/data/test-abidiff-exit/test-fam1-suppr-[1-4].abignore: New test
	suppression specification.
	* tests/data/test-abidiff-exit/test-fam{1,2}-v{0,1}.o: New test input
	binaries.
	* tests/data/test-abidiff-exit/test-fam{1,2}-v{0,1}.c: Source code of
	the test input binaries.
	* tests/data/Makefile.am: Add the new test material to the source
	distribution.
	* tests/test-abidiff-exit.cc (in_out_specs): Add the new test
	input to this harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-18 11:08:58 +02:00
Dodji Seketeli
d38ee66d6b comparison: Represent changed unreachable anonymous unions, structs & enums
Following the changes to represent changed anonymous unreachable enums,
this patch does the same for anonymous unreachable unions, classes and
structs.

Basically, without this patch, this change:

    union
    {
      int a;
      int b;
    };

    ------

    union
    {
      int a;
      int b;
      int c;
    };

yields:

    1 removed type unreachable from any public interface:

      [D] 'union {int a; int b;}' at test_1.c:1:1

    1 added type unreachable from any public interface:

      [A] 'union {int a; int b; int c;}' at test_2.c:1:1

But with the patch, it does yield:

    1 changed type unreachable from any public interface:

      [C] 'union {int a; int b;}' changed:
	type size hasn't changed
	1 data member insertion:
	  'int c' at test-anon-union-v1.c:5:1
	type changed from:
	  union {int a; int b;}
	to:
	  union {int a; int b; int c;}

	* include/abg-fwd.h (class_or_union_types_of_same_kind)
	(is_data_member_of_anonymous_class_or_union): Declare new
	functions.
	* include/abg-ir.h (lookup_data_member): Likewise, declare a new overload.
	* src/abg-ir.cc (class_or_union_types_of_same_kind)
	(lookup_data_member, is_data_member_of_anonymous_class_or_union):
	Define news functions & overloads.
	* src/abg-reporter-priv.cc (represent): When representing a change
	in the name of a data member, if the context is an anonymous type,
	use the non-qualified name of the data member, not its qualified
	name.
	* src/abg-comparison.cc
	(corpus_diff::priv::ensure_lookup_tables_populated): Handle
	deleted/added anonymous enums, unions, classes and structs
	similarly.  That is, if an anonymous type was removed and another
	one got added, if they both have data members (or enumerators) in
	common, then we are probably looking at an anonymous type that was
	changed.  This is because these anonymous types are named using
	their flat representation.
	* tests/data/test-abidiff-exit/test-anon-types-report-1.txt: New
	reference test comparison output.
	* tests/data/test-abidiff-exit/test-anon-types-v{0,1}.o: New
	binary tests input files.
	* tests/data/test-abidiff-exit/test-anon-types-v{0,1}.c: Source
	code of new binary test input.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-abidiff-exit.cc (in_out_specs): Add the test inputs
	above to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-17 10:50:51 +02:00
Dodji Seketeli
40f11c58f3 ir,comparison: Represent changed anonymous enums
Now that added/removed non-reachable anonymous enums is supported, we
want to represent changing an anonymous enum.

Strictly speaking, adding or removing an enumerator from an anonymous
enum is represented as deleting of the anonymous enum in the old
state and the addition of an anonymous enum in the new state.

This patch analyses the added/removed anonymous enums and if the old
enum has enumerators contained in the new one, then it assumes we are
looking at anonymous enum change.

	* include/abg-ir.h (is_enumerator_present_in_enum): Declare new
	public function.
	* src/abg-ir.cc (is_enumerator_present_in_enum): Turn this
	static function into a public one.
	* src/abg-comparison.cc
	(corpus_diff::priv::ensure_lookup_tables_populated): Detect that
	an removed/added anonymous enum is actually a changed anonymous
	enum and represent it as such.
	* tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v{0,1}.txt:
	New reference test output files.
	* tests/data/test-abidiff-exit/test-anonymous-enums-change-v{0,1}.c:
	Source code for the some input test binary.
	* tests/data/test-abidiff-exit/test-anonymous-enums-change-v{0,1}.o:
	New test input binaries.
	* tests/data/Makefile.am: Add the new test materials above to
	source distribution.
	* tests/test-abidiff-exit.cc (in_out_specs): Add the new test
	input to the harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-17 10:50:51 +02:00
Dodji Seketeli
2604ff2d28 ir,comparison,corpus: Better support anonymous enums comparison
Anonymous enums are designated using their internal names which are
automatically generated.  The problem however is that whenever a new
anonymous enum gets inserted in the translation unit, that can
randomly change the name of existing anonymous enums.  This makes
reporting of changes in anonymous enums essentially useless.

To address this issue, this patch uses flat representation for
anonymous enums, for the purpose of designating them outside of the
context of type canonicalization.  This is like what is done already
for anonymous classes and unions.

	* include/abg-fwd.h (get_enum_flat_representation)
	(get_class_or_enum_flat_representation): Declare new functions.
	* include/abg-ir.h (enum_type_decl::get_sorted_enumerators):
	Declare new member functions.
	* src/abg-comparison.cc
	(corpus_diff::priv::{ensure_lookup_tables_populated,
	added_unreachable_type_is_suppressed,
	deleted_unreachable_type_is_suppressed,
	record_type_as_reachable_from_public_interfaces}): Use
	non-internal pretty representation to designate ABI artifacts so
	that anonymous enums get designated by their flat representation.
	* src/abg-corpus.cc (corpus::type_is_reachable_from_public_interfaces):
	Likewise.
	* src/abg-ir.cc (get_type_name): The type name of an anonymous
	enum or class should is now the flat representation if we are not
	in the context of type canonicalization.
	(enum_type_decl::get_pretty_representation): If we are not in the
	context of type canonicalization, the pretty representation of an
	enum is its flat representation.
	(get_enum_flat_representation)
	(get_class_or_enum_flat_representation): Define new functions.
	(enum_type_decl::get_sorted_enumerators): Likewise.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/test-anonymous-members-0.o.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.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/test43-PR22913-report-0.txt:
	Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest23.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-17 10:50:51 +02:00
Dodji Seketeli
356b87adf7 default-reporter,reporter-priv: Do not report names of anonymous enums
When reporting changes of anonymous enums, do not try to report their
qualified name as that doesn't make any sense -- they are anonymous.

Similarly, in report_name_size_and_alignment_changes do not try to
report about changes in the name of an anonymous enum.

	* src/abg-default-reporter.cc (default_reporter::report): In the
	overload for enum_diff, do not get the qualified name of anonymous
	enums.
	* src/abg-reporter-priv.cc
	(report_name_size_and_alignment_changes): Do not report about name
	changes for anonymous enums.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-17 10:50:51 +02:00
John Moon
b879ba8175 suppression: Add "changed_enumerators_regexp" property
Currently, users are able to suppress changes to enumerator variants
matching names specified in "changed_enumerators", but can't specify
regular expressions.

A common pattern when using enums is to have the final enum variant
labeled as "*_MAX" or "*_LAST" so that users of the enum can have a
way to determine how many variants there are. In these cases, when
expanding an enum, the last variant will change, but that's an
expected result that users may not want to flag as an ABI-breaking
change.

For example, if you have a change like this:

enum foo {
        FOO,
        BAR,
        FOOBAR_MAX,
};

...

enum foo {
        FOO,
        BAR,
        BAZ,
        FOOBAR_MAX,
};

abidiff reports:

1 changed type unreachable from any public interface:

  [C] 'enum foo' changed:
    type size hasn't changed
    1 enumerator insertion:
      'foo::BAZ' value '2'
    1 enumerator change:
      'foo::FOOBAR_MAX' from value '2' to '3' at test_2.c:1:1

With a new changed_enumerators_regexp property, users can specify a
suppression which stops abidiff from emitting this diff for any
members which match the regular expressions in the list:

[suppress_type]
  type_kind = enum
  changed_enumerators_regexp = .*_MAX$, .*_LAST$, .*_NUM$, .*_NBITS$

	* include/abg-suppression.h
	(type_suppression::{g,s}et_changed_enumerators_regexp): Declare new
	accessor functions.
	* src/abg-suppression-priv.h
	(type_suppression::priv::changed_enumerators_regexp_): Define new
	data member.
	* src/abg-suppression.cc
	(type_suppression::{g,s}et_changed_enumerators_regexp): Define new
	accessor function.
	(type_suppression::suppresses_diff): For a type suppression to
	match an enum_diff, the names of all changed enumerators must
	match either the names returned by
	type_suppression::get_changed_enumerator_names or one of the
	regexps returned by the new member function
	type_suppression::get_changed_enumerators_regexp.
	(read_type_suppression): Parse the new
	'changed_enumerators_regexp' property to set the
	type_suppression::get_changed_enumerators_regexp property.
	* doc/manuals/libabigail-concepts.rst: Add an entry for the new
	'changed_enumerators_regexp' property.
	* tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-[1-5].suppr:
	Add new test suppression files.
	* tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-[0-5].txt:
	Add new test reference output files.
	* tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v{0,1}.c:
	Add source code for new binary test input files.
	* tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v{0,1}.o:
	Add new binary test input files.
	* tests/data/Makefile.am: Add the new test files to the source
	distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Add the new test input
	files to this test harness.

Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-17 10:50:51 +02:00
Dodji Seketeli
a125607873 Bug 30971 - Wrong interpretation of "has_data_member_inserted_at"
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>
2023-10-17 10:32:38 +02:00
Dodji Seketeli
400673935d ir: Remove redundant virtual member functions
G++ 13.2.1 complains that virtual member functions
{qualified_type_def,pointer_type_def,class_or_union}::operator!= are
redundant with type_base::operator!=, and rightfully so.  This patch
removes those useless virtual member functions.

	* include/abg-ir.h
	({qualified_type_def,pointer_type_def,class_or_union}::operator!=):
	Remove these redundant virtual data members.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-12 13:28:43 +02:00
Dodji Seketeli
6e1cbc9acc init: Fix thinko in apidoc
* src/abg-ini.cc (read_context::read_string): A string is a
	contiguous vector of "property value" characters.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-11 13:55:51 +02:00
Dodji Seketeli
ceb0fdb016 ini: Support '[' and ']' in arguments of function call expressions
Consider the suppression specification below:

    [suppress_type]
      type_kind = struct
      has_data_member_inserted_at = offset_of_first_data_member_regexp(.*p[0-9]?$)

The parser wrongly considers that in the regular expression
".*p[0-9]?$", the characters '[' and ']' should be escaped.  Fixed
thus.

	* src/abg-ini.cc (char_is_function_name_char): The only delimiters
	should be the '(' and ')' characters.
	* tests/data/test-diff-suppr/test-has-data-member-inserted-at-1-report-2.txt:
	New reference test output.
	* tests/data/test-diff-suppr/test-has-data-member-inserted-at-1.2.suppr:
	New suppression specification.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Add the new test
	material above to this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-11 13:55:31 +02:00
Dodji Seketeli
efb1841252 Bug 30959 - Crash on malformed fn call expression
The code fails to ignore a function call expression that is considered
malformed by the type suppression parser.  Fixed thus.

	* src/abg-suppression.cc
	(type_suppression::insertion_range::eval_boundary): If the
	function call expression is considered malformed, then do not
	crash.
	* tests/data/test-diff-suppr/test-has-data-member-inserted-at-1-report-1.txt:
	New reference test output.
	* tests/data/test-diff-suppr/test-has-data-member-inserted-at-1-v{0,1}.c:
	Source code of the new input binaries.
	* tests/data/test-diff-suppr/test-has-data-member-inserted-at-1-v{0,1}.o:
	New input binaries.
	* tests/data/test-diff-suppr/test-has-data-member-inserted-at-1.1.suppr:
	New test suppression specification.
	* tests/data/Makefile.am: Add the new test material above to the
	source distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Add the new tests to
	this harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-11 13:55:02 +02:00
Dodji Seketeli
bb89dbb085 suppression: Fix a typo in apidoc
* src/abg-suppression.cc (is_fn_call_expr_boundary): Fix a typo in
	the apidoc.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-05 17:09:45 +02:00
Dodji Seketeli
04737bcc84 suppression: Fix indentation
* include/abg-suppression.h: Fix indentation of the
	type_suppression::insertion_range::end() accessor.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-05 17:09:45 +02:00
Dodji Seketeli
f068f4a98f doc/manuals/libabigail-concepts.rst: Fix typo
* doc/manuals/libabigail-concepts.rst: Fix a typo in the doc for
	the "end" named boundary.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-05 17:09:45 +02:00
Dodji Seketeli
a6108e69e4 abg-comparison[-priv]: Better detection of incompatible unreachable type changes
Whenever there is a change in unreachable type,
corpus_diff::has_incompatible_changes always reports that the
corresponding diff node carries an incompatible change.  It does this
even if the change is known to be compatible.

To be able to say if a diff node for a unreachable type carries a
compatible (not incompatible) change,
corpus_diff::has_incompatible_changes must look at the change category
of that diff node, instead of saying that any change to an unreachable
type is incompatible.

While looking at this, I noted that
corpus_diff::priv::apply_filters_and_compute_diff_stats doesn't
categorize the diffs in
corpus_diff::priv::changed_unreachable_types_, so it's not possible to
look at the categories of the changes held by that data member to see
if they are incompatible or not.

This patch thus categorizes the diff nodes held by
corpus_diff::priv::changed_unreachable_types_ and makes
corpus_diff::has_incompatible_changes look at those diff nodes to
detect if they are incompatible.

Let's see the result of this patch.

Consider the change in the input test source code from included in
this patch, from test-enumerator-changes1-v0.c to test-enumerator-changes1-v1.c:

    $ diff -u test-enumerator-changes1-v0.c test-enumerator-changes1-v1.c
    --- test-enumerator-changes1-v0.c	2023-10-04 11:25:30.722989530 +0200
    +++ test-enumerator-changes1-v1.c	2023-10-04 11:25:30.722989530 +0200
    @@ -1,13 +1,14 @@
     /*
      *
      * Compile this with:
    - *    gcc -g -c -fno-eliminate-unused-debug-types test-enumerator-changes1-v0.c
    + *    gcc -g -c -fno-eliminate-unused-debug-types test-enumerator-changes1-v1.c
      */

     enum foo
       {
	 E1_O,
    -    E1_1
    +    E1_1,
    +    E1_2
       };

     void
    $

The enumerator E1_2 has been added to the 'foo' enum.

Now, let's see what abidiff prior to this patch would say about the
change between the two result binaries test-enumerator-changes1-v0.o
and test-enumerator-changes1-v1.o:

    $ abidiff --non-reachable-types --harmless test-enumerator-changes1-v0.o test-enumerator-changes1-v1.o || echo "return value: $?"
    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, 1 changed, 0 added type

    1 changed type unreachable from any public interface:

      [C] 'enum foo' changed:
	type size hasn't changed
	1 enumerator insertion:
	  'foo::E1_2' value '2'

    return value: 12
    $

See the return value of 12, that is actually the bits
abigail::tools_utils::ABIDIFF_ABI_CHANGE (of value 4) and
abigail::tools_utils::ABIDIFF_ABI_INCOMPATIBLE_CHANGE (of value 8) being set.

Normally, only the bit abigail::tools_utils::ABIDIFF_ABI_CHANGE (of
value 4) should be set.

Now, let's look at what abidiff says with this patch:

    $ abidiff --non-reachable-types --harmless test-enumerator-changes1-v0.o test-enumerator-changes1-v1.o || echo "return value: $?"
    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, 1 changed, 0 added type

    1 changed type unreachable from any public interface:

      [C] 'enum foo' changed:
	type size hasn't changed
	1 enumerator insertion:
	  'foo::E1_2' value '2'

    return value: 4
    $

Now the return value is 4, which is the bit
abigail::tools_utils::ABIDIFF_ABI_CHANGE being set, as we would expect
because that change is known to be not incompatible.

	* Src/abg-comparison-priv.h
	(corpus_diff::priv::changed_unreachable_types): Declare ...
	* src/abg-comparison.cc
	(corpus_diff::priv::changed_unreachable_types): ... new function.
	(corpus_diff::priv::apply_filters_and_compute_diff_stats): Walk
	the nodes returned by corpus_diff:priv::changed_unreachable_types
	and apply the filters (including categorization filters) to them.
	Also make the loop similarly applying filters to the nodes
	returned by corpus_diff::priv::changed_unreachable_types_sorted be
	a ranged-based one, for the sake of consistency.
	(corpus_diff::has_incompatible_changes): Now that diff nodes
	returned by corpus_diff::priv::changed_unreachable_types are
	categorized, look at their change categories to see if they are
	incompatible or not.
	* tests/data/test-abidiff-exit/test-enumerator-changes1-report-1.txt:
	New test output reference.
	* tests/data/test-abidiff-exit/test-enumerator-changes1-v{0,1}.o:
	New test input binaries.
	* tests/data/test-abidiff-exit/test-enumerator-changes1-v{0,1}.c:
	New source code for the new test input binaries.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-abidiff-exit.cc (in_out_specs): Add the new test
	input binaries to the test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-04 12:15:24 +02:00
Dodji Seketeli
46e80debd6 comparison: Always apply filters on the diff graph
When looking at something else, I noticed that
diff_context::maybe_apply_filters doesn't apply the filters (i.e, the
various passes) on the diff graph if all the categories of changes are
allowed, typically when --harmless is passed to abidiff.

This is wrong because even if all the categories are allowed, the
changes carried by nodes of the diff graph should still be
categorized.  This was an early optimization dating back from the
times where the filtering was slow.

	* src/abg-comparison.cc (diff_context::maybe_apply_filters): Do
	not get out when all the categories of diff changes are allowed.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-03 11:08:53 +02:00
Dodji Seketeli
023d28abb4 ir: Fix output of 'debug(enum-type)'
The output of calling the debug function on an enum type wrongly says
that we are looking at a union.  Ooops.  Fixed thus.

	* src/abg-ir.cc (get_debug_representation): Don't say 'union' when
	we are looking at an enum.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-03 11:08:53 +02:00
Dodji Seketeli
528ed9fe55 test-abidiff-exit: Do not use debuginfo dir when its empty
If the debug info dir is empty in the input test specifier, the abidiff
command should not add any --debug-info-dir{1,2} option.  Fixed thus.

	* tests/test-abidiff-exit.cc (main): If debug info dir is empty in
	the input test specifier, do not try to use it in the abidiff
	command.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-03 11:08:53 +02:00
Dodji Seketeli
727452167e libabigail-concepts.rst: Remove trailing white spaces
* doc/manuals/libabigail-concepts.rst: Remove trailing white
	spaces.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-02 23:24:21 +02:00
Dodji Seketeli
d304f4d501 libabigail-concepts.rst: Sort the properties of the directives
In documentation for the suppression directives, the properties of the
directives were not sorted, making it hard to look
for a particular one.

This patch sorts the properties in the lexicographic order.

	* doc/manuals/libabigail-concepts.rst: Sort the properties in the
	lexicographic order.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-10-02 12:08:09 +02:00
Dodji Seketeli
457f5cb202 configure,test-diff-pkg.cc: Handle symlinks presence in dist tarball
Since the commit below, there are tests that require symbolic links.

Unfortunately, the tar command used to construct tarballs copies the
target of a symbolic link (and thus doesn't keep the symlink) for the
purpose of greater portability, as some platforms don't support
symbolic links.

This patch uses a tar command that keeps the symlinks in place for the
tests introduced by the commit below to keep working.  On some
platforms however, symlinks are removed from the tarball no matter
what.  In those case, the test that needs symlinks is disabled.

Here is the commit in question:

    bad389f abipkgdiff: Avoid comparing binaries that are outside of the package

	* configure.ac: Use "tar -cf" instead of "tar -chf" to construct
	the tarball.  Detect if the presence of the symlink in the
	distribution and define the WITH_SYMLINKS_KEPT_IN_DIST
	preprocessor macro accordingly.
	* tests/test-diff-pkg.cc (in_out_specs): If symlinks are not
	present in the tarball then the test that requires symlinks is
	deactivated.  Also, fix the
	data/test-diff-pkg/symlink-dir-test1/dir1 test to make it point to
	the target of the symlinks directly, to avoid considering a binary
	twice, in cases where symlink targets are copied.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-09-20 13:07:30 +02:00
Dodji Seketeli
831b59a83f elf-reader, ir: Fix compilation on GCC 4.8.5
* src/abg-elf-reader.cc (reader::initialize): Use older-style
	initialization to keep the old lady happy.
	* src/abg-ir-priv.h (canonicalize_types): Avoid using type
	deduction in this context to keep the old lady happy.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-09-20 10:57:39 +02:00
Dodji Seketeli
2f61188d43 dwarf-reader: Do not re-use typedefs in a scope
Sometimes, two typedefs of the same name can appear at the same scope
but point to different types, in DWARF.  Unbelievable but true.  In
those case, we do not want to re-use the typedef, obviously, as we can
possibly misrepresent the type graph in that case.

This fixes one self-comparison issue for the x86_64 sub-package of the
gcc-gnat package that is tested by doing:

    $ fedabipkgdiff --self-compare  -a --from fc37 gcc-gnat

	* src/abg-dwarf-reader.cc (build_ir_node_from_die): Do not re-use
	a typedef from a given scope.
	* src/abg-reader.cc (build_typedef_type): Do not re-use typedefs
	with the same ID.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Adjust.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
	Likewise.
	* tests/data/test-diff-filter/test41-report-0.txt: 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/test10-pr18818-gcc.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/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-09-07 15:23:39 +02:00
Dodji Seketeli
56e583a792 ir: Fix qualification as non-confirmed propagated canonical types
While looking at something else, there are some types considered
having "non-confirmed propagated canonical type", even though those
types are not even canonical-type-propagated.  This patch fixes that.

That doesn't have any visible impact, but it's definitely more
correct.

	* src/abg-ir.cc (return_comparison_result): A type that doesn't
	have propagated canonical type can't be considered having
	"non-confirmed propagated canonical type".

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-09-07 15:23:39 +02:00
Dodji Seketeli
d8de76cfa8 ir: Use non qualified typedef name for type canonicalization
While looking into fixing self-comparison errors for the gcc-gnat
package[1], I stumbled upon the fact that a typedef that is defined in
the global scope is different from a typedef defined in a scope, even
if they both point to the same underlying type.  This is a spurious
difference that feeds a spurious explosion of the number of canonical
types, for no reason.  It can lead to spurious self-comparison errors
down the road.  Sadly, fixing this issue is not enough to fix the
self-comparison error in [1].

[1]: The command is:

    $ fedabipkgdiff --self-compare  -a --from fc37 gcc-gnat

	* include/abg-ir.h (reference_type_def::{pointed_to_type_,
	is_lvalue_}): Remove these data members.
	(reference_type_def::priv_): Add a unique data member.
	(typedef_decl::get_qualified_name): Add new virtual member
	functions.
	* src/abg-ir.cc (get_decl_name_for_comparison): If the decl we are
	comparing is a typedef, only consider its non-qualified name.
	(get_type_name): For internal purposes, the type name of a typedef
	is its non-qualified name.
	(pointer_type_def::get_qualified_name): For internal purposes, if
	the pointed-to name is a typedef, use the non-qualified name of
	the typedef.
	(reference_type_def::priv): Define new data type.
	(reference_type_def::reference_type_def): Initialize the new
	reference_type_def::priv_ data member and adjust to the move of
	the reference_type_def::pointed_to_type_ data member to
	reference_type_def::priv::pointed_to_type_.
	(reference_type_def::{s,g}et_pointed_to_type): Adjust.
	(reference_type_def::is_lvalue): Likewise.
	(reference_type_def::get_qualified_name): Support caching
	qualified names for internal and non-internal purposes.
	(typedef_decl::get_pretty_representation): For internal purposes,
	use non-qualified typedef name.
	(typedef_decl::get_qualified_name): Define the two overloads for
	this virtual member function.
	(function_decl::get_pretty_representation): Use the
	'qualified_name' parameter.  Also, rather than systematically
	using the qualified name of the return type, use get_type_name
	instead that knows when to use qualified names and when not to.
	(qualified_name_setter::do_update):
	* tests/data/test-abidiff/test-PR18791-report0.txt: Adjust.
	* tests/data/test-annotate/libtest23.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.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/test42-PR21296-clanggcc-report0.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/libtest23.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test0.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test1.hash.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.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/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.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/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
	* tests/data/test-read-write/test28-without-std-fns-ref.xml:
	Likewise.
	* tests/data/test-read-write/test28-without-std-vars-ref.xml:
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-09-07 15:23:38 +02:00
Dodji Seketeli
0239f89b4f ir: Really avoid canonicalizing decl-only classes
is_non_canonicalized_type uses is_declaration_only_class_or_union_type
to detect decl-only classes, but it doesn't differentiate between
decl-only classes that are associated to a class definition and those
that are not.

We want to avoid canonicalizing decl-only classes that are not
associated to any class definition.

This patch fixes the invocation of
is_declaration_only_class_or_union_type to express the above
assertion.

This fix uncovered another self-comparison issue that was being
expressed when running the command below:

    $ abidw --abidiff tests/data/test-types-stability/PR27086-libstdc++.so.6.0.26

That one was due to an error in method_decl::set_linkage_name which
was making classes contain the wrong overloads of methods.  The patch
fixes that error too.

	* include/abg-fwd.h (is_pointer_to_decl_only_class_or_union_type)
	(is_reference_to_decl_only_class_or_union_type)
	(is_typedef_to_decl_only_class_or_union_type): Remove declarations.
	(is_typedef_ptr_or_ref_to_decl_only_class_or_union_type): Declare
	new function.
	* src/abg-ir.cc (is_pointer_to_decl_only_class_or_union_type)
	(is_reference_to_decl_only_class_or_union_type)
	(is_typedef_to_decl_only_class_or_union_type): Remove definitions.
	(is_typedef_ptr_or_ref_to_decl_only_class_or_union_type): Define
	new function.
	(is_non_canonicalized_type): Change the invocation of
	is_declaration_only_class_or_union_type to make it look through
	decl-only types.  Use
	is_typedef_ptr_or_ref_to_decl_only_class_or_union_type in lieu of
	is_{pointer,reference,typedef}_to_decl_only_class_or_union_type
	that got removed.
	(method_decl::set_linkage_name): Remove the mapping between the
	method and the old linkage name, only if the old name is different
	from the new name.  Duh.
	* tests/data/test-annotate/libtest23.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.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-annotate/test21-pr19092.so.abi: 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/PR25007-sdhci.ko.abi: Likewise.
	* tests/data/test-read-dwarf/libtest23.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.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/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.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/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-09-07 15:23:38 +02:00
Dodji Seketeli
0447eb27aa ir: Avoid forgetting potential seemingly duplicated member functions
In some rare cases expressed in DWARF from C++, a member function can
belong to both a declaration-only class (having no data member) in one
translation unit, and to a fully defined class in another translation
unit.  In those cases, the two classes are represented and considered
different.

But then, consider a destructor which mangled name is "D1".  D1 is
represented in both the decl-only class and the fully-defined class.
In the former case, its "this pointer" points to a decl-only class,
while in the later case its "this pointer" points a fully-defined
class.

So, D1 coming from the former case will compare different from the D1
coming from the later case, because of the spurious difference
"decl-only class" versus "fully-defined class".  This is in the
context of a self-comparison.

One way to fix this self-comparison subtle change is to give the
former D1 and the later D1 two different "function ID"s.  Today, the
function ID is just the mangled name, D1.  This patch is defining a
more involved ID which makes the difference between a member function
on a decl-only class and a member function on a fully-defined class.

Note that the only member functions that matter are virtual member
functions because they are the only member functions that are
considered when comparing two classes.

This fixes the self-comparison error found on the binary
gcc-gnat-12.3.1-1.fc37.x86_64/usr/libexec/gcc/x86_64-redhat-linux/12/gnat1
while running the self-comparison command below:

    $ fedabipkgdiff --self-compare -a --from fc37 gcc-gnat

	* src/abg-ir.cc (is_declaration_only_class_or_union_type): Add an
	overload for type_base_sptr.
	(function_decl::get_id): Virtual member functions that are defined
	on decl-only classes have a special ID to avoid confusing them
	with their counterparts defined on defined classes.
	* src/abg-reader.cc (build_function_decl)
	(build_function_decl_if_not_suppressed): Add a new
	add_to_exported_decls parameter to avoid adding the function to
	the set of exported decls to early.  For the function to be
	properly added to the set of exported decls, all its attributes
	must be set, including virtualness.  In some case, those
	attributes are not yet known by the end of the call to
	build_function_decl.  The caller must then set those properties
	and then add the function to the set of exported decls.
	(build_{class,union}_decl): Build the function first, then add its
	missing properties and *then* add it to the set of exported decls.
	(handle_function_decl): Adjust.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-09-07 15:23:38 +02:00