diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2023-12-18 18:27:44 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2024-04-19 16:14:46 +0100 |
commit | 2ba5ec13b20a927666096dd7d6df22b845dcd475 (patch) | |
tree | f2d56811c8c390f5c38abcc039ae127c3deb3c9d /mkdep | |
parent | 54a0219150d9dd2b0034e9682072900d4ec403b3 (diff) | |
download | gdb-2ba5ec13b20a927666096dd7d6df22b845dcd475.zip gdb-2ba5ec13b20a927666096dd7d6df22b845dcd475.tar.gz gdb-2ba5ec13b20a927666096dd7d6df22b845dcd475.tar.bz2 |
libctf: fix name lookup in dicts containing base-type bitfields
The intent of the name lookup code was for lookups to yield non-bitfield
basic types except if none existed with a given name, and only then
return bitfield types with that name. Unfortunately, the code as
written only does this if the base type has a type ID higher than all
bitfield types, which is most unlikely (the opposite is almost always
the case).
Adjust it so that what ends up in the name table is the highest-width
zero-offset type with a given name, if any such exist, and failing that
the first type with that name we see, no matter its offset. (We don't
define *which* bitfield type you get, after all, so we might as well
just stuff in the first we find.)
Reported by Stephen Brennan <stephen.brennan@oracle.com>.
libctf/
* ctf-open.c (init_types): Modify to allow some lookups during open;
detect bitfield name reuse and prefer less bitfieldy types.
* testsuite/libctf-writable/libctf-bitfield-name-lookup.*: New test.
Diffstat (limited to 'mkdep')
0 files changed, 0 insertions, 0 deletions