static bool
die_is_reference_type(const Dwarf_Die* die);
+static bool
+die_is_pointer_array_or_reference_type(const Dwarf_Die* die);
+
static bool
die_is_pointer_or_reference_type(const Dwarf_Die* die);
static bool
die_peel_qual_ptr(Dwarf_Die *die, Dwarf_Die& peeled_die);
+static bool
+die_peel_qualified(Dwarf_Die *die, Dwarf_Die& peeled_die);
+
static bool
die_function_type_is_method_type(const reader& rdr,
const Dwarf_Die *die,
static bool
pointer_or_qual_die_of_anonymous_class_type(const Dwarf_Die* die)
{
- if (!die_is_pointer_or_reference_type(die)
+ if (!die_is_pointer_array_or_reference_type(die)
&& !die_is_qualified_type(die))
return false;
///
/// @return true iff @p die represents a pointer or reference type.
static bool
-die_is_pointer_or_reference_type(const Dwarf_Die* die)
+die_is_pointer_array_or_reference_type(const Dwarf_Die* die)
{return (die_is_pointer_type(die)
|| die_is_reference_type(die)
|| die_is_array_type(die));}
+/// Test if a DIE represents a pointer or a reference type.
+///
+/// @param die the die to consider.
+///
+/// @return true iff @p die represents a pointer or reference type.
+static bool
+die_is_pointer_or_reference_type(const Dwarf_Die* die)
+{return (die_is_pointer_type(die) || die_is_reference_type(die));}
+
/// Test if a DIE represents a pointer, a reference or a typedef type.
///
/// @param die the die to consider.
/// typedef type.
static bool
die_is_pointer_reference_or_typedef_type(const Dwarf_Die* die)
-{return (die_is_pointer_or_reference_type(die)
+{return (die_is_pointer_array_or_reference_type(die)
|| dwarf_tag(const_cast<Dwarf_Die*>(die)) == DW_TAG_typedef);}
/// Test if a DIE represents a class type.
return true;
}
+/// Return the leaf object under a qualified type DIE.
+///
+/// @param die the DIE of the type to consider.
+///
+/// @param peeled_die out parameter. Set to the DIE of the leaf
+/// object iff the function actually peeled anything.
+///
+/// @return true upon successful completion.
+static bool
+die_peel_qualified(Dwarf_Die *die, Dwarf_Die& peeled_die)
+{
+ if (!die)
+ return false;
+
+ memcpy(&peeled_die, die, sizeof(peeled_die));
+
+ int tag = dwarf_tag(&peeled_die);
+
+ bool result = false;
+ while (tag == DW_TAG_const_type
+ || tag == DW_TAG_volatile_type
+ || tag == DW_TAG_restrict_type)
+ {
+ if (!die_die_attribute(&peeled_die, DW_AT_type, peeled_die))
+ break;
+ tag = dwarf_tag(&peeled_die);
+ result = true;
+ }
+
+ return result;
+}
+
/// Return the leaf object under a typedef type DIE.
///
/// @param die the DIE of the type to consider.
repr.clear();
else
{
- if (has_underlying_type_die
- && die_is_pointer_or_reference_type(&underlying_type_die))
- repr = underlying_type_repr + " " + repr;
+ if (has_underlying_type_die)
+ {
+ Dwarf_Die peeled;
+ die_peel_qualified(&underlying_type_die, peeled);
+ if (die_is_pointer_or_reference_type(&peeled))
+ repr = underlying_type_repr + " " + repr;
+ else
+ repr += " " + underlying_type_repr;
+ }
else
repr += " " + underlying_type_repr;
}
if (!quals_repr.empty())
{
- if (is_pointer_type(underlying_type)
- || is_reference_type(underlying_type)
- || is_array_type(underlying_type))
+ if (is_pointer_type(peel_qualified_type(underlying_type))
+ || is_reference_type(peel_qualified_type(underlying_type)))
{
name += " ";
name += quals_repr;
test-abidiff-exit/btf/test0-v0.o \
test-abidiff-exit/btf/test0-v1.c \
test-abidiff-exit/btf/test0-v1.o \
+test-abidiff-exit/PR30048-test-report-0.txt \
+test-abidiff-exit/PR30048-test-v0.c \
+test-abidiff-exit/PR30048-test-v1.c \
+test-abidiff-exit/PR30048-test-v0.o \
+test-abidiff-exit/PR30048-test-v1.o \
+test-abidiff-exit/PR30048-test-2-report-1.txt \
+test-abidiff-exit/PR30048-test-2-v0.cc \
+test-abidiff-exit/PR30048-test-2-v0.o \
+test-abidiff-exit/PR30048-test-2-v1.cc \
+test-abidiff-exit/PR30048-test-2-v1.o \
\
test-diff-dwarf/test0-v0.cc \
test-diff-dwarf/test0-v0.o \
--- /dev/null
+Functions changes summary: 0 Removed, 7 Changed, 0 Added functions
+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:
+ return type changed:
+ 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:
+ 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:
+ return type changed:
+ entity changed from 'int ()*' to 'int'
+ type size changed from 64 to 32 (in bits)
+
+ [C] 'function amusement* fun()' at PR30048-test-2-v0.cc:57:1 has some indirect sub-type changes:
+ return type changed:
+ in pointed to type 'struct amusement' at PR30048-test-2-v1.cc:1:1:
+ type size changed from 6528 to 768 (in bits)
+ 24 data member changes:
+ type of 'int A[7]' changed:
+ entity changed from 'int[7]' to 'int'
+ type size changed from 224 to 32 (in bits)
+ type of 'int* B' changed:
+ entity changed from 'int*' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 256 to 32 (in bits) (by -224 bits)
+ type of 'int ()* C' changed:
+ entity changed from 'int ()*' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 320 to 64 (in bits) (by -256 bits)
+ type of 'int D[7][7]' changed:
+ entity changed from 'int[7][7]' to 'int'
+ type size changed from 1568 to 32 (in bits)
+ and offset changed from 384 to 96 (in bits) (by -288 bits)
+ type of 'int* E[7]' changed:
+ entity changed from 'int*[7]' to 'int'
+ type size changed from 448 to 32 (in bits)
+ and offset changed from 1984 to 128 (in bits) (by -1856 bits)
+ type of 'int ()* F[7]' changed:
+ entity changed from 'int ()*[7]' to 'int'
+ type size changed from 448 to 32 (in bits)
+ and offset changed from 2432 to 160 (in bits) (by -2272 bits)
+ type of 'int[7]* G' changed:
+ entity changed from 'int[7]*' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 2880 to 192 (in bits) (by -2688 bits)
+ type of 'int** H' changed:
+ entity changed from 'int**' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 2944 to 224 (in bits) (by -2720 bits)
+ type of 'int ()* I' changed:
+ entity changed from 'int ()*' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 3008 to 256 (in bits) (by -2752 bits)
+ type of 'int[7]* ()* J' changed:
+ entity changed from 'int[7]* ()*' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 3072 to 288 (in bits) (by -2784 bits)
+ type of 'int* ()* K' changed:
+ entity changed from 'int* ()*' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 3136 to 320 (in bits) (by -2816 bits)
+ type of 'int ()* ()* L' changed:
+ entity changed from 'int ()* ()*' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 3200 to 352 (in bits) (by -2848 bits)
+ type of 'volatile int a[7]' changed:
+ entity changed from 'volatile int[7]' to 'int'
+ type size changed from 224 to 32 (in bits)
+ and offset changed from 3264 to 384 (in bits) (by -2880 bits)
+ type of 'volatile int* const b' changed:
+ entity changed from 'volatile int* const' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 3520 to 416 (in bits) (by -3104 bits)
+ type of 'int ()* const c' changed:
+ entity changed from 'int ()* const' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 3584 to 448 (in bits) (by -3136 bits)
+ type of 'volatile int d[7][7]' changed:
+ entity changed from 'volatile int[7][7]' to 'int'
+ type size changed from 1568 to 32 (in bits)
+ and offset changed from 3648 to 480 (in bits) (by -3168 bits)
+ type of 'volatile int* const e[7]' changed:
+ entity changed from 'volatile int* const[7]' to 'int'
+ type size changed from 448 to 32 (in bits)
+ and offset changed from 5248 to 512 (in bits) (by -4736 bits)
+ type of 'int ()* const f[7]' changed:
+ entity changed from 'int ()* const[7]' to 'int'
+ type size changed from 448 to 32 (in bits)
+ and offset changed from 5696 to 544 (in bits) (by -5152 bits)
+ type of 'volatile int[7]* const g' changed:
+ entity changed from 'volatile int[7]* const' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 6144 to 576 (in bits) (by -5568 bits)
+ type of 'volatile int* const* const h' changed:
+ entity changed from 'volatile int* const* const' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 6208 to 608 (in bits) (by -5600 bits)
+ type of 'int ()* const i' changed:
+ entity changed from 'int ()* const' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 6272 to 640 (in bits) (by -5632 bits)
+ type of 'volatile int[7]* ()* const j' changed:
+ entity changed from 'volatile int[7]* ()* const' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 6336 to 672 (in bits) (by -5664 bits)
+ type of 'volatile int* ()* const k' changed:
+ entity changed from 'volatile int* ()* const' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 6400 to 704 (in bits) (by -5696 bits)
+ type of 'int ()* ()* const l' changed:
+ entity changed from 'int ()* ()* const' to 'int'
+ type size changed from 64 to 32 (in bits)
+ and offset changed from 6464 to 736 (in bits) (by -5728 bits)
+
+ [C] 'function volatile int[7]* n()' at PR30048-test-2-v0.cc:72:1 has some indirect sub-type changes:
+ return type changed:
+ entity changed from 'volatile int[7]*' to 'int'
+ type size changed from 64 to 32 (in bits)
+
+ [C] 'function volatile int* o()' at PR30048-test-2-v0.cc:74:1 has some indirect sub-type changes:
+ return type changed:
+ entity changed from 'volatile int*' to 'int'
+ type size changed from 64 to 32 (in bits)
+
+ [C] 'function int ()* p()' at PR30048-test-2-v0.cc:77: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)
+
--- /dev/null
+struct amusement {
+ // declare A as array 7 of int
+ int A[7];
+ // declare B as pointer to int
+ int *B;
+ // declare C as pointer to function (void) returning int
+ int (*C)(void );
+ // declare D as array 7 of array 7 of int
+ int D[7][7];
+ // declare E as array 7 of pointer to int
+ int *E[7];
+ // declare F as array 7 of pointer to function (void) returning int
+ int (*F[7])(void );
+ // declare G as pointer to array 7 of int
+ int (*G)[7];
+ // declare H as pointer to pointer to int
+ int **H;
+ // declare I as pointer to function (void) returning int
+ int (*I)(void );
+ // declare J as pointer to function (void) returning pointer to array 7 of int
+ int (*(*J)(void ))[7];
+ // declare K as pointer to function (void) returning pointer to int
+ int *(*K)(void );
+ // declare L as pointer to function (void) returning pointer to function
+ // (void) returning int
+ int (*(*L)(void ))(void );
+
+ // declare a as array 7 of volatile int
+ volatile int a[7];
+ // declare b as const pointer to volatile int
+ volatile int * const b;
+ // declare c as const pointer to function (void) returning int
+ int (* const c)(void );
+ // declare d as array 7 of array 7 of volatile int
+ volatile int d[7][7];
+ // declare e as array 7 of const pointer to volatile int
+ volatile int * const e[7];
+ // declare f as array 7 of const pointer to function (void) returning int
+ int (* const f[7])(void );
+ // declare g as const pointer to array 7 of volatile int
+ volatile int (* const g)[7];
+ // declare h as const pointer to const pointer to volatile int
+ volatile int * const * const h;
+ // declare i as const pointer to function (void) returning int
+ int (* const i)(void );
+ // declare j as const pointer to function (void) returning pointer to array 7
+ //of volatile int
+ volatile int (*(* const j)(void ))[7];
+ // declare k as const pointer to function (void) returning pointer to
+ //volatile int
+ volatile int *(* const k)(void );
+ // declare l as const pointer to function (void) returning pointer to
+ //function (void) returning int
+ int (*(* const l)(void ))(void );
+};
+
+struct amusement * fun(void) { return 0; }
+
+// declare M as function (void) returning int
+int M(void ) { return 0; }
+// declare N as function (void) returning pointer to array 7 of int
+int (*N(void ))[7] { return 0; }
+// declare O as function (void) returning pointer to int
+int *O(void ) { return 0; }
+// declare P as function (void) returning pointer to function (void) returning
+//int
+int (*P(void ))(void ) { return 0; }
+
+// declare m as function (void) returning int
+int m(void ) { return 0; }
+// declare n as function (void) returning pointer to array 7 of volatile int
+volatile int (*n(void ))[7] { return 0; }
+// declare o as function (void) returning pointer to volatile int
+volatile int *o(void ) { return 0; }
+// declare p as function (void) returning pointer to function (void) returning
+//int
+int (*p(void ))(void ) { return 0; }
+
--- /dev/null
+struct amusement {
+ int A;
+ int B;
+ int C;
+ int D;
+ int E;
+ int F;
+ int G;
+ int H;
+ int I;
+ int J;
+ int K;
+ int L;
+
+ int a;
+ int b;
+ int c;
+ int d;
+ int e;
+ int f;
+ int g;
+ int h;
+ int i;
+ int j;
+ int k;
+ int l;
+};
+
+struct amusement * fun() { return 0; }
+
+int M() { return 0; }
+int N() { return 0; }
+int O() { return 0; }
+int P() { return 0; }
+
+int m() { return 0; }
+int n() { return 0; }
+int o() { return 0; }
+int p() { return 0; }
--- /dev/null
+Functions changes summary: 0 Removed, 0 Changed, 0 Added function
+Variables changes summary: 0 Removed, 1 Changed, 0 Added variable
+
+1 Changed variable:
+
+ [C] 'S s' was changed at PR30048-test-v1.c:6:1:
+ size of symbol changed from 56 to 16
+ type of variable changed:
+ type size changed from 448 to 128 (in bits)
+ 5 data member deletions:
+ 'int (int)* f01', at offset 0 (in bits) at PR30048-test-v0.c:2:1
+ 'int (const int*)* f02', at offset 64 (in bits) at PR30048-test-v0.c:3:1
+ 'int (int* const)* f03', at offset 128 (in bits) at PR30048-test-v0.c:4:1
+ 'int (int* restrict)* f04', at offset 192 (in bits) at PR30048-test-v0.c:5:1
+ 'int (const int* restrict)* f05', at offset 256 (in bits) at PR30048-test-v0.c:6:1
+ 2 data member changes:
+ 'int (int* restrict const)* f06' offset changed from 320 to 0 (in bits) (by -320 bits)
+ 'int (int* restrict const)* f07' offset changed from 384 to 64 (in bits) (by -320 bits)
+
--- /dev/null
+struct S {
+ int (*f01)(int);
+ int (*f02)(const int*);
+ int (*f03)(int* const);
+ int (*f04)(int* restrict);
+ int (*f05)(const int* restrict);
+ int (*f06)(int* restrict const);
+ int (*f07)(int* const restrict);
+};
+
+struct S s;
+
--- /dev/null
+struct S {
+ int (*f06)(int* restrict const);
+ int (*f07)(int* const restrict);
+};
+
+struct S s;
underlying type 'typedef A' at qualifier-typedef-array-v0.c:1:1 changed:
entity changed from 'typedef A' to compatible type 'void*[7]'
type of 'C v_c' changed:
- entity changed from 'typedef C' to compatible type 'const volatile void*[7]'
+ entity changed from 'typedef C' to compatible type 'void* const volatile[7]'
array element type 'void* const' changed:
- 'void* const' changed to 'const volatile void*'
- type name changed from 'void* const[7]' to 'const volatile void*[7]'
+ 'void* const' changed to 'void* const volatile'
+ type name changed from 'void* const[7]' to 'void* const volatile[7]'
type size hasn't changed
type of 'C r_c' changed:
- entity changed from 'typedef C' to compatible type 'restrict const void*[7]'
+ entity changed from 'typedef C' to compatible type 'void* restrict const[7]'
array element type 'void* const' changed:
- 'void* const' changed to 'restrict const void*'
- type name changed from 'void* const[7]' to 'restrict const void*[7]'
+ 'void* const' changed to 'void* restrict const'
+ type name changed from 'void* const[7]' to 'void* restrict const[7]'
type size hasn't changed
type of 'D v_d' changed:
- entity changed from 'typedef D' to compatible type 'const volatile void*[7]'
+ entity changed from 'typedef D' to compatible type 'void* const volatile[7]'
array element type 'void* const' changed:
- 'void* const' changed to 'const volatile void*'
- type name changed from 'void* const[7]' to 'const volatile void*[7]'
+ 'void* const' changed to 'void* const volatile'
+ type name changed from 'void* const[7]' to 'void* const volatile[7]'
type size hasn't changed
type of 'D r_d' changed:
- entity changed from 'typedef D' to compatible type 'restrict const void*[7]'
+ entity changed from 'typedef D' to compatible type 'void* restrict const[7]'
array element type 'void* const' changed:
- 'void* const' changed to 'restrict const void*'
- type name changed from 'void* const[7]' to 'restrict const void*[7]'
+ 'void* const' changed to 'void* restrict const'
+ type name changed from 'void* const[7]' to 'void* restrict const[7]'
type size hasn't changed
type of 'E r_e' changed:
- entity changed from 'typedef E' to compatible type 'restrict const volatile void*[7]'
- array element type 'const volatile void*' changed:
- 'const volatile void*' changed to 'restrict const volatile void*'
- type name changed from 'const volatile void*[7]' to 'restrict const volatile void*[7]'
+ entity changed from 'typedef E' to compatible type 'void* restrict const volatile[7]'
+ array element type 'void* const volatile' changed:
+ 'void* const volatile' changed to 'void* restrict const volatile'
+ type name changed from 'void* const volatile[7]' to 'void* restrict const volatile[7]'
type size hasn't changed
type of 'F r_f' changed:
- entity changed from 'typedef F' to compatible type 'restrict const volatile void*[7]'
- array element type 'const volatile void*' changed:
- 'const volatile void*' changed to 'restrict const volatile void*'
- type name changed from 'const volatile void*[7]' to 'restrict const volatile void*[7]'
+ entity changed from 'typedef F' to compatible type 'void* restrict const volatile[7]'
+ array element type 'void* const volatile' changed:
+ 'void* const volatile' changed to 'void* restrict const volatile'
+ type name changed from 'void* const volatile[7]' to 'void* restrict const volatile[7]'
type size hasn't changed
"data/test-abidiff-exit/test-rhbz2114909-report-1.txt",
"output/test-abidiff-exit/test-rhbz2114909-report-1.txt"
},
+ {
+ "data/test-abidiff-exit/PR30048-test-v0.o",
+ "data/test-abidiff-exit/PR30048-test-v1.o",
+ "",
+ "",
+ "",
+ "--no-default-suppression",
+ abigail::tools_utils::ABIDIFF_ABI_CHANGE,
+ "data/test-abidiff-exit/PR30048-test-report-0.txt",
+ "output/test-abidiff-exit/PR30048-test-report-0.txt"
+ },
+ {
+ "data/test-abidiff-exit/PR30048-test-2-v0.o",
+ "data/test-abidiff-exit/PR30048-test-2-v1.o",
+ "",
+ "",
+ "",
+ "--no-default-suppression",
+ abigail::tools_utils::ABIDIFF_ABI_CHANGE,
+ "data/test-abidiff-exit/PR30048-test-2-report-1.txt",
+ "output/test-abidiff-exit/PR30048-test-2-report-1.txt"
+ },
#ifdef WITH_BTF
{
"data/test-abidiff-exit/btf/test0-v0.o",