libabigail/tests
Dodji Seketeli b6add20f05 dwarf-reader,ir,writer: Better support for static member variables
To support the duality concrete/abstract instance of static data
member variables in DWARF, the reader needed a little bit of an
overhaul.  That overhaul is necessary to self-compare libLLVM.so, from
llvm-libs, in fc37.  Note that that self-compare is done using this
command:

    $ fedabipkgdiff -a--self-compare --from fc37 llvm-libs

So now, with this patch, the IR of a static data member is constructed
only when the concrete instance DIE of the static data member is
encountered.  The abstract instance DIE is then read first, the IR is
built from it, and then the concrete instance DIE is read for
additional attributes that might be needed, like the ELF symbol
attribute.

The patch fixes a number of issues related to static data members
representation in the IR, namely, it puts them all in their own array
in the class_or_union, just like what is done for non-static data
members.  The ABIXML writer is updated to emit static data member from
their new storage.

	* include/abg-ir.h (class_or_union::get_static_data_members):
	Declare new method.
	* src/abg-dwarf-reader.cc (add_or_update_class_type): Do not
	create any IR for the /declaration/ of static data member here.
	Wait for its definition from a concrete instance DIE to create the
	IR for it.
	(build_ir_node_from_die): In the DW_TAG_variable case, if we are
	looking at the concrete instance of a static variable (one that
	has a DW_AT_abstract_origin pointing to a static data member) then
	build the IR from it and add it to its class scope.
	* src/abg-ir-priv.h (class_or_union::priv::static_data_members_):
	Define new data member.
	(class_or_union::priv::priv): Stick the static data members that
	are in class_or_union::priv::data_members_ into
	class_or_union::priv::static_data_members_.
	* src/abg-ir.cc (maybe_adjust_canonical_type): Make sure static
	data members of the canonical type has the same symbols set as the
	data members of the canonicalized type.
	(class_or_union::add_data_member): Update the new
	class_or_union::priv::static_data_members_ when a data member is
	added.
	(class_or_union::get_non_static_data_members): Fix comments.
	(class_or_union::get_static_data_members): Define new member
	functions.
	(set_member_is_static): Update the new
	class_or_union::priv::static_data_members_ when static-ness is
	changed.
	* src/abg-writer.cc (write_decl_in_scope): Support writing pure
	declarations (not types).
	(write_translation_unit): Don't forget to write remaining global
	variables.
	(write_class_decl): Make sure to write static data members first,
	before writing the non-static data members.
	* tests/data/test-abidiff-exit/test-ld-2.28-210.so--ld-2.28-211.so.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/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-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-filter/test30-pr18904-rvalueref-report1.txt:
	Likewise.
	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.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-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/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/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/test10.xml: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2024-08-29 17:15:44 +02:00
..
data dwarf-reader,ir,writer: Better support for static member variables 2024-08-29 17:15:44 +02:00
lib
.gitignore
Makefile.am dwarf-reader: Avoid duplicating anonymous member types 2024-08-29 17:15:43 +02:00
mockfedabipkgdiff.in Remove python3-mock dependency and use unittest.mock instead 2024-01-26 12:51:40 +01:00
print-diff-tree.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
runtestabidb1.sh.in tests/runtestabidb?.sh.in: Use bash shebang 2024-04-30 13:14:38 +02:00
runtestabidb2.sh.in tests/runtestabidb?.sh.in: Use bash shebang 2024-04-30 13:14:38 +02:00
runtestcanonicalizetypes.sh.in
runtestdefaultsupprs.py.in
runtestdefaultsupprspy3.sh.in
runtestfedabipkgdiff.py.in
runtestfedabipkgdiffpy3.sh.in
runtestslowselfcompare.sh.in
test-abicompat.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-abidiff-exit.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-abidiff.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-alt-dwarf-file.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-annotate.cc writer: Fix control of emitting parm names in function types 2024-05-06 18:31:42 +02:00
test-core-diff.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-cxx-compat.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-diff2.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-diff-dwarf-abixml.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-diff-dwarf.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-diff-filter.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-diff-pkg.cc abipkgdiff: Extract devel and main packages in the same directory 2024-08-29 17:15:44 +02:00
test-diff-suppr.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-dot.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-elf-helpers.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-ini.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-ir-walker.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-kmi-whitelist.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-lookup-syms.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-read-btf.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-read-common.cc test-read-common: Fix error message 2024-05-06 19:00:14 +02:00
test-read-common.h Use the CTF reader by default when applicable 2022-11-28 16:52:33 +01:00
test-read-ctf.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-read-dwarf.cc writer: Fix control of emitting parm names in function types 2024-05-06 18:31:42 +02:00
test-read-write.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-svg.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-symtab-reader.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-symtab.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-tools-utils.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-types-stability.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-utils.cc Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-utils.h Update Copyright for year 2024 2024-04-26 15:29:50 +02:00
test-valgrind-suppressions.supp
update-test-output.py tests/update-test-output.py: Adapt to some broken test output 2023-04-25 15:50:25 +02:00