[Lldb-commits] [lldb] r184262 - <rdar://problem/14194140>

Enrico Granata egranata at apple.com
Tue Jun 18 17:00:45 PDT 2013


Author: enrico
Date: Tue Jun 18 19:00:45 2013
New Revision: 184262

URL: http://llvm.org/viewvc/llvm-project?rev=184262&view=rev
Log:
<rdar://problem/14194140>

Adding support for correctly extracting children out of vector types for data formatter purposes


Modified:
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=184262&r1=184261&r2=184262&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Jun 18 19:00:45 2013
@@ -2792,7 +2792,7 @@ ValueObject::GetValueForExpressionPath_I
             }
             case '[':
             {
-                if (!root_clang_type_info.Test(ClangASTContext::eTypeIsArray) && !root_clang_type_info.Test(ClangASTContext::eTypeIsPointer)) // if this is not a T[] nor a T*
+                if (!root_clang_type_info.Test(ClangASTContext::eTypeIsArray) && !root_clang_type_info.Test(ClangASTContext::eTypeIsPointer) && !root_clang_type_info.Test(ClangASTContext::eTypeIsVector)) // if this is not a T[] nor a T*
                 {
                     if (!root_clang_type_info.Test(ClangASTContext::eTypeIsScalar)) // if this is not even a scalar...
                     {
@@ -2914,7 +2914,7 @@ ValueObject::GetValueForExpressionPath_I
                         {
                             if (ClangASTType::GetMinimumLanguage(root->GetClangAST(),
                                                                  root->GetClangType()) == eLanguageTypeObjC
-                                && ClangASTContext::IsPointerType(ClangASTType::GetPointeeType(root->GetClangType())) == false
+                                && pointee_clang_type_info.AllClear(ClangASTContext::eTypeIsPointer)
                                 && root->HasSyntheticValue()
                                 && options.m_no_synthetic_children == false)
                             {
@@ -2937,7 +2937,7 @@ ValueObject::GetValueForExpressionPath_I
                             }
                         }
                     }
-                    else if (ClangASTContext::IsScalarType(root_clang_type))
+                    else if (root_clang_type_info.Test(ClangASTContext::eTypeIsScalar))
                     {
                         root = root->GetSyntheticBitFieldChild(index, index, true);
                         if (!root.get())
@@ -2955,6 +2955,23 @@ ValueObject::GetValueForExpressionPath_I
                             return root;
                         }
                     }
+                    else if (root_clang_type_info.Test(ClangASTContext::eTypeIsVector))
+                    {
+                        root = root->GetChildAtIndex(index, true);
+                        if (!root.get())
+                        {
+                            *first_unparsed = expression_cstr;
+                            *reason_to_stop = ValueObject::eExpressionPathScanEndReasonNoSuchChild;
+                            *final_result = ValueObject::eExpressionPathEndResultTypeInvalid;
+                            return ValueObjectSP();
+                        }
+                        else
+                        {
+                            *first_unparsed = end+1; // skip ]
+                            *final_result = ValueObject::eExpressionPathEndResultTypePlain;
+                            continue;
+                        }
+                    }
                     else if (options.m_no_synthetic_children == false)
                     {
                         if (root->HasSyntheticValue())

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=184262&r1=184261&r2=184262&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Jun 18 19:00:45 2013
@@ -2996,6 +2996,11 @@ ClangASTContext::GetTypeInfo
                 break;
 
             case clang::BuiltinType::ObjCSel:
+                if (ast && pointee_or_element_clang_type)
+                    *pointee_or_element_clang_type = ast->CharTy.getAsOpaquePtr();
+                builtin_type_flags |= eTypeIsPointer | eTypeIsObjC;
+                break;
+
             case clang::BuiltinType::Bool:
             case clang::BuiltinType::Char_U:
             case clang::BuiltinType::UChar:





More information about the lldb-commits mailing list