mirror of
git://sourceware.org/git/libabigail.git
synced 2025-03-10 00:27:48 +00:00
If the subrange's upper_bound is lower than its lower_bound, that means the subrange has a length of zero. This is Ada lingo. You can learn more about this at https://en.wikibooks.org/wiki/Ada_Programming/Types/array#Array_Attributes, for instance. This patch teaches the DWARF reader about this. * src/abg-dwarf-reader.cc (build_subrange_type): Be aware that the upper_bound can be lower than lower_bound.. This most likely means the length of the subrange is zero. * src/abg-ir.cc (array_type_def::subrange_type::get_length): If lower_bound > upper_bound, then length is zero. This is Ada lingo. * src/abg-writer.cc (write_array_subrange_type): Always emit lower_bound and upper_bound. Acknowledge that if lower_bound > upper_bound, it means length is zero. * tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Adjust. * tests/data/test-annotate/libtest24-drop-fns.so.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/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-abixml/PR25409-librte_bus_dpaa.so.20.0.abi: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1-report-0.txt: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Likewise. * tests/data/test-read-btf/test0.o.abi: Likewise. * tests/data/test-read-ctf/test-ambiguous-struct-A.o.hash.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-const-array.abi: Likewise. * tests/data/test-read-ctf/test-dynamic-array.o.abi: Likewise. * tests/data/test-read-ctf/test0.abi: Likewise. * tests/data/test-read-ctf/test0.hash.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/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/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/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/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/test7.so.abi: Likewise. * tests/data/test-read-dwarf/test7.so.hash.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-write/test25.xml: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
96 lines
5.4 KiB
Plaintext
96 lines
5.4 KiB
Plaintext
<abi-corpus version='2.2'>
|
|
<elf-function-symbols>
|
|
<!-- foo(S&) -->
|
|
<elf-symbol name='_Z3fooR1S' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
|
|
</elf-function-symbols>
|
|
<abi-instr address-size='64' path='test7.cc' comp-dir-path='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf' language='LANG_C_plus_plus'>
|
|
<!-- char -->
|
|
<type-decl name='char' size-in-bits='8' id='type-id-1'/>
|
|
<!-- char*[7] -->
|
|
<array-type-def dimensions='1' type-id='type-id-2' size-in-bits='448' id='type-id-3'>
|
|
<!-- <anonymous range>[7] -->
|
|
<subrange length='7' lower-bound='0' upper-bound='6' type-id='type-id-4' id='type-id-5'/>
|
|
</array-type-def>
|
|
<!-- char[1] -->
|
|
<array-type-def dimensions='1' type-id='type-id-1' size-in-bits='8' id='type-id-6'>
|
|
<!-- <anonymous range>[1] -->
|
|
<subrange length='1' lower-bound='0' upper-bound='0' type-id='type-id-4' id='type-id-7'/>
|
|
</array-type-def>
|
|
<!-- char[] -->
|
|
<array-type-def dimensions='1' type-id='type-id-1' size-in-bits='unknown' id='type-id-8'>
|
|
<!-- <anonymous range>[] -->
|
|
<subrange length='unknown' lower-bound='0' upper-bound='-1' type-id='type-id-4' id='type-id-9'/>
|
|
</array-type-def>
|
|
<!-- double -->
|
|
<type-decl name='double' size-in-bits='64' id='type-id-10'/>
|
|
<!-- double[5][3] -->
|
|
<array-type-def dimensions='2' type-id='type-id-10' size-in-bits='960' id='type-id-11'>
|
|
<!-- <anonymous range>[5] -->
|
|
<subrange length='5' lower-bound='0' upper-bound='4' type-id='type-id-4' id='type-id-12'/>
|
|
<!-- <anonymous range>[3] -->
|
|
<subrange length='3' lower-bound='0' upper-bound='2' type-id='type-id-4' id='type-id-13'/>
|
|
</array-type-def>
|
|
<!-- int -->
|
|
<type-decl name='int' size-in-bits='32' id='type-id-14'/>
|
|
<!-- int*[4] -->
|
|
<array-type-def dimensions='1' type-id='type-id-15' size-in-bits='256' id='type-id-16'>
|
|
<!-- <anonymous range>[4] -->
|
|
<subrange length='4' lower-bound='0' upper-bound='3' type-id='type-id-4' id='type-id-17'/>
|
|
</array-type-def>
|
|
<!-- int*[4]*[10] -->
|
|
<array-type-def dimensions='1' type-id='type-id-18' size-in-bits='640' id='type-id-19'>
|
|
<!-- <anonymous range>[10] -->
|
|
<subrange length='10' lower-bound='0' upper-bound='9' type-id='type-id-4' id='type-id-20'/>
|
|
</array-type-def>
|
|
<!-- int[5] -->
|
|
<array-type-def dimensions='1' type-id='type-id-14' size-in-bits='160' id='type-id-21'>
|
|
<!-- <anonymous range>[5] -->
|
|
<subrange length='5' lower-bound='0' upper-bound='4' type-id='type-id-4' id='type-id-12'/>
|
|
</array-type-def>
|
|
<!-- sizetype -->
|
|
<type-decl name='sizetype' size-in-bits='64' id='type-id-4'/>
|
|
<!-- struct S -->
|
|
<class-decl name='S' size-in-bits='2304' is-struct='yes' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='1' column='1' id='type-id-22'>
|
|
<data-member access='public' layout-offset-in-bits='0'>
|
|
<!-- int S::a[5] -->
|
|
<var-decl name='a' type-id='type-id-21' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='3' column='1'/>
|
|
</data-member>
|
|
<data-member access='public' layout-offset-in-bits='192'>
|
|
<!-- char* S::b[7] -->
|
|
<var-decl name='b' type-id='type-id-3' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='4' column='1'/>
|
|
</data-member>
|
|
<data-member access='public' layout-offset-in-bits='640'>
|
|
<!-- double S::c[5][3] -->
|
|
<var-decl name='c' type-id='type-id-11' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='5' column='1'/>
|
|
</data-member>
|
|
<data-member access='public' layout-offset-in-bits='1600'>
|
|
<!-- int*[4]* S::d[10] -->
|
|
<var-decl name='d' type-id='type-id-19' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='6' column='1'/>
|
|
</data-member>
|
|
<data-member access='public' layout-offset-in-bits='2240'>
|
|
<!-- char S::e[1] -->
|
|
<var-decl name='e' type-id='type-id-6' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='7' column='1'/>
|
|
</data-member>
|
|
<data-member access='public' layout-offset-in-bits='2248'>
|
|
<!-- char S::f[] -->
|
|
<var-decl name='f' type-id='type-id-8' visibility='default' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='8' column='1'/>
|
|
</data-member>
|
|
</class-decl>
|
|
<!-- S& -->
|
|
<reference-type-def kind='lvalue' type-id='type-id-22' size-in-bits='64' id='type-id-23'/>
|
|
<!-- char* -->
|
|
<pointer-type-def type-id='type-id-1' size-in-bits='64' id='type-id-2'/>
|
|
<!-- int* -->
|
|
<pointer-type-def type-id='type-id-14' size-in-bits='64' id='type-id-15'/>
|
|
<!-- int*[4]* -->
|
|
<pointer-type-def type-id='type-id-16' size-in-bits='64' id='type-id-18'/>
|
|
<!-- int foo(S&) -->
|
|
<function-decl name='foo' mangled-name='_Z3fooR1S' filepath='/home/ooprala/rh/u/libabigail/tests/data/test-read-dwarf/test7.cc' line='11' column='1' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='_Z3fooR1S'>
|
|
<!-- parameter of type 'S&' -->
|
|
<parameter type-id='type-id-23'/>
|
|
<!-- int -->
|
|
<return type-id='type-id-14'/>
|
|
</function-decl>
|
|
</abi-instr>
|
|
</abi-corpus>
|