Path from Ashok Thirumurthi:
The attached patch adds eValueTypeVector to lldb_private::Value. The nested struct Vector is patterned after RegisterValue::m_data.buffer. This change to Value allows ClangExpressionDeclMap::LookupDecl to return vector register data for consumption by InterpreterStackFrame::ResolveValue. Note that ResolveValue was tweaked slightly to allocate enough memory for vector registers.
An immediate result of this patch is that "expr $xmm0" generates the same results on Linux as on the Mac, which is good enough for TestRegisters.py. In addition, the log of m_memory.PrintData(data_region.m_base, data_region.m_extent) shows that the register content has been resolved successfully. On the other hand, the output is glaringly empty:
runCmd: expr $xmm0
output: (unsigned char __attribute__((ext_vector_type(16)))) $0 = {}
Expecting sub string: vector_type
Matched
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167033 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 940be04..f8304b9 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -1083,8 +1083,13 @@
Value ret;
ret.SetContext(Value::eContextTypeRegisterInfo, reg_info);
- if (!reg_value.GetScalarValue(ret.GetScalar()))
- return Value();
+ if (reg_info->encoding == eEncodingVector)
+ {
+ if (ret.SetVectorBytes((uint8_t *)reg_value.GetBytes(), reg_value.GetByteSize(), reg_value.GetByteOrder()))
+ ret.SetScalarFromVector();
+ }
+ else if (!reg_value.GetScalarValue(ret.GetScalar()))
+ return Value();
return ret;
}