binutils-gdb/libctf/testsuite/libctf-writable
Nick Alcock 2ba5ec13b2 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.
2024-04-19 16:14:46 +01:00
..
error-propagation.c libctf: propagate errors from parents correctly 2023-04-08 16:07:17 +01:00
error-propagation.lk libctf: propagate errors from parents correctly 2023-04-08 16:07:17 +01:00
libctf-bitfield-name-lookup.c libctf: fix name lookup in dicts containing base-type bitfields 2024-04-19 16:14:46 +01:00
libctf-bitfield-name-lookup.lk libctf: fix name lookup in dicts containing base-type bitfields 2024-04-19 16:14:46 +01:00
libctf-errors.c libctf: fix uninitialized variables in testsuite 2024-03-11 17:16:12 +00:00
libctf-errors.lk libctf: check for problems with error returns 2023-10-18 12:41:00 +01:00
parent-child-dtd-crash-lib.c libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-enum.c libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-enum.lk libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-enumerator.c libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-enumerator.lk libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-member-encoded.c libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-member-encoded.lk libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-member-offset.c libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-member-offset.lk libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-set-array.c libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-set-array.lk libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-struct.c libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-struct.lk libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-union.c libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
parent-child-dtd-union.lk libctf: fix creation-time parent/child dict confusions 2023-10-20 18:09:54 +01:00
pptrtab-writable-page-deep-lookup.c libctf, lookup: fix bounds of pptrtab lookup 2021-09-27 20:31:26 +01:00
pptrtab-writable-page-deep-lookup.lk libctf, lookup: fix bounds of pptrtab lookup 2021-09-27 20:31:26 +01:00
pptrtab.c libctf, testsuite: fix various warnings in tests 2021-09-27 20:31:26 +01:00
pptrtab.lk
reserialize-strtab-corruption.c libctf, testsuite: fix various warnings in tests 2021-09-27 20:31:26 +01:00
reserialize-strtab-corruption.lk
symtypetab-nonlinker-writeout.c libctf, testsuite: fix various warnings in tests 2021-09-27 20:31:26 +01:00
symtypetab-nonlinker-writeout.lk
writable.exp Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30