Jakub Jelinek wrote:
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.
  

I agree completely with Jakub. Defining multiple "float" types that have varying byte-sizes, bit-sizes, and bit-offsets seems like a big mistake to me.

The debugger has to know the ABI conventions for the target platform. It's unavoidable. Hopefully,  for ISVs like us, the ABI is "standard" and all of the compilers for a given platform follow the ABI conventions. Knowing the ABI conventions for the platform is especially important when the debugger is asked to call functions in the target process, which is something that DWARF does not describe at all. Passing float and double actual parameters to target function requires the debugger know if the values goes on the stack, in a register, or is split between the stack and a register (yes, this does happen).

Cheers, John D.

	Jakub
_______________________________________________
Dwarf-Discuss mailing list
Dwarf-Discuss@lists.dwarfstd.org
http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org

  
_______________________________________________
Dwarf-Discuss mailing list
Dwarf-Discuss@lists.dwarfstd.org
http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org

Reply via email to