<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>It doesn’t use anything OSX-specific. That error looks like the expression command is having some issues with “foo” more than anything</div><div>On Mac, the same test runs just fine with ToT LLDB and a fairly recent checkout of Clang</div><div>As a first step, you might want to mark it as @expectedFailureLinux until we figure it out</div><div>With that said, getting an expression parser log and sending it to Sean might be a start.</div><div><br></div><div apple-content-edited="true"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="font-size: medium; orphans: 2; widows: 2; border-collapse: separate; border-spacing: 0px;"><span style="font-size: 12px; orphans: auto; widows: auto;">Enrico Granata</span><br style="font-size: 12px; orphans: auto; widows: auto;"><span style="font-size: 12px; orphans: auto; widows: auto;">✉ egranata@</span><font color="#ff2600" style="font-size: 12px; orphans: auto; widows: auto;"></font><span style="font-size: 12px; orphans: auto; widows: auto;">.com</span><br style="font-size: 12px; orphans: auto; widows: auto;"><span style="font-size: 12px; orphans: auto; widows: auto;">✆ 27683</span></div></div>
</div>
<br><div><div>On May 2, 2013, at 2:57 PM, "Malea, Daniel" <<a href="mailto:daniel.malea@intel.com">daniel.malea@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi Enrico, this test seems to be failing with:<br><br>runCmd: p *(int (*)[3])foo<br>runCmd failed!<br>error: use of undeclared identifier 'foo'<br>error: 1 errors parsing expression<br><br><br>FAIL<br><br>Executing tearDown hook: def cleanup():<br> self.runCmd('type format delete hex', check=False)<br> self.runCmd('type summary clear', check=False)<br><br><br><br>Can you take a look? It might need to be marked @expectedFailureLinux or<br>the like, but I'm not sure if it uses anything Mac-OS-X specific.<br><br><br>Thanks,<br>Dan<br><br><br>On 2013-05-02 2:54 PM, "Enrico Granata" <<a href="mailto:egranata@apple.com">egranata@apple.com</a>> wrote:<br><br><blockquote type="cite">Author: enrico<br>Date: Thu May 2 13:54:54 2013<br>New Revision: 180938<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=180938&view=rev">http://llvm.org/viewvc/llvm-project?rev=180938&view=rev</a><br>Log:<br><<a href="rdar://problem/13338477">rdar://problem/13338477</a>><br><br>clang sugarcoats expressions of the sort *(int (*)[3])foo where foo is an<br>int* saying that their type class is Paren<br>This checkin updates our lookup tables to properly desugar Paren into the<br>actual type of interest<br><br><br>Added:<br> lldb/trunk/test/functionalities/data-formatter/rdar-13338477/<br> lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Makefile<br><br>lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Test-rdar-133<br>38477.py<br> lldb/trunk/test/functionalities/data-formatter/rdar-13338477/main.cpp<br>Modified:<br> lldb/trunk/source/Symbol/ClangASTContext.cpp<br> lldb/trunk/source/Symbol/ClangASTType.cpp<br><br>Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp<br>URL:<span class="Apple-converted-space"> </span><br><a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTConte">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTConte</a><br>xt.cpp?rev=180938&r1=180937&r2=180938&view=diff<br>==========================================================================<br>====<br>--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)<br>+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu May 2 13:54:54 2013<br>@@ -170,6 +170,9 @@ GetCompleteQualType (clang::ASTContext *<br> case clang::Type::Elaborated:<br> return GetCompleteQualType (ast,<br>cast<ElaboratedType>(qual_type)->getNamedType(), allow_completion);<br><br>+ case clang::Type::Paren:<br>+ return GetCompleteQualType (ast,<br>cast<ParenType>(qual_type)->desugar(), allow_completion);<br>+<br> default:<br> break;<br> }<br>@@ -1454,6 +1457,9 @@ ClangASTContext::SetHasExternalStorage (<br> case clang::Type::Elaborated:<br> return ClangASTContext::SetHasExternalStorage<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),<br>has_extern);<br><br>+ case clang::Type::Paren:<br>+ return ClangASTContext::SetHasExternalStorage<br>(cast<ParenType>(qual_type)->desugar().getAsOpaquePtr(), has_extern);<br>+<br> default:<br> break;<br> }<br>@@ -2865,6 +2871,9 @@ ClangASTContext::GetNumTemplateArguments<br> case clang::Type::Elaborated:<br> return ClangASTContext::GetNumTemplateArguments (ast,<br>cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br><br>+ case clang::Type::Paren:<br>+ return ClangASTContext::GetNumTemplateArguments(ast,<br>cast<ParenType>(qual_type)->desugar().getAsOpaquePtr());<br>+ <br> default:<br> break;<br> }<br>@@ -2941,6 +2950,9 @@ ClangASTContext::GetTemplateArgument (cl<br><br> case clang::Type::Elaborated:<br> return ClangASTContext::GetTemplateArgument (ast,<br>cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),<br>arg_idx, kind);<br>+ <br>+ case clang::Type::Paren:<br>+ return ClangASTContext::GetTemplateArgument(ast,<br>cast<ParenType>(qual_type)->desugar().getAsOpaquePtr(), arg_idx, kind);<br><br> default:<br> break;<br>@@ -3065,6 +3077,12 @@ ClangASTContext::GetTypeInfo<br> return ClangASTContext::GetTypeInfo<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),<br> ast,<br><br>pointee_or_element_clang_type);<br>+<br>+ case clang::Type::Paren:<br>+ return<span class="Apple-converted-space"> </span><br>ClangASTContext::GetTypeInfo(llvm::cast<clang::ParenType>(qual_type)->desu<br>gar().getAsOpaquePtr(),<br>+ ast,<br>+ <br>pointee_or_element_clang_type);<br>+<br> case clang::Type::FunctionProto: return<br>eTypeIsFuncPrototype | eTypeHasValue;<br> case clang::Type::FunctionNoProto: return<br>eTypeIsFuncPrototype | eTypeHasValue;<br> case clang::Type::InjectedClassName: return 0;<br>@@ -3155,7 +3173,8 @@ ClangASTContext::IsAggregateType (clang_<br> return ClangASTContext::IsAggregateType<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br> case clang::Type::Typedef:<br> return ClangASTContext::IsAggregateType<br>(cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaqueP<br>tr());<br>-<br>+ case clang::Type::Paren:<br>+ return ClangASTContext::IsAggregateType<br>(cast<ParenType>(qual_type)->desugar().getAsOpaquePtr());<br> default:<br> break;<br> }<br>@@ -3333,6 +3352,12 @@ ClangASTContext::GetNumChildren (clang::<br><br>omit_empty_base_classes);<br> break;<br><br>+ case clang::Type::Paren:<br>+ num_children = ClangASTContext::GetNumChildren(ast,<br>+ <br>llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ <br>omit_empty_base_classes);<br>+<br>+ break;<br> default:<br> break;<br> }<br>@@ -3383,6 +3408,9 @@ ClangASTContext::GetNumDirectBaseClasses<br> count = ClangASTContext::GetNumDirectBaseClasses (ast,<br>cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br> break;<br><br>+ case clang::Type::Paren:<br>+ return ClangASTContext::GetNumDirectBaseClasses(ast,<br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());<br>+ <br> default:<br> break;<br> }<br>@@ -3418,6 +3446,10 @@ ClangASTContext::GetNumVirtualBaseClasse<br> count = ClangASTContext::GetNumVirtualBaseClasses (ast,<br>cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br> break;<br><br>+ case clang::Type::Paren:<br>+ count = ClangASTContext::GetNumVirtualBaseClasses(ast,<br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());<br>+ break;<br>+<br> default:<br> break;<br> }<br>@@ -3462,6 +3494,10 @@ ClangASTContext::GetNumFields (clang::AS<br> count = ClangASTContext::GetNumFields (ast,<br>cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br> break;<br><br>+ case clang::Type::Paren:<br>+ count = ClangASTContext::GetNumFields(ast,<br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());<br>+ break;<br>+ <br> case clang::Type::ObjCObject:<br> case clang::Type::ObjCInterface:<br> if (GetCompleteQualType (ast, qual_type))<br>@@ -3562,6 +3598,12 @@ ClangASTContext::GetDirectBaseClassAtInd<br> idx,<br><br>bit_offset_ptr);<br><br>+ case clang::Type::Paren:<br>+ return ClangASTContext::GetDirectBaseClassAtIndex (ast,<br>+ <br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ idx,<br>+ <br>bit_offset_ptr);<br>+ <br> default:<br> break;<br> }<br>@@ -3621,6 +3663,12 @@ ClangASTContext::GetVirtualBaseClassAtIn<br> idx,<br><br>bit_offset_ptr);<br><br>+ case clang::Type::Paren:<br>+ return ClangASTContext::GetVirtualBaseClassAtIndex (ast,<br>+ <br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ idx,<br>+ <br>bit_offset_ptr);<br>+<br> default:<br> break;<br> }<br>@@ -3771,6 +3819,15 @@ ClangASTContext::GetFieldAtIndex (clang:<br><br>bitfield_bit_size_ptr,<br> is_bitfield_ptr);<br><br>+ case clang::Type::Paren:<br>+ return ClangASTContext::GetFieldAtIndex (ast,<br>+ <br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ idx,<br>+ name,<br>+ bit_offset_ptr,<br>+ <br>bitfield_bit_size_ptr,<br>+ is_bitfield_ptr);<br>+ <br> default:<br> break;<br> }<br>@@ -3950,7 +4007,7 @@ ClangASTContext::GetNumPointeeChildren (<br> case clang::Type::FunctionProto: return 0; // When we<br>function pointers, they have no children...<br> case clang::Type::FunctionNoProto: return 0; // When we<br>function pointers, they have no children...<br> case clang::Type::UnresolvedUsing: return 0;<br>- case clang::Type::Paren: return 0;<br>+ case clang::Type::Paren: return<br>ClangASTContext::GetNumPointeeChildren<br>(cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());<br> case clang::Type::Typedef: return<br>ClangASTContext::GetNumPointeeChildren<br>(cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaqueP<br>tr());<br> case clang::Type::Elaborated: return<br>ClangASTContext::GetNumPointeeChildren<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br> case clang::Type::TypeOfExpr: return 0;<br>@@ -4494,7 +4551,25 @@ ClangASTContext::GetChildClangTypeAtInde<br> child_bitfield_bit_size,<br> child_bitfield_bit_offset,<br> child_is_base_class,<br>- child_is_deref_of_parent);<br>+ child_is_deref_of_parent);<br>+ <br>+ case clang::Type::Paren:<br>+ return GetChildClangTypeAtIndex (exe_ctx,<br>+ ast,<br>+ parent_name,<br>+ <br>llvm::cast<clang::ParenType>(parent_qual_type)->desugar().getAsOpaquePtr()<br>,<br>+ idx,<br>+ transparent_pointers,<br>+ omit_empty_base_classes,<br>+ ignore_array_bounds,<br>+ child_name,<br>+ child_byte_size,<br>+ child_byte_offset,<br>+ child_bitfield_bit_size,<br>+ child_bitfield_bit_offset,<br>+ child_is_base_class,<br>+ child_is_deref_of_parent);<br>+<br><br> default:<br> break;<br>@@ -4945,6 +5020,13 @@ ClangASTContext::GetIndexOfChildMemberWi<br> name,<br><br>omit_empty_base_classes,<br> child_indexes);<br>+ <br>+ case clang::Type::Paren:<br>+ return GetIndexOfChildMemberWithName (ast,<br>+ <br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ name,<br>+ <br>omit_empty_base_classes,<br>+ child_indexes);<br><br> default:<br> break;<br>@@ -5159,6 +5241,12 @@ ClangASTContext::GetIndexOfChildWithName<br> name,<br> omit_empty_base_classes);<br><br>+ case clang::Type::Paren:<br>+ return GetIndexOfChildWithName (ast,<br>+ <br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ name,<br>+ omit_empty_base_classes);<br>+<br> case clang::Type::Typedef:<br> return GetIndexOfChildWithName (ast,<br><br>cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePt<br>r(),<br>@@ -5235,6 +5323,7 @@ ClangASTContext::GetDeclContextForType (<br> case clang::Type::Enum: return<br>cast<EnumType>(qual_type)->getDecl();<br> case clang::Type::Typedef: return<br>ClangASTContext::GetDeclContextForType<br>(cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaqueP<br>tr());<br> case clang::Type::Elaborated: return<br>ClangASTContext::GetDeclContextForType<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br>+ case clang::Type::Paren: return<br>ClangASTContext::GetDeclContextForType<br>(cast<ParenType>(qual_type)->desugar().getAsOpaquePtr());<br> case clang::Type::TypeOfExpr: break;<br> case clang::Type::TypeOf: break;<br> case clang::Type::Decltype: break;<br>@@ -5246,7 +5335,6 @@ ClangASTContext::GetDeclContextForType (<br> case clang::Type::SubstTemplateTypeParmPack:break;<br> case clang::Type::PackExpansion: break;<br> case clang::Type::UnresolvedUsing: break;<br>- case clang::Type::Paren: break;<br> case clang::Type::Attributed: break;<br> case clang::Type::Auto: break;<br> case clang::Type::InjectedClassName: break;<br>@@ -5827,7 +5915,13 @@ ClangASTContext::IsPossibleDynamicType (<br><br>dynamic_pointee_type,<br><br>check_cplusplus,<br><br>check_objc);<br>- <br>+<br>+ case clang::Type::Paren:<br>+ return ClangASTContext::IsPossibleDynamicType (ast,<br>+ <br>cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ <br>dynamic_pointee_type,<br>+ <br>check_cplusplus,<br>+ <br>check_objc);<br> default:<br> break;<br> }<br>@@ -5983,6 +6077,9 @@ ClangASTContext::IsReferenceType (clang_<br> return ClangASTContext::IsReferenceType<br>(cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaqueP<br>tr());<br> case clang::Type::Elaborated:<br> return ClangASTContext::IsReferenceType<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br>+ case clang::Type::Paren:<br>+ return ClangASTContext::IsReferenceType<br>(cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());<br>+<br> default:<br> break;<br> }<br>@@ -6038,6 +6135,8 @@ ClangASTContext::IsPointerOrReferenceTyp<br> return ClangASTContext::IsPointerOrReferenceType<br>(cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaqueP<br>tr());<br> case clang::Type::Elaborated:<br> return ClangASTContext::IsPointerOrReferenceType<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br>+ case clang::Type::Paren:<br>+ return ClangASTContext::IsPointerOrReferenceType<br>(cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());<br> default:<br> break;<br> }<br>@@ -6107,6 +6206,8 @@ ClangASTContext::IsPointerType (clang_ty<br> return ClangASTContext::IsPointerType<br>(cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaqueP<br>tr(), target_type);<br> case clang::Type::Elaborated:<br> return ClangASTContext::IsPointerType<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),<br>target_type);<br>+ case clang::Type::Paren:<br>+ return ClangASTContext::IsPointerType<br>(cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>target_type);<br> default:<br> break;<br> }<br>@@ -6354,6 +6455,8 @@ ClangASTContext::IsFunctionPointerType (<br> return ClangASTContext::IsFunctionPointerType<br>(cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaqueP<br>tr());<br> case clang::Type::Elaborated:<br> return ClangASTContext::IsFunctionPointerType<br>(cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());<br>+ case clang::Type::Paren:<br>+ return ClangASTContext::IsFunctionPointerType<br>(cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());<br><br> case clang::Type::LValueReference:<br> case clang::Type::RValueReference:<br>@@ -6390,6 +6493,9 @@ ClangASTContext::GetArraySize (clang_typ<br><br> case clang::Type::Elaborated:<br> return<br>ClangASTContext::GetArraySize(cast<ElaboratedType>(qual_type)->getNamedTyp<br>e().getAsOpaquePtr());<br>+<br>+ case clang::Type::Paren:<br>+ return<br>ClangASTContext::GetArraySize(cast<clang::ParenType>(qual_type)->desugar()<br>.getAsOpaquePtr());<br><br> default:<br> break;<br>@@ -6455,6 +6561,11 @@ ClangASTContext::GetAsArrayType (clang_t<br> member_type,<br> size,<br> is_incomplete);<br>+ case clang::Type::Paren:<br>+ return ClangASTContext::GetAsArrayType<br>(cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ member_type,<br>+ size,<br>+ is_incomplete);<br> }<br> return 0;<br>}<br><br>Modified: lldb/trunk/source/Symbol/ClangASTType.cpp<br>URL:<span class="Apple-converted-space"> </span><br>http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.<br>cpp?rev=180938&r1=180937&r2=180938&view=diff<br>==========================================================================<br>====<br>--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)<br>+++ lldb/trunk/source/Symbol/ClangASTType.cpp Thu May 2 13:54:54 2013<br>@@ -251,7 +251,8 @@ ClangASTType::GetTypeClass (clang::ASTCo<br> case clang::Type::Enum: return<br>lldb::eTypeClassEnumeration;<br> case clang::Type::Typedef: return<br>lldb::eTypeClassTypedef;<br> case clang::Type::UnresolvedUsing: break;<br>- case clang::Type::Paren: break;<br>+ case clang::Type::Paren:<br>+ return ClangASTType::GetTypeClass (ast_context,<br>llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr());<br> case clang::Type::Elaborated:<br> return ClangASTType::GetTypeClass (ast_context,<br>llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePt<br>r());<br><br>@@ -464,10 +465,12 @@ ClangASTType::GetEncoding (clang_type_t<br> case clang::Type::Elaborated:<br> return ClangASTType::GetEncoding<br>(llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaqueP<br>tr(), count);<br><br>+ case clang::Type::Paren:<br>+ return ClangASTType::GetEncoding<br>(llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>count);<br>+ <br> case clang::Type::DependentSizedArray:<br> case clang::Type::DependentSizedExtVector:<br> case clang::Type::UnresolvedUsing:<br>- case clang::Type::Paren:<br> case clang::Type::Attributed:<br> case clang::Type::TemplateTypeParm:<br> case clang::Type::SubstTemplateTypeParm:<br>@@ -519,7 +522,7 @@ ClangASTType::GetFormat (clang_type_t cl<br> break;<br><br> case clang::Type::ConstantArray:<br>- break;<br>+ return lldb::eFormatVoid; // no value<br><br> case clang::Type::ExtVector:<br> case clang::Type::Vector:<br>@@ -597,12 +600,13 @@ ClangASTType::GetFormat (clang_type_t cl<br> return<span class="Apple-converted-space"> </span><br>ClangASTType::GetFormat(llvm::cast<clang::TypedefType>(qual_type)->getDecl<br>()->getUnderlyingType().getAsOpaquePtr());<br> case clang::Type::Auto:<br> return<span class="Apple-converted-space"> </span><br>ClangASTType::GetFormat(llvm::cast<clang::AutoType>(qual_type)->desugar().<br>getAsOpaquePtr());<br>+ case clang::Type::Paren:<br>+ return<span class="Apple-converted-space"> </span><br>ClangASTType::GetFormat(llvm::cast<clang::ParenType>(qual_type)->desugar()<br>.getAsOpaquePtr());<br> case clang::Type::Elaborated:<br> return<span class="Apple-converted-space"> </span><br>ClangASTType::GetFormat(llvm::cast<clang::ElaboratedType>(qual_type)->getN<br>amedType().getAsOpaquePtr());<br> case clang::Type::DependentSizedArray:<br> case clang::Type::DependentSizedExtVector:<br> case clang::Type::UnresolvedUsing:<br>- case clang::Type::Paren:<br> case clang::Type::Attributed:<br> case clang::Type::TemplateTypeParm:<br> case clang::Type::SubstTemplateTypeParm:<br>@@ -950,6 +954,31 @@ ClangASTType::DumpValue<br> depth); // Scope depth for any<br>types that have children<br> }<br> break;<br>+ <br>+ case clang::Type::Paren:<br>+ {<br>+ clang::QualType desugar_qual_type =<br>llvm::cast<clang::ParenType>(qual_type)->desugar();<br>+ lldb::Format desugar_format =<br>ClangASTType::GetFormat(desugar_qual_type.getAsOpaquePtr());<br>+ std::pair<uint64_t, unsigned> desugar_type_info =<br>ast_context->getTypeInfo(desugar_qual_type);<br>+ uint64_t desugar_byte_size = desugar_type_info.first / 8;<br>+ <br>+ return DumpValue (ast_context, // The clang AST context<br>for this type<br>+ desugar_qual_type.getAsOpaquePtr(), // The<br>clang type we want to dump<br>+ exe_ctx,<br>+ s, // Stream to dump to<br>+ desugar_format, // The format with which to<br>display the element<br>+ data, // Data buffer containing<br>all bytes for this type<br>+ data_byte_offset, // Offset into "data"<br>where to grab value from<br>+ desugar_byte_size, // Size of this type in<br>bytes<br>+ bitfield_bit_size, // Bitfield bit size<br>+ bitfield_bit_offset,// Bitfield bit offset<br>+ show_types, // Boolean indicating if<br>we should show the variable types<br>+ show_summary, // Boolean indicating if<br>we should show a summary for the current type<br>+ verbose, // Verbose output?<br>+ depth); // Scope depth for any<br>types that have children<br>+ }<br>+ break;<br>+<br> default:<br> // We are down the a scalar type that we just need to display.<br> data.Dump(s, data_byte_offset, format, data_byte_size, 1,<br>UINT32_MAX, LLDB_INVALID_ADDRESS, bitfield_bit_size, bitfield_bit_offset);<br>@@ -1390,6 +1419,12 @@ ClangASTType::DumpTypeDescription (clang<br> s);<br> return;<br><br>+ case clang::Type::Paren:<br>+ DumpTypeDescription (ast_context,<br>+ <br>llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr(),<br>+ s);<br>+ return;<br>+<br> case clang::Type::Record:<br> {<br> ClangASTContext::GetCompleteType (ast_context,<br>clang_type);<br><br>Added:<span class="Apple-converted-space"> </span><br>lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Makefile<br>URL:<span class="Apple-converted-space"> </span><br>http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-f<br>ormatter/rdar-13338477/Makefile?rev=180938&view=auto<br>==========================================================================<br>====<br>--- lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Makefile<br>(added)<br>+++ lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Makefile<br>Thu May 2 13:54:54 2013<br>@@ -0,0 +1,5 @@<br>+LEVEL = ../../../make<br>+<br>+CXX_SOURCES := main.cpp<br>+<br>+include $(LEVEL)/Makefile.rules<br><br>Added:<span class="Apple-converted-space"> </span><br>lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Test-rdar-133<br>38477.py<br>URL:<span class="Apple-converted-space"> </span><br>http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-f<br>ormatter/rdar-13338477/Test-rdar-13338477.py?rev=180938&view=auto<br>==========================================================================<br>====<br>---<span class="Apple-converted-space"> </span><br>lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Test-rdar-133<br>38477.py (added)<br>+++<span class="Apple-converted-space"> </span><br>lldb/trunk/test/functionalities/data-formatter/rdar-13338477/Test-rdar-133<br>38477.py Thu May 2 13:54:54 2013<br>@@ -0,0 +1,70 @@<br>+"""<br>+Test lldb data formatter subsystem.<br>+"""<br>+<br>+import os, time<br>+import unittest2<br>+import lldb<br>+from lldbtest import *<br>+import lldbutil<br>+<br>+class Radar13338477DataFormatterTestCase(TestBase):<br>+<br>+ # test for rdar://problem/13338477 ()<br>+ mydir = os.path.join("functionalities", "data-formatter",<br>"rdar-13338477")<br>+<br>+ @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires<br>Darwin")<br>+ @dsym_test<br>+ def test_with_dsym_and_run_command(self):<br>+ """Test that LLDB handles the clang typeclass Paren correctly."""<br>+ self.buildDsym()<br>+ self.data_formatter_commands()<br>+<br>+ @dwarf_test<br>+ def test_with_dwarf_and_run_command(self):<br>+ """Test that LLDB handles the clang typeclass Paren correctly."""<br>+ self.buildDwarf()<br>+ self.data_formatter_commands()<br>+<br>+ def setUp(self):<br>+ # Call super's setUp().<br>+ TestBase.setUp(self)<br>+ # Find the line number to break at.<br>+ self.line = line_number('main.cpp', '// Set break point at this<br>line.')<br>+<br>+ def data_formatter_commands(self):<br>+ """Test that LLDB handles the clang typeclass Paren correctly."""<br>+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br>+<br>+ lldbutil.run_break_set_by_file_and_line (self, "main.cpp",<br>self.line, num_expected_locations=1, loc_exact=True)<br>+<br>+ self.runCmd("run", RUN_SUCCEEDED)<br>+<br>+ # The stop reason of the thread should be breakpoint.<br>+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,<br>+ substrs = ['stopped',<br>+ 'stop reason = breakpoint'])<br>+<br>+ # This is the function to remove the custom formats in order to<br>have a<br>+ # clean slate for the next test case.<br>+ def cleanup():<br>+ self.runCmd('type format delete hex', check=False)<br>+ self.runCmd('type summary clear', check=False)<br>+<br>+ # Execute the cleanup function during test case tear down.<br>+ self.addTearDownHook(cleanup)<br>+<br>+ self.expect('p *(int (*)[3])foo',<br>+ substrs = ['(int [3]) $',' = {','[0] = 1','[1] = 2','[2] =<br>3'])<br>+<br>+ self.expect('p *(int (*)[3])foo', matching=False,<br>+ substrs = ['01 00 00 00 02 00 00 00 03 00 00 00'])<br>+ self.expect('p *(int (*)[3])foo', matching=False,<br>+ substrs = ['0x000000030000000200000001'])<br>+<br>+<br>+if __name__ == '__main__':<br>+ import atexit<br>+ lldb.SBDebugger.Initialize()<br>+ atexit.register(lambda: lldb.SBDebugger.Terminate())<br>+ unittest2.main()<br><br>Added:<span class="Apple-converted-space"> </span><br>lldb/trunk/test/functionalities/data-formatter/rdar-13338477/main.cpp<br>URL:<span class="Apple-converted-space"> </span><br>http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-f<br>ormatter/rdar-13338477/main.cpp?rev=180938&view=auto<br>==========================================================================<br>====<br>--- lldb/trunk/test/functionalities/data-formatter/rdar-13338477/main.cpp<br>(added)<br>+++ lldb/trunk/test/functionalities/data-formatter/rdar-13338477/main.cpp<br>Thu May 2 13:54:54 2013<br>@@ -0,0 +1,17 @@<br>+//===-- main.cpp ------------------------------------------------*- C++<br>-*-===//<br>+//<br>+// The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===--------------------------------------------------------------------<br>--===//<br>+<br>+void bar(int const *foo) {<br>+ __builtin_trap(); // Set break point at this line.<br>+}<br>+<br>+int main() {<br>+ int foo[] = {1,2,3};<br>+ bar(foo);<br>+}<br><br><br>_______________________________________________<br>lldb-commits mailing list<br>lldb-commits@cs.uiuc.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</blockquote></div></blockquote></div><br></body></html>