Support floating point values in 128-bit SSE vector registers
authorAdrian Prantl <aprantl@apple.com>
Tue, 8 Mar 2016 18:35:09 +0000 (18:35 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 8 Mar 2016 18:35:09 +0000 (18:35 +0000)
commit6aeba89e8986c0fd25acd727599656153dee904c
tree94f4145a7aac61bcdff592936935f2252690671a
parent2a7062440380fb3e94d9dca5f0d8061982b58997
Support floating point values in 128-bit SSE vector registers

The System-V x86_64 ABI requires floating point values to be passed
in 128-but SSE vector registers (xmm0, ...). When printing such a
variable this currently yields an <invalid load address>.

This patch makes LLDB's DWARF expression evaluator accept 128-bit
registers as scalars. It also relaxes the check that the size of the
result of the DWARF expression be equal to the size of the variable to a
greater-than. DWARF defers to the ABI how smaller values are being placed
in a larger register.

Implementation note: I found the code in Value::SetContext() that changes
the m_value_type after the fact to be questionable. I added a sanity check
that the Value's memory buffer has indeed been written to (this is
necessary, because we may have a scalar value in a vector register), but
really I feel like this is the wrong place to be setting it.

Reviewed by Greg Clayton.

http://reviews.llvm.org/D17897
rdar://problem/24944340

llvm-svn: 262947
lldb/include/lldb/Core/Value.h
lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
lldb/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
lldb/source/Core/RegisterValue.cpp
lldb/source/Expression/Materializer.cpp