[Dwarf-Discuss] EXTERNAL: Corner-cases with bitfields

Todd Allen todd.allen@concurrent-rt.com
Mon May 9 23:28:19 GMT 2022


On Mon, May 09, 2022 at 04:09:59PM -0700, Michael Eager wrote:
> On 5/9/22 16:00, Todd Allen via Dwarf-Discuss wrote:
> > I suppose, if you didn't want to submit an issue, another solution would be to
> > require the necessary tags & attributes in the ABI itself.  We already expect
> > ABI documents to provide things like register values, CFI initial values, and
> > some more esoteric stuff (augmentations, non-standard endianity & isa).  An ABI
> > that required descriptions in ABI-specific situations like these two seems
> > reasonable to me.  And it places no burden on compilers for other ABI's.
> 
> This creates the situation where there are two definitions for a DWARF
> attribute, one in an ABI and a different one in the DWARF Spec.  We want to
> avoid situations where one producer says "I'm following DWARF" and another
> "I'm following the ABI".  That makes interoperability difficult.
> 
> The information you mention in an ABI is not in the DWARF Spec.
> 

I don't know that it's quite that bad.  The ABI could say that DW_AT_bit_size
*also* implies that the field is a bit field for ABI purposes.  That doesn't
change the meaning from the DWARF specification; it merely adds to it.  Mind
you, I think an explicit DW_AT_bit_field (or something like that) is better.

Also, while the DWARF standard is intentionally permissive, an ABI need not be.
They could mandate either of the above solutions, and also mandate descriptions
of anonymous 0-sized fields.  (Unless there's a better, more direct
description for that case.)

-- 
Todd Allen
Concurrent Real-Time



More information about the Dwarf-discuss mailing list