[Dwarf-Discuss] Representing the location of smaller values in vector registers

Jakub Jelinek jakub at redhat.com
Wed Mar 9 09:33:23 PST 2016


On Wed, Mar 09, 2016 at 08:36:44AM -0800, Michael Eager wrote:
> How is the "float" type described?
> 
> A value which is contained in a register larger than the size of
> the value should be described by a DW_TAG_base_type.  (DWARF 4,
> Sect. 5.1, bottom of page 75).
> 
> For a 32-bit float in a 128-bit container, use something like the following:
> 
>   DW_TAG_base_type
>     DW_AT_name "float"
>     DW_AT_encoding DW_ATE_float
>     DW_AT_byte_size 16
>     DW_AT_bit_size 32
>     DW_AT_data_bit_offset 0
> 
> Note that there is no requirement that the names on base types
> be unique.  There may be more than one with the name "float".

I don't think this can really work.  A particular variable (etc., whatever
has type) can have just one type, while whether it lives in a larger
container or not really depends on where the value lives.
The same variable could live in one .debug_loc range in memory
(where it certainly can't pretend it lives in a larger container, because it
does not, it is 32-bit there), or when in some other range it lives in
a general purpose register (which can be 32-bit or 64-bit and either fits in
there exactly, or is passed in the low bits of that), or in %xmm* register
(128-bit container, but, actually sometimes 256-bit and other times 512-bit
container).  I'd say LLDB is just broken to complain about this.  The ABI
specifies what it means when a float lives in memory, or in GPRs, or in
XMM/YMM/ZMM registers.

	Jakub


More information about the Dwarf-Discuss mailing list