r263794 - Show members of DeclContexts (i.e., class members) in Visual Studio native visualizers
Mike Spertus via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 18 09:38:34 PDT 2016
Author: mps
Date: Fri Mar 18 11:38:34 2016
New Revision: 263794
URL: http://llvm.org/viewvc/llvm-project?rev=263794&view=rev
Log:
Show members of DeclContexts (i.e., class members) in Visual Studio native visualizers
This change shows members of DeclContext objects in the Visual Studio debugger. It will also cast a TagType like a class or a struct to a DeclContext, so its methods and fields are visualized.
Modified:
cfe/trunk/utils/clang.natvis
Modified: cfe/trunk/utils/clang.natvis
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/clang.natvis?rev=263794&r1=263793&r2=263794&view=diff
==============================================================================
--- cfe/trunk/utils/clang.natvis (original)
+++ cfe/trunk/utils/clang.natvis Fri Mar 18 11:38:34 2016
@@ -73,6 +73,31 @@ or create a symbolic link so it updates
<Type Name="clang::AttributedType">
<DisplayString>{ModifiedType} Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind}</DisplayString>
</Type>
+
+ <!-- Unfortunately, Visual Studio has trouble seeing the PointerBitMask member PointerIntUnion, so I hardwire it to 2 bits-->
+ <Type Name="clang::DeclContext">
+ <DisplayString>{(clang::Decl::Kind)DeclKind,en}Decl</DisplayString>
+ <Expand>
+ <Item Name="DeclKind">(clang::Decl::Kind)DeclKind,en</Item>
+ <LinkedListItems>
+ <HeadPointer>FirstDecl</HeadPointer>
+ <NextPointer>(clang::Decl *)(NextInContextAndBits.Value & ~3)</NextPointer>
+ <ValueNode>*this</ValueNode>
+ </LinkedListItems>
+ </Expand>
+ </Type>
+ <Type Name="clang::FieldDecl">
+ <DisplayString>Field {{{*(clang::NamedDecl *)this,view(cpp)nd}}}</DisplayString>
+ </Type>
+ <Type Name="clang::CXXMethodDecl">
+ <DisplayString>Method {{{*(clang::NamedDecl *)this,view(cpp)nd}}}</DisplayString>
+ </Type>
+ <Type Name="clang::CXXConstructorDecl">
+ <DisplayString>Constructor {{{*(clang::NamedDecl *)this,view(cpp)nd}}}</DisplayString>
+ </Type>
+ <Type Name="clang::CXXDestructorDecl">
+ <DisplayString>Destructor {{{*(clang::NamedDecl *)this,view(cpp)nd}}}</DisplayString>
+ </Type>
<Type Name="clang::NamedDecl" >
<DisplayString IncludeView="cpp">{Name,view(cpp)}</DisplayString>
<DisplayString>{Name}</DisplayString>
@@ -83,6 +108,9 @@ or create a symbolic link so it updates
<DisplayString Condition="TagDeclKind==clang::TagTypeKind::TTK_Union">union {Name,view(cpp)}</DisplayString>
<DisplayString Condition="TagDeclKind==clang::TagTypeKind::TTK_Class">class {Name,view(cpp)}</DisplayString>
<DisplayString Condition="TagDeclKind==clang::TagTypeKind::TTK_Enum">enum {Name,view(cpp)}</DisplayString>
+ <Expand>
+ <ExpandedItem>(clang::DeclContext *)this</ExpandedItem>
+ </Expand>
</Type>
<Type Name="clang::TagType">
<DisplayString>{*decl}</DisplayString>
@@ -97,7 +125,6 @@ or create a symbolic link so it updates
<Item Name="TagType">*(clang::TagType *)this</Item>
</Expand>
</Type>
-
<Type Name="clang::SubstTemplateTypeParmType">
<DisplayString>{*Replaced,view(cpp)} <= {CanonicalType,view(cpp)}</DisplayString>
<Expand>
More information about the cfe-commits
mailing list