On Wed, Oct 08, 2025 at 10:13:42AM +0100, Yury Khrustalev wrote:
> On Wed, Oct 08, 2025 at 10:49:21AM +0200, Jakub Jelinek wrote:
> > On Wed, Oct 08, 2025 at 09:35:06AM +0100, Yury Khrustalev wrote:
> > > I think we have 2 things here:
> > > 
> > > 1. Detect situation when we work with something like svbool_t
> > > 2. Decide what to do in this case (i.e. what attributes to add to
> > > whatever DIEs).
> > > 
> > > I agree on the latter that we should have DW_AT_bit_stride in the array
> > > type but I think DW_AT_bit_size 1 in the base type (element type) would
> > > not solve the issue with GDB reading 1 byte for each vector element
> > > because it really looks at the type description at this point.
> > 
> > I think both are desirable from the DWARF POV.  What exactly GDB does with
> > it is a question on GDB.
> 
> Just to confirm, you don't want to add DW_AT_bit_stride to DW_TAG_array_type
> entry and *instead* add DW_AT_bit_size 1 in the base type? And if GDB
> still doesn't work, then fix it on the GDB side?

I want both, DW_AT_bit_size 1 on the DW_AT_type referenced DIE (made up
anyway, it isn't reusing the normal bool DW_TAG_base_type) and
DW_AT_bit_stride 1 on the DW_TAG_array_type with DW_AT_GNU_vector flag.
And only if the vector type is the packed boolean vector, not for other
cases.

        Jakub

Reply via email to