mirror of
git://sourceware.org/git/libabigail.git
synced 2025-03-05 14:18:11 +00:00
Bug 22122 - Fail to represent 'const array'
When computing canonical DIEs, the DWARF reader mistakenly represents 'array of const' and 'const array' the same. This patch fixes that. * src/abg-dwarf-reader.cc (die_is_array_type): Define new static function. (die_is_pointer_or_reference_type): Also test that the DIE can be an array. * tests/data/test-read-dwarf/PR22122-libftdc.so: New binary test input. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: New reference output. * tests/data/Makefile.am: Add the two new test files above to source distribution. * tests/test-read-dwarf.cc (in_out_specs): Run this test harness over the new test input. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
3e4c5cafe2
commit
74105ff84b
@ -8629,14 +8629,34 @@ die_is_reference_type(Dwarf_Die* die)
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Test if a DIE represents a pointer or reference type.
|
||||
/// Test if a DIE represents an array type.
|
||||
///
|
||||
/// @param die the die to consider.
|
||||
///
|
||||
/// @return true iff @p die represents an array type.
|
||||
static bool
|
||||
die_is_array_type(Dwarf_Die* die)
|
||||
{
|
||||
if (!die)
|
||||
return false;
|
||||
|
||||
int tag = dwarf_tag(die);
|
||||
if (tag == DW_TAG_array_type)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Test if a DIE represents a pointer, reference or array 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(Dwarf_Die* die)
|
||||
{return (die_is_pointer_type(die) || die_is_reference_type(die));}
|
||||
{return (die_is_pointer_type(die)
|
||||
|| die_is_reference_type(die)
|
||||
|| die_is_array_type(die));}
|
||||
|
||||
/// Test if a DIE represents a class type.
|
||||
///
|
||||
|
@ -376,6 +376,8 @@ test-read-dwarf/test24-drop-fns-0.suppr \
|
||||
test-read-dwarf/test24-drop-fns.cc \
|
||||
test-read-dwarf/PR22015-libboost_iostreams.so \
|
||||
test-read-dwarf/PR22015-libboost_iostreams.so.abi \
|
||||
test-read-dwarf/PR22122-libftdc.so \
|
||||
test-read-dwarf/PR22122-libftdc.so.abi \
|
||||
\
|
||||
test-annotate/test0.abi \
|
||||
test-annotate/test1.abi \
|
||||
|
BIN
tests/data/test-read-dwarf/PR22122-libftdc.so
Normal file
BIN
tests/data/test-read-dwarf/PR22122-libftdc.so
Normal file
Binary file not shown.
7551
tests/data/test-read-dwarf/PR22122-libftdc.so.abi
Normal file
7551
tests/data/test-read-dwarf/PR22122-libftdc.so.abi
Normal file
File diff suppressed because it is too large
Load Diff
@ -222,6 +222,12 @@ InOutSpec in_out_specs[] =
|
||||
"data/test-read-dwarf/PR22015-libboost_iostreams.so.abi",
|
||||
"output/test-read-dwarf/PR22015-libboost_iostreams.so.abi",
|
||||
},
|
||||
{
|
||||
"data/test-read-dwarf/PR22122-libftdc.so",
|
||||
"",
|
||||
"data/test-read-dwarf/PR22122-libftdc.so.abi",
|
||||
"output/test-read-dwarf/PR22122-libftdc.so.abi",
|
||||
},
|
||||
// This should be the last entry.
|
||||
{NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user