[Dwarf-discuss] ISSUE: vector types. V2

Pedro Alves pedro@palves.net
Wed Apr 12 12:04:22 GMT 2023

On 2023-04-06 12:03 p.m., Jakub Jelinek via Dwarf-discuss wrote:
>> define fixed-length vectors as special built-in types or is the goal to support
>> arbitrary vector lengths?
>> It might be good to maintain an upper limit on the size of a stack entry.
> I think it is better if consumers simply have some upper limit on their own,
> either hard limit, where for anything above that limit evaluation of the
> DWARF expression yields an optimized out state, or soft limit, where
> elements smaller than limit are encoded in DWARF stack directly (say as
> union of the various types known to fit under the limit) and for
> larger elements just encode them as reference to malloced data or something
> similar.

I agree with this.  A consumer could even use other implementation strategies, like 
it could have a single large byte buffer where all stack elements are incrementally allocated
on as the stack grows, and rolled back when the stack element is popped, like local variables
in a C runtime stack.  In such an implementation, stack entries would have variable size, and
you wouldn't need to care about per-stack-entry size at all, you'd just make sure that
the whole-stack-size limit isn't breached.

More information about the Dwarf-discuss mailing list