mirror of
git://sourceware.org/git/libabigail.git
synced 2025-03-10 00:27:48 +00:00
Libabigail doesn't yet support generic range types like in Ada. Ranges are supported as a kind of implementation detail of array types. But then its use like in the construct below is not supported: type My_Int is range 0 .. 5; function My_Function return My_Int; Here, the integer type "My_Int" can take the discrete values that go from 0 to 5. It's represented in the DWARF debug info as being a range type of length 6 and whose underlying type has a size of 8 bits. This patch adds support for a range type to be (de-)serialized from and to abixml, diffed, diff-analyzed and diff-reported. The ABIXML version number has been bumped from 2.1 to 2.2 accordingly. * configure.ac: Bump the abixml version to 2.2 from 2.1 * include/abg-comparison.h (diff_maps::get_subrange_diff_map): Declare new member functions. (class subrange_diff): Define new class. (subrange_diff_sptr): Define new typedef. (compute_diff): New overload for subrange_diff. (is_subrange_diff): Declare new function. * include/abg-ir.h (equals): Declare an overload for subrange_type. * include/abg-reporter.h (reporter_base::report): Declare an overload for subrange_diff. (default_reporter::report_underlying_changes_of_qualified_type): Declare member function. (leaf_reporter::report): Declare and overload for subrange_diff. Declare new member function. * include/abg-tools-utils.h (get_anonymous_subrange_internal_name_prefix): Declare new function. * src/abg-comparison-priv.h (struct subrange_diff::priv): Define new type. * src/abg-comparison.cc (diff_maps::priv::subrange_diff_map_): Define data member. (diff_maps::get_subrange_diff_map): Define member function. (is_subrange_diff, compute_diff): Define new functions. (compute_diff_for_types): Handle array_type::subrange_type types. (subrange_diff::{subrange_diff, first_subrange, second_subrange, get_pretty_representation, has_changes, has_local_changes, report, chain_into_hierarchy}): Define member functions. (diff_maps::insert_diff_node): Handle subrange diff nodes. (corpus_diff::priv::count_leaf_type_changes): Count subranges diff nodes. * src/abg-default-reporter.cc (default_reporter::report): Define an overload for subrange_diff. * src/abg-ir.cc (has_generic_anonymous_internal_type_name): Support subrange types. * src/abg-leaf-reporter.cc (report_type_changes_from_diff_maps): Report about subrange types. (leaf_reporter::report): Define and overload for subrange_diff nodes. * src/abg-reader.cc (build_subrange_type): Add a boolean to add the subrange type to the current scope. (build_array_type_def): Adjust when calling build_subrange_type. (build_type): Support building subrange types. * src/abg-reporter-priv.cc (represent): Define a new overload for the subrange_diff type. * src/abg-reporter-priv.h (represent): Declare a new overload for the subrange_diff type. * src/abg-tools-utils.cc (ANONYMOUS_SUBRANGE_INTERNAL_NAME) (ANONYMOUS_SUBRANGE_INTERNAL_NAME_LEN): Define new static const variables. (get_anonymous_subrange_internal_name_prefix): Define new function. * src/abg-writer.cc (write_array_subrange_type): Define new static function. (write_decl): Support emitting subrange_types. * tests/data/test-abidiff-exit/ada-subrange/test1-ada-subrange/test1-ada-subrange-report-1.txt: New reference output. * tests/data/test-abidiff-exit/ada-subrange/test1-ada-subrange/test1-ada-subrange-report-2.txt: Likewise. * tests/data/test-abidiff-exit/ada-subrange/test1-ada-subrange/v0/test1.ad{b,s}: Source code of the input binary below. * tests/data/test-abidiff-exit/ada-subrange/test1-ada-subrange/v0/test1.o: New input test. * tests/data/test-abidiff-exit/ada-subrange/test1-ada-subrange/v1/test1.ad{b,s}: Source code of the input binary below. * tests/data/test-abidiff-exit/ada-subrange/test1-ada-subrange/v1/test1.o: New input test. * tests/data/Makefile.am: Add the new test files to source distributions. * tests/test-abidiff-exit.cc (in_out_specs): Add the new tests input above to this test harness. * 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/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-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>
62 lines
3.8 KiB
Plaintext
62 lines
3.8 KiB
Plaintext
<abi-corpus version='2.2'>
|
|
<elf-needed>
|
|
<dependency name='libstdc++.so.6'/>
|
|
<dependency name='libm.so.6'/>
|
|
<dependency name='libgcc_s.so.1'/>
|
|
<dependency name='libc.so.6'/>
|
|
</elf-needed>
|
|
<elf-function-symbols>
|
|
<!-- bar() -->
|
|
<elf-symbol name='_Z3barv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
|
|
<!-- bleh() -->
|
|
<elf-symbol name='_Z4blehv' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
|
|
<!-- B::foo() -->
|
|
<elf-symbol name='_ZN1B3fooEv' type='func-type' binding='weak-binding' visibility='default-visibility' is-defined='yes'/>
|
|
<!-- _fini -->
|
|
<elf-symbol name='_fini' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
|
|
<!-- _init -->
|
|
<elf-symbol name='_init' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
|
|
</elf-function-symbols>
|
|
<elf-variable-symbols>
|
|
<!-- C<int>::bar -->
|
|
<elf-symbol name='_ZN1CIiE3barE' size='4' type='object-type' binding='gnu-unique-binding' visibility='default-visibility' is-defined='yes'/>
|
|
<!-- B::foo()::a -->
|
|
<elf-symbol name='_ZZN1B3fooEvE1a' size='4' type='object-type' binding='gnu-unique-binding' visibility='default-visibility' is-defined='yes'/>
|
|
</elf-variable-symbols>
|
|
<abi-instr address-size='64' path='test6.cc' comp-dir-path='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
|
|
<!-- int -->
|
|
<type-decl name='int' size-in-bits='32' id='type-id-1'/>
|
|
<!-- struct B -->
|
|
<class-decl name='B' size-in-bits='8' is-struct='yes' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='9' column='1' id='type-id-2'>
|
|
<member-function access='public'>
|
|
<!-- int B::foo() -->
|
|
<function-decl name='foo' mangled-name='_ZN1B3fooEv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='11' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_ZN1B3fooEv'>
|
|
<!-- implicit parameter of type 'B*' -->
|
|
<parameter type-id='type-id-3' is-artificial='yes'/>
|
|
<!-- int -->
|
|
<return type-id='type-id-1'/>
|
|
</function-decl>
|
|
</member-function>
|
|
</class-decl>
|
|
<!-- struct C<int> -->
|
|
<class-decl name='C<int>' size-in-bits='8' is-struct='yes' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='26' column='1' id='type-id-4'>
|
|
<data-member access='public' static='yes'>
|
|
<!-- static int C<int>::bar -->
|
|
<var-decl name='bar' type-id='type-id-1' mangled-name='_ZN1CIiE3barE' visibility='default' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='31' column='1' elf-symbol-id='_ZN1CIiE3barE'/>
|
|
</data-member>
|
|
</class-decl>
|
|
<!-- B* -->
|
|
<pointer-type-def type-id='type-id-2' size-in-bits='64' id='type-id-3'/>
|
|
<!-- int bar() -->
|
|
<function-decl name='bar' mangled-name='_Z3barv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='19' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z3barv'>
|
|
<!-- int -->
|
|
<return type-id='type-id-1'/>
|
|
</function-decl>
|
|
<!-- int bleh() -->
|
|
<function-decl name='bleh' mangled-name='_Z4blehv' filepath='/home/skumari/Tasks/source_repo/dodji/libabigail/tests/data/test-read-dwarf/test6.cc' line='34' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z4blehv'>
|
|
<!-- int -->
|
|
<return type-id='type-id-1'/>
|
|
</function-decl>
|
|
</abi-instr>
|
|
</abi-corpus>
|