HomeFreeBSD

ctfconvert: Give bitfield types names distinct from the base type

Description

ctfconvert: Give bitfield types names distinct from the base type

CTF integers have an explicit width and so can be used to represent
bitfields. Bitfield types emitted by ctfconvert(1) share the name of
the base integer type, so a struct field with type "unsigned int : 15"
will have a type named "unsigned int".

To avoid ambiguity when looking up types by name, add a suffix to names
of bitfield types to distinguish them from the base type. Then, if
ctfmerge happens to order bitfield types before the corresponding base
type in a CTF file, a name lookup will return the base type, which is
always going to be the desired behaviour.

PR: 265403
Reported by: cy
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Details

Provenance
markjAuthored on Aug 3 2022, 12:32 AM
Parents
rG6a05f1438145: dtrace tests: Rename some test type names to avoid a conflict
Branches
Unknown
Tags
Unknown