]>
sourceware.org Git - libabigail.git/commit
ctf-reader: Fix representation of multidimensional arrays
To build an IR for multidimensional array the CTF front-end iterates
over the element types recursively.
So, consider the array definition:
char a[2][3][4][5];
It's represented as
'char[2][3][4] a[5]'
instead of:
'char a[2][3][4][5]'
It always considers multidimensional arrays as unidimensional creating
a `array-type-def' node for each dimension:
<array-type-def dimensions='1' type-id='type-id-1' ... >
<subrange length='2' type-id='type-id-3' id='type-id-4'/>
</array-type-def>
<array-type-def dimensions='1' type-id='type-id-2' ... >
<subrange length='3' type-id='type-id-3' id='type-id-6'/>
</array-type-def>
...
Instead of:
<array-type-def dimensions='4' type-id='type-id-1' ... >
<subrange length='2' type-id='type-id-3' id='type-id-4'/>
<subrange length='3' type-id='type-id-3' id='type-id-5'/>
...
</array-type-def>
Fixed thus.
* src/abg-ctf-reader.cc (+build_array_ctf_range): New definition.
* tests/data/Makefile.am: Add new testcase.
* tests/data/test-read-ctf/test-array-mdimension.abi: New testcase.
* tests/data/test-read-ctf/test-array-mdimension.c: Likewise.
* tests/data/test-read-ctf/test-array-mdimension.o: Likewise.
* tests/data/test-read-ctf/test9.o.abi: Adjust.
* tests/test-read-ctf.cc: Update testsuite.
Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This page took 0.029099 seconds and 5 git commands to generate.