<div dir="ltr">bump</div><div class="gmail_extra"><br clear="all"><div>--<br>Russell Harmon</div>
<br><br><div class="gmail_quote">On Sat, Oct 26, 2013 at 7:32 AM, Russell Harmon <span dir="ltr"><<a href="mailto:russ@eatnumber1.com" target="_blank">russ@eatnumber1.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Here ya' go. Let me know if it needs some changes.<div class="gmail_extra"><br clear="all"><div>--<br>Russell Harmon</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">From 72332118f0c23360633f4ab4df8590e0451dd39b Mon Sep 17 00:00:00 2001</div><div class="gmail_extra">From: Russell Harmon <<a href="mailto:russ@eatnumber1.com" target="_blank">russ@eatnumber1.com</a>></div>


<div class="gmail_extra">Date: Sat, 26 Oct 2013 07:26:17 -0700</div><div class="gmail_extra">Subject: [PATCH] Add support for inspecting enum members.</div><div class="gmail_extra"><br></div><div class="gmail_extra">---</div>


<div class="gmail_extra"> include/lldb/API/SBDefines.h Â  Â  Â  Â  Â  Â  Â  Â | Â  Â 2 +</div><div class="gmail_extra"> include/lldb/API/SBStream.h Â  Â  Â  Â  Â  Â  Â  Â  | Â  Â 1 +</div><div class="gmail_extra"> include/lldb/API/SBType.h Â  Â  Â  Â  Â  Â  Â  Â  Â  | Â  Â 5 +</div>


<div class="gmail_extra"> include/lldb/API/SBTypeEnumMember.h Â  Â  Â  Â  | Â  97 ++++++++++++++</div><div class="gmail_extra"> include/lldb/Core/ClangForward.h Â  Â  Â  Â  Â  Â | Â  Â 1 +</div><div class="gmail_extra"> include/lldb/Symbol/ClangASTType.h Â  Â  Â  Â  Â | Â  Â 3 +</div>


<div class="gmail_extra"> include/lldb/Symbol/Type.h Â  Â  Â  Â  Â  Â  Â  Â  Â | Â  99 +++++++++++++-</div><div class="gmail_extra"> include/lldb/lldb-forward.h Â  Â  Â  Â  Â  Â  Â  Â  | Â  Â 3 +</div><div class="gmail_extra"> scripts/Python/interface/SBType.i Â  Â  Â  Â  Â  | Â  14 ++</div>


<div class="gmail_extra"> scripts/Python/interface/SBTypeEnumMember.i | Â 108 +++++++++++++++</div><div class="gmail_extra"> scripts/Python/python-extensions.swig Â  Â  Â  | Â  14 ++</div><div class="gmail_extra"> scripts/lldb.swig Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  | Â  Â 2 +</div>


<div class="gmail_extra"> source/API/CMakeLists.txt Â  Â  Â  Â  Â  Â  Â  Â  Â  | Â  Â 1 +</div><div class="gmail_extra"> source/API/SBType.cpp Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  | Â  24 ++++</div><div class="gmail_extra"> source/API/SBTypeEnumMember.cpp Â  Â  Â  Â  Â  Â  | Â 192 +++++++++++++++++++++++++++</div>


<div class="gmail_extra"> source/Symbol/ClangASTType.cpp Â  Â  Â  Â  Â  Â  Â | Â  Â 9 ++</div><div class="gmail_extra"> source/Symbol/Type.cpp Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â | Â  11 ++</div><div class="gmail_extra"> test/python_api/type/TestTypeList.py Â  Â  Â  Â | Â  Â 5 +</div>


<div class="gmail_extra"> test/python_api/type/main.cpp Â  Â  Â  Â  Â  Â  Â  | Â  Â 7 +-</div><div class="gmail_extra"> 19 files changed, 596 insertions(+), 2 deletions(-)</div><div class="gmail_extra"> create mode 100644 include/lldb/API/SBTypeEnumMember.h</div>


<div class="gmail_extra"> create mode 100644 scripts/Python/interface/SBTypeEnumMember.i</div><div class="gmail_extra"> create mode 100644 source/API/SBTypeEnumMember.cpp</div><div class="gmail_extra"><br></div><div class="gmail_extra">


diff --git a/include/lldb/API/SBDefines.h b/include/lldb/API/SBDefines.h</div><div class="gmail_extra">index 2cdf921..971e449 100644</div><div class="gmail_extra">--- a/include/lldb/API/SBDefines.h</div><div class="gmail_extra">


+++ b/include/lldb/API/SBDefines.h</div><div class="gmail_extra">@@ -67,6 +67,8 @@ class SBTarget;</div><div class="gmail_extra"> class SBThread;</div><div class="gmail_extra"> class SBType;</div><div class="gmail_extra">


 class SBTypeCategory;</div><div class="gmail_extra">+class SBTypeEnumMember;</div><div class="gmail_extra">+class SBTypeEnumMemberList;</div><div class="gmail_extra"> class SBTypeFilter;</div><div class="gmail_extra"> class SBTypeFormat;</div>


<div class="gmail_extra"> class SBTypeNameSpecifier;</div><div class="gmail_extra">diff --git a/include/lldb/API/SBStream.h b/include/lldb/API/SBStream.h</div><div class="gmail_extra">index 038adf6..f77b7b7 100644</div><div class="gmail_extra">


--- a/include/lldb/API/SBStream.h</div><div class="gmail_extra">+++ b/include/lldb/API/SBStream.h</div><div class="gmail_extra">@@ -86,6 +86,7 @@ protected:</div><div class="gmail_extra">  Â  Â friend class SBTarget;</div>

<div class="gmail_extra">
  Â  Â friend class SBThread;</div><div class="gmail_extra">  Â  Â friend class SBType;</div><div class="gmail_extra">+ Â  Â friend class SBTypeEnumMember;</div><div class="gmail_extra">  Â  Â friend class SBTypeMember;</div><div class="gmail_extra">


  Â  Â friend class SBValue;</div><div class="gmail_extra">  Â  Â friend class SBWatchpoint;</div><div class="gmail_extra">diff --git a/include/lldb/API/SBType.h b/include/lldb/API/SBType.h</div><div class="gmail_extra">index 3729b2f..1f9ec63 100644</div>


<div class="gmail_extra">--- a/include/lldb/API/SBType.h</div><div class="gmail_extra">+++ b/include/lldb/API/SBType.h</div><div class="gmail_extra">@@ -140,6 +140,9 @@ public:</div><div class="gmail_extra">  Â  Â lldb::SBTypeMember</div>


<div class="gmail_extra">  Â  Â GetVirtualBaseClassAtIndex (uint32_t idx);</div><div class="gmail_extra"> </div><div class="gmail_extra">+ Â  Â lldb::SBTypeEnumMemberList</div><div class="gmail_extra">+ Â  Â GetEnumMembers();</div>


<div class="gmail_extra">+</div><div class="gmail_extra">  Â  Â uint32_t</div><div class="gmail_extra">  Â  Â GetNumberOfTemplateArguments ();</div><div class="gmail_extra">  Â  Â </div><div class="gmail_extra">@@ -196,6 +199,8 @@ protected:</div>


<div class="gmail_extra">  Â  Â friend class SBFunction;</div><div class="gmail_extra">  Â  Â friend class SBModule;</div><div class="gmail_extra">  Â  Â friend class SBTarget;</div><div class="gmail_extra">+ Â  Â friend class SBTypeEnumMember;</div>


<div class="gmail_extra">+ Â  Â friend class SBTypeEnumMemberList;</div><div class="gmail_extra">  Â  Â friend class SBTypeNameSpecifier;</div><div class="gmail_extra">  Â  Â friend class SBTypeMember;</div><div class="gmail_extra">


  Â  Â friend class SBTypeList;</div><div class="gmail_extra">diff --git a/include/lldb/API/SBTypeEnumMember.h b/include/lldb/API/SBTypeEnumMember.h</div><div class="gmail_extra">new file mode 100644</div><div class="gmail_extra">


index 0000000..9c447f1</div><div class="gmail_extra">--- /dev/null</div><div class="gmail_extra">+++ b/include/lldb/API/SBTypeEnumMember.h</div><div class="gmail_extra">@@ -0,0 +1,97 @@</div><div class="gmail_extra">+//===-- SBTypeEnumMember.h --------------------------------------*- C++ -*-===//</div>


<div class="gmail_extra">+//</div><div class="gmail_extra">+// Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  The LLVM Compiler Infrastructure</div><div class="gmail_extra">+//</div><div class="gmail_extra">+// This file is distributed under the University of Illinois Open Source</div>


<div class="gmail_extra">+// License. See LICENSE.TXT for details.</div><div class="gmail_extra">+//</div><div class="gmail_extra">+//===----------------------------------------------------------------------===//</div><div class="gmail_extra">


+</div><div class="gmail_extra">+#ifndef LLDB_SBTypeEnumMember_h_</div><div class="gmail_extra">+#define LLDB_SBTypeEnumMember_h_</div><div class="gmail_extra">+</div><div class="gmail_extra">+#include "lldb/API/SBDefines.h"</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+namespace lldb {</div><div class="gmail_extra">+</div><div class="gmail_extra">+class SBTypeEnumMember</div><div class="gmail_extra">+{</div><div class="gmail_extra">


+public:</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember ();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember (const SBTypeEnumMember& rhs);</div><div class="gmail_extra">+</div>


<div class="gmail_extra">+ Â  Â ~SBTypeEnumMember();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember&</div><div class="gmail_extra">+ Â  Â operator = (const SBTypeEnumMember& rhs);</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â bool</div><div class="gmail_extra">+ Â  Â IsValid() const;</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â int64_t</div><div class="gmail_extra">


+ Â  Â GetValueAsSigned();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â uint64_t</div><div class="gmail_extra">+ Â  Â GetValueAsUnsigned();</div><div class="gmail_extra">+</div><div class="gmail_extra">

+ Â  Â const char *</div>
<div class="gmail_extra">+ Â  Â GetName ();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â lldb::SBType</div><div class="gmail_extra">+ Â  Â GetType ();</div><div class="gmail_extra">+</div><div class="gmail_extra">


+ Â  Â bool</div><div class="gmail_extra">+ Â  Â GetDescription (lldb::SBStream &description,</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â lldb::DescriptionLevel description_level);</div><div class="gmail_extra">+</div>


<div class="gmail_extra">+protected:</div><div class="gmail_extra">+ Â  Â friend class SBType;</div><div class="gmail_extra">+ Â  Â friend class SBTypeEnumMemberList;</div><div class="gmail_extra">+</div><div class="gmail_extra">


+ Â  Â void</div><div class="gmail_extra">+ Â  Â reset (lldb_private::TypeEnumMemberImpl *);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â lldb_private::TypeEnumMemberImpl &</div><div class="gmail_extra">


+ Â  Â ref ();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â const lldb_private::TypeEnumMemberImpl &</div><div class="gmail_extra">+ Â  Â ref () const;</div><div class="gmail_extra">+</div><div class="gmail_extra">


+ Â  Â lldb::TypeEnumMemberImplSP m_opaque_sp;</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember (const lldb::TypeEnumMemberImplSP &);</div><div class="gmail_extra">+};</div><div class="gmail_extra">


+</div><div class="gmail_extra">+class SBTypeEnumMemberList</div><div class="gmail_extra">+{</div><div class="gmail_extra">+public:</div><div class="gmail_extra">+ Â  Â SBTypeEnumMemberList();</div><div class="gmail_extra">


+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMemberList(const SBTypeEnumMemberList& rhs);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â ~SBTypeEnumMemberList();</div><div class="gmail_extra">+</div>


<div class="gmail_extra">+ Â  Â SBTypeEnumMemberList&</div><div class="gmail_extra">+ Â  Â operator = (const SBTypeEnumMemberList& rhs);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â bool</div><div class="gmail_extra">


+ Â  Â IsValid();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â void</div><div class="gmail_extra">+ Â  Â Append (SBTypeEnumMember entry);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember</div>


<div class="gmail_extra">+ Â  Â GetTypeEnumMemberAtIndex (uint32_t index);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â uint32_t</div><div class="gmail_extra">+ Â  Â GetSize();</div><div class="gmail_extra">


+</div><div class="gmail_extra">+</div><div class="gmail_extra">+private:</div><div class="gmail_extra">+ Â  Â std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_ap;</div><div class="gmail_extra">+};</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+} // namespace lldb</div><div class="gmail_extra">+</div><div class="gmail_extra">+#endif // LLDB_SBTypeEnumMember_h_</div><div class="gmail_extra">diff --git a/include/lldb/Core/ClangForward.h b/include/lldb/Core/ClangForward.h</div>


<div class="gmail_extra">index 0b3f13a..ef7308d 100644</div><div class="gmail_extra">--- a/include/lldb/Core/ClangForward.h</div><div class="gmail_extra">+++ b/include/lldb/Core/ClangForward.h</div><div class="gmail_extra">


@@ -58,6 +58,7 @@ namespace clang</div><div class="gmail_extra">  Â  Â class DiagnosticsEngine;</div><div class="gmail_extra">  Â  Â class DiagnosticOptions;</div><div class="gmail_extra">  Â  Â class EnumDecl;</div><div class="gmail_extra">


+ Â  Â class EnumConstantDecl;</div><div class="gmail_extra">  Â  Â class Expr;</div><div class="gmail_extra">  Â  Â class ExternalASTSource;</div><div class="gmail_extra">  Â  Â class ExtVectorElementExpr;</div><div class="gmail_extra">


diff --git a/include/lldb/Symbol/ClangASTType.h b/include/lldb/Symbol/ClangASTType.h</div><div class="gmail_extra">index f0dffe3..c8a039a 100644</div><div class="gmail_extra">--- a/include/lldb/Symbol/ClangASTType.h</div>


<div class="gmail_extra">+++ b/include/lldb/Symbol/ClangASTType.h</div><div class="gmail_extra">@@ -642,6 +642,9 @@ public:</div><div class="gmail_extra">  Â  Â clang::ObjCInterfaceDecl *</div><div class="gmail_extra">  Â  Â GetAsObjCInterfaceDecl () const;</div>


<div class="gmail_extra"> </div><div class="gmail_extra">+ Â  Â clang::EnumDecl *</div><div class="gmail_extra">+ Â  Â GetAsEnumDecl () const;</div><div class="gmail_extra">+</div><div class="gmail_extra">  Â  Â void</div><div class="gmail_extra">


  Â  Â Clear()</div><div class="gmail_extra">  Â  Â {</div><div class="gmail_extra">diff --git a/include/lldb/Symbol/Type.h b/include/lldb/Symbol/Type.h</div><div class="gmail_extra">index 50b22fe..0e8e5c7 100644</div><div class="gmail_extra">


--- a/include/lldb/Symbol/Type.h</div><div class="gmail_extra">+++ b/include/lldb/Symbol/Type.h</div><div class="gmail_extra">@@ -589,7 +589,104 @@ protected:</div><div class="gmail_extra">  Â  Â bool m_is_bitfield;</div><div class="gmail_extra">


 };</div><div class="gmail_extra"> </div><div class="gmail_extra">- Â  Â </div><div class="gmail_extra">+class TypeEnumMemberImpl</div><div class="gmail_extra">+{</div><div class="gmail_extra">+public:</div><div class="gmail_extra">


+ Â  Â TypeEnumMemberImpl () :</div><div class="gmail_extra">+ Â  Â  Â  Â m_integer_type(),</div><div class="gmail_extra">+ Â  Â  Â  Â m_name("<invalid>"),</div><div class="gmail_extra">+ Â  Â  Â  Â m_value(),</div><div class="gmail_extra">


+ Â  Â  Â  Â m_valid(false)</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl,</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â const lldb_private::ClangASTType& integer_type);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â TypeEnumMemberImpl (const TypeEnumMemberImpl& rhs) :</div>


<div class="gmail_extra">+ Â  Â  Â  Â m_integer_type(rhs.m_integer_type),</div><div class="gmail_extra">+ Â  Â  Â  Â m_name(rhs.m_name),</div><div class="gmail_extra">+ Â  Â  Â  Â m_value(rhs.m_value),</div><div class="gmail_extra">

+ Â  Â  Â  Â m_valid(rhs.m_valid)</div>
<div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â TypeEnumMemberImpl&</div><div class="gmail_extra">+ Â  Â operator = (const TypeEnumMemberImpl& rhs);</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â bool</div><div class="gmail_extra">+ Â  Â IsValid ()</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â return m_valid;</div><div class="gmail_extra">


+ Â  Â }</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â const ConstString &</div><div class="gmail_extra">+ Â  Â GetName () const</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â return m_name;</div>


<div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â const lldb::TypeImplSP &</div><div class="gmail_extra">+ Â  Â GetIntegerType () const</div><div class="gmail_extra">+ Â  Â {</div>


<div class="gmail_extra">+ Â  Â  Â  Â return m_integer_type;</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â uint64_t</div><div class="gmail_extra">+ Â  Â GetValueAsUnsigned () const</div>


<div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â return *m_value.getRawData();</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â int64_t</div><div class="gmail_extra">


+ Â  Â GetValueAsSigned () const</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â return (int64_t) *m_value.getRawData();</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+</div>


<div class="gmail_extra">+protected:</div><div class="gmail_extra">+ Â  Â lldb::TypeImplSP m_integer_type;</div><div class="gmail_extra">+ Â  Â ConstString m_name;</div><div class="gmail_extra">+ Â  Â llvm::APSInt m_value;</div>


<div class="gmail_extra">+ Â  Â bool m_valid;</div><div class="gmail_extra">+};</div><div class="gmail_extra">+</div><div class="gmail_extra">+class TypeEnumMemberListImpl</div><div class="gmail_extra">+{</div><div class="gmail_extra">


+public:</div><div class="gmail_extra">+ Â  Â TypeEnumMemberListImpl() :</div><div class="gmail_extra">+ Â  Â  Â  Â m_content()</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">


+</div><div class="gmail_extra">+ Â  Â void</div><div class="gmail_extra">+ Â  Â Append (const lldb::TypeEnumMemberImplSP& type)</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â m_content.push_back(type);</div>


<div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â void</div><div class="gmail_extra">+ Â  Â Append (const lldb_private::TypeEnumMemberListImpl& type_list);</div><div class="gmail_extra">


+</div><div class="gmail_extra">+ Â  Â lldb::TypeEnumMemberImplSP</div><div class="gmail_extra">+ Â  Â GetTypeEnumMemberAtIndex(size_t idx)</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â lldb::TypeEnumMemberImplSP enum_member;</div>


<div class="gmail_extra">+ Â  Â  Â  Â if (idx < GetSize())</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â enum_member = m_content[idx];</div><div class="gmail_extra">+ Â  Â  Â  Â return enum_member;</div><div class="gmail_extra">

+ Â  Â }</div>
<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â size_t</div><div class="gmail_extra">+ Â  Â GetSize()</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â return m_content.size();</div>

<div class="gmail_extra">
+ Â  Â }</div><div class="gmail_extra">+</div><div class="gmail_extra">+private:</div><div class="gmail_extra">+ Â  Â std::vector<lldb::TypeEnumMemberImplSP> m_content;</div><div class="gmail_extra">+};</div><div class="gmail_extra">


+</div><div class="gmail_extra"> } // namespace lldb_private</div><div class="gmail_extra"> </div><div class="gmail_extra"> #endif Â // liblldb_Type_h_</div><div class="gmail_extra">diff --git a/include/lldb/lldb-forward.h b/include/lldb/lldb-forward.h</div>


<div class="gmail_extra">index e06044b..754a2d8 100644</div><div class="gmail_extra">--- a/include/lldb/lldb-forward.h</div><div class="gmail_extra">+++ b/include/lldb/lldb-forward.h</div><div class="gmail_extra">@@ -233,6 +233,8 @@ class Â  TypeAndOrName;</div>


<div class="gmail_extra"> class Â  TypeList;</div><div class="gmail_extra"> class Â  TypeListImpl;</div><div class="gmail_extra"> class Â  TypeMemberImpl;</div><div class="gmail_extra">+class Â  TypeEnumMemberImpl;</div><div class="gmail_extra">


+class Â  TypeEnumMemberListImpl;</div><div class="gmail_extra"> class Â  TypeNameSpecifierImpl;</div><div class="gmail_extra"> class Â  UUID;</div><div class="gmail_extra"> class Â  Unwind;</div><div class="gmail_extra">@@ -360,6 +362,7 @@ namespace lldb {</div>


<div class="gmail_extra">  Â  Â typedef std::weak_ptr<lldb_private::Type> TypeWP;</div><div class="gmail_extra">  Â  Â typedef std::shared_ptr<lldb_private::TypeCategoryImpl> TypeCategoryImplSP;</div><div class="gmail_extra">


  Â  Â typedef std::shared_ptr<lldb_private::TypeImpl> TypeImplSP;</div><div class="gmail_extra">+ Â  Â typedef std::shared_ptr<lldb_private::TypeEnumMemberImpl> TypeEnumMemberImplSP;</div><div class="gmail_extra">


  Â  Â typedef std::shared_ptr<lldb_private::TypeFilterImpl> TypeFilterImplSP;</div><div class="gmail_extra">  Â  Â typedef std::shared_ptr<lldb_private::TypeFormatImpl> TypeFormatImplSP;</div><div class="gmail_extra">


  Â  Â typedef std::shared_ptr<lldb_private::TypeNameSpecifierImpl> TypeNameSpecifierImplSP;</div><div class="gmail_extra">diff --git a/scripts/Python/interface/SBType.i b/scripts/Python/interface/SBType.i</div><div class="gmail_extra">


index fbeed3e..95fe50a 100644</div><div class="gmail_extra">--- a/scripts/Python/interface/SBType.i</div><div class="gmail_extra">+++ b/scripts/Python/interface/SBType.i</div><div class="gmail_extra">@@ -210,6 +210,9 @@ public:</div>


<div class="gmail_extra">  Â  Â lldb::SBTypeMember</div><div class="gmail_extra">  Â  Â GetVirtualBaseClassAtIndex (uint32_t idx);</div><div class="gmail_extra"> </div><div class="gmail_extra">+ Â  Â lldb::SBTypeEnumMemberList</div>


<div class="gmail_extra">+ Â  Â GetEnumMembers();</div><div class="gmail_extra">+</div><div class="gmail_extra">  Â  Â const char*</div><div class="gmail_extra">  Â  Â GetName();</div><div class="gmail_extra">  Â  Â </div><div class="gmail_extra">


@@ -339,6 +342,14 @@ public:</div><div class="gmail_extra">  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â members.append(field)</div><div class="gmail_extra">  Â  Â  Â  Â  Â  Â return members</div><div class="gmail_extra"> </div><div class="gmail_extra">


+ Â  Â  Â  Â def get_enum_members_array(self):</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â '''An accessor function that returns a list() that contains all enum members in an lldb.SBType object.'''</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â enum_members_list = []</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â sb_enum_members = self.GetEnumMembers()</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â for idx in range(sb_enum_members.GetSize()):</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â enum_members_list.append(sb_enum_members.GetTypeEnumMemberAtIndex(idx))</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â return enum_members_list</div><div class="gmail_extra">+</div><div class="gmail_extra">


  Â  Â  Â  Â __swig_getmethods__["bases"] = get_bases_array</div><div class="gmail_extra">  Â  Â  Â  Â if _newclass: bases = property(get_bases_array, None, doc='''A read only property that returns a list() of lldb.SBTypeMember objects that represent all of the direct base classes for this type.''')</div>


<div class="gmail_extra">  Â  Â  Â  Â </div><div class="gmail_extra">@@ -351,6 +362,9 @@ public:</div><div class="gmail_extra">  Â  Â  Â  Â __swig_getmethods__["members"] = get_members_array</div><div class="gmail_extra">


  Â  Â  Â  Â if _newclass: members = property(get_members_array, None, doc='''A read only property that returns a list() of all lldb.SBTypeMember objects that represent all of the base classes, virtual base classes and fields for this type in ascending bit offset order.''')</div>


<div class="gmail_extra"> </div><div class="gmail_extra">+ Â  Â  Â  Â __swig_getmethods__["enum_members"] = get_enum_members_array</div><div class="gmail_extra">+ Â  Â  Â  Â if _newclass: enum_members = property(get_enum_members_array, None, doc='''A read only property that returns a list() of all lldb.SBTypeEnumMember objects that represent the enum members for this type.''')</div>


<div class="gmail_extra">+</div><div class="gmail_extra">  Â  Â  Â  Â %}</div><div class="gmail_extra"> </div><div class="gmail_extra"> };</div><div class="gmail_extra">diff --git a/scripts/Python/interface/SBTypeEnumMember.i b/scripts/Python/interface/SBTypeEnumMember.i</div>


<div class="gmail_extra">new file mode 100644</div><div class="gmail_extra">index 0000000..02d89f1</div><div class="gmail_extra">--- /dev/null</div><div class="gmail_extra">+++ b/scripts/Python/interface/SBTypeEnumMember.i</div>


<div class="gmail_extra">@@ -0,0 +1,108 @@</div><div class="gmail_extra">+//===-- SWIG Interface for SBTypeEnumMember ---------------------*- C++ -*-===//</div><div class="gmail_extra">+//</div><div class="gmail_extra">+// Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  The LLVM Compiler Infrastructure</div>


<div class="gmail_extra">+//</div><div class="gmail_extra">+// This file is distributed under the University of Illinois Open Source</div><div class="gmail_extra">+// License. See LICENSE.TXT for details.</div><div class="gmail_extra">


+//</div><div class="gmail_extra">+//===----------------------------------------------------------------------===//</div><div class="gmail_extra">+</div><div class="gmail_extra">+namespace lldb {</div><div class="gmail_extra">


+</div><div class="gmail_extra">+%feature(</div><div class="gmail_extra">+ Â  Â "docstring",</div><div class="gmail_extra">+ Â  Â "Represents a member of an enum in lldb."</div><div class="gmail_extra">+) SBTypeEnumMember;</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+class SBTypeEnumMember</div><div class="gmail_extra">+{</div><div class="gmail_extra">+public:</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember ();</div><div class="gmail_extra">


+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember (const SBTypeEnumMember& rhs);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â ~SBTypeEnumMember();</div><div class="gmail_extra">+</div><div class="gmail_extra">


+ Â  Â bool</div><div class="gmail_extra">+ Â  Â IsValid() const;</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â int64_t</div><div class="gmail_extra">+ Â  Â GetValueAsSigned();</div><div class="gmail_extra">


+</div><div class="gmail_extra">+ Â  Â uint64_t</div><div class="gmail_extra">+ Â  Â GetValueAsUnsigned();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â const char *</div><div class="gmail_extra">+ Â  Â GetName ();</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â lldb::SBType</div><div class="gmail_extra">+ Â  Â GetType ();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â bool</div><div class="gmail_extra">


+ Â  Â GetDescription (lldb::SBStream &description,</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â lldb::DescriptionLevel description_level);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â %pythoncode %{</div>


<div class="gmail_extra">+ Â  Â  Â  Â __swig_getmethods__["name"] = GetName</div><div class="gmail_extra">+ Â  Â  Â  Â if _newclass: name = property(GetName, None, doc='''A read only property that returns the name for this enum member as a string.''')</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â  Â  Â __swig_getmethods__["type"] = GetType</div><div class="gmail_extra">+ Â  Â  Â  Â if _newclass: type = property(GetType, None, doc='''A read only property that returns an lldb object that represents the type (lldb.SBType) for this enum member.''')</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â  Â  Â __swig_getmethods__["signed"] = GetValueAsSigned</div><div class="gmail_extra">+ Â  Â  Â  Â if _newclass: signed = property(GetValueAsSigned, None, doc='''A read only property that returns the value of this enum member as a signed integer.''')</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â  Â  Â __swig_getmethods__["unsigned"] = GetValueAsUnsigned</div><div class="gmail_extra">+ Â  Â  Â  Â if _newclass: unsigned = property(GetValueAsUnsigned, None, doc='''A read only property that returns the value of this enum member as a unsigned integer.''')</div>


<div class="gmail_extra">+ Â  Â %}</div><div class="gmail_extra">+</div><div class="gmail_extra">+protected:</div><div class="gmail_extra">+ Â  Â friend class SBType;</div><div class="gmail_extra">+ Â  Â friend class SBTypeEnumMemberList;</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â void</div><div class="gmail_extra">+ Â  Â reset (lldb_private::TypeEnumMemberImpl *);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â lldb_private::TypeEnumMemberImpl &</div>


<div class="gmail_extra">+ Â  Â ref ();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â const lldb_private::TypeEnumMemberImpl &</div><div class="gmail_extra">+ Â  Â ref () const;</div><div class="gmail_extra">


+</div><div class="gmail_extra">+ Â  Â lldb::TypeEnumMemberImplSP m_opaque_sp;</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember (const lldb::TypeEnumMemberImplSP &);</div><div class="gmail_extra">


+};</div><div class="gmail_extra">+</div><div class="gmail_extra">+%feature(</div><div class="gmail_extra">+ Â  Â "docstring",</div><div class="gmail_extra">+ Â  Â "Represents a list of SBTypeEnumMembers."</div>


<div class="gmail_extra">+) SBTypeEnumMemberList;</div><div class="gmail_extra">+</div><div class="gmail_extra">+class SBTypeEnumMemberList</div><div class="gmail_extra">+{</div><div class="gmail_extra">+public:</div><div class="gmail_extra">


+ Â  Â SBTypeEnumMemberList();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMemberList(const SBTypeEnumMemberList& rhs);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â ~SBTypeEnumMemberList();</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â bool</div><div class="gmail_extra">+ Â  Â IsValid();</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â void</div><div class="gmail_extra">+ Â  Â Append (SBTypeEnumMember entry);</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â SBTypeEnumMember</div><div class="gmail_extra">+ Â  Â GetTypeEnumMemberAtIndex (uint32_t index);</div><div class="gmail_extra">+</div><div class="gmail_extra">+ Â  Â uint32_t</div>


<div class="gmail_extra">+ Â  Â GetSize();</div><div class="gmail_extra">+</div><div class="gmail_extra">+</div><div class="gmail_extra">+private:</div><div class="gmail_extra">+ Â  Â std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_ap;</div>


<div class="gmail_extra">+};</div><div class="gmail_extra">+</div><div class="gmail_extra">+} // namespace lldb</div><div class="gmail_extra">diff --git a/scripts/Python/python-extensions.swig b/scripts/Python/python-extensions.swig</div>


<div class="gmail_extra">index c4bc8b9..752dffb 100644</div><div class="gmail_extra">--- a/scripts/Python/python-extensions.swig</div><div class="gmail_extra">+++ b/scripts/Python/python-extensions.swig</div><div class="gmail_extra">


@@ -608,6 +608,20 @@</div><div class="gmail_extra">  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â return PyString_FromString("");</div><div class="gmail_extra">  Â  Â  Â  Â }</div><div class="gmail_extra"> }</div><div class="gmail_extra">+%extend lldb::SBTypeEnumMember {</div>


<div class="gmail_extra">+ Â  Â  Â  Â PyObject *lldb::SBTypeEnumMember::__str__ (){</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â lldb::SBStream description;</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â $self->GetDescription (description, lldb::eDescriptionLevelBrief);</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â const char *desc = description.GetData();</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â size_t desc_len = description.GetSize();</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â --desc_len;</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â if (desc_len > 0)</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â return PyString_FromStringAndSize (desc, desc_len);</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â else</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â return PyString_FromString("");</div><div class="gmail_extra">+ Â  Â  Â  Â }</div><div class="gmail_extra">+}</div><div class="gmail_extra">


 %extend lldb::SBTypeNameSpecifier {</div><div class="gmail_extra">  Â  Â  Â  Â PyObject *lldb::SBTypeNameSpecifier::__str__ (){</div><div class="gmail_extra">  Â  Â  Â  Â  Â  Â  Â  Â lldb::SBStream description;</div><div class="gmail_extra">


diff --git a/scripts/lldb.swig b/scripts/lldb.swig</div><div class="gmail_extra">index 6be699f..3d74996 100644</div><div class="gmail_extra">--- a/scripts/lldb.swig</div><div class="gmail_extra">+++ b/scripts/lldb.swig</div>


<div class="gmail_extra">@@ -91,6 +91,7 @@ import os</div><div class="gmail_extra"> #include "lldb/API/SBThread.h"</div><div class="gmail_extra"> #include "lldb/API/SBType.h"</div><div class="gmail_extra">


 #include "lldb/API/SBTypeCategory.h"</div><div class="gmail_extra">+#include "lldb/API/SBTypeEnumMember.h"</div><div class="gmail_extra"> #include "lldb/API/SBTypeFilter.h"</div><div class="gmail_extra">


 #include "lldb/API/SBTypeFormat.h"</div><div class="gmail_extra"> #include "lldb/API/SBTypeNameSpecifier.h"</div><div class="gmail_extra">@@ -155,6 +156,7 @@ import os</div><div class="gmail_extra"> %include "./Python/interface/SBThread.i"</div>


<div class="gmail_extra"> %include "./Python/interface/SBType.i"</div><div class="gmail_extra"> %include "./Python/interface/SBTypeCategory.i"</div><div class="gmail_extra">+%include "./Python/interface/SBTypeEnumMember.i"</div>


<div class="gmail_extra"> %include "./Python/interface/SBTypeFilter.i"</div><div class="gmail_extra"> %include "./Python/interface/SBTypeFormat.i"</div><div class="gmail_extra"> %include "./Python/interface/SBTypeNameSpecifier.i"</div>


<div class="gmail_extra">diff --git a/source/API/CMakeLists.txt b/source/API/CMakeLists.txt</div><div class="gmail_extra">index ef70ad5..a5b26fe 100644</div><div class="gmail_extra">--- a/source/API/CMakeLists.txt</div><div class="gmail_extra">


+++ b/source/API/CMakeLists.txt</div><div class="gmail_extra">@@ -40,6 +40,7 @@ add_lldb_library(lldbAPI</div><div class="gmail_extra">  Â SBThread.cpp</div><div class="gmail_extra">  Â SBType.cpp</div><div class="gmail_extra">


  Â SBTypeCategory.cpp</div><div class="gmail_extra">+ Â SBTypeEnumMember.cpp</div><div class="gmail_extra">  Â SBTypeFilter.cpp</div><div class="gmail_extra">  Â SBTypeFormat.cpp</div><div class="gmail_extra">  Â SBTypeNameSpecifier.cpp</div>


<div class="gmail_extra">diff --git a/source/API/SBType.cpp b/source/API/SBType.cpp</div><div class="gmail_extra">index 9e25477..d9ee7eb 100644</div><div class="gmail_extra">--- a/source/API/SBType.cpp</div><div class="gmail_extra">


+++ b/source/API/SBType.cpp</div><div class="gmail_extra">@@ -9,6 +9,7 @@</div><div class="gmail_extra"> </div><div class="gmail_extra"> #include "lldb/API/SBDefines.h"</div><div class="gmail_extra"> #include "lldb/API/SBType.h"</div>


<div class="gmail_extra">+#include "lldb/API/SBTypeEnumMember.h"</div><div class="gmail_extra"> #include "lldb/API/SBStream.h"</div><div class="gmail_extra"> #include "lldb/Core/ConstString.h"</div>


<div class="gmail_extra"> #include "lldb/Core/Log.h"</div><div class="gmail_extra">@@ -17,6 +18,8 @@</div><div class="gmail_extra"> #include "lldb/Symbol/ClangASTType.h"</div><div class="gmail_extra">

 #include "lldb/Symbol/Type.h"</div>
<div class="gmail_extra"> </div><div class="gmail_extra">+#include "clang/AST/Decl.h"</div><div class="gmail_extra">+</div><div class="gmail_extra"> using namespace lldb;</div><div class="gmail_extra"> using namespace lldb_private;</div>


<div class="gmail_extra"> using namespace clang;</div><div class="gmail_extra">@@ -352,6 +355,27 @@ SBType::GetVirtualBaseClassAtIndex (uint32_t idx)</div><div class="gmail_extra">  Â  Â return sb_type_member;</div><div class="gmail_extra">


 }</div><div class="gmail_extra"> </div><div class="gmail_extra">+SBTypeEnumMemberList</div><div class="gmail_extra">+SBType::GetEnumMembers ()</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â SBTypeEnumMemberList sb_enum_member_list;</div>


<div class="gmail_extra">+ Â  Â if (IsValid())</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â const clang::EnumDecl *enum_decl = m_opaque_sp->GetClangASTType().GetFullyUnqualifiedType().GetAsEnumDecl();</div>


<div class="gmail_extra">+ Â  Â  Â  Â if (enum_decl)</div><div class="gmail_extra">+ Â  Â  Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;</div><div class="gmail_extra">


+ Â  Â  Â  Â  Â  Â for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â {</div><div class="gmail_extra">


+ Â  Â  Â  Â  Â  Â  Â  Â SBTypeEnumMember enum_member;</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â enum_member.reset(new TypeEnumMemberImpl(*enum_pos, ClangASTType(m_opaque_sp->GetASTContext(), enum_decl->getIntegerType())));</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â sb_enum_member_list.Append(enum_member);</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â }</div><div class="gmail_extra">+ Â  Â  Â  Â }</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">


+ Â  Â return sb_enum_member_list;</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra"> SBTypeMember</div><div class="gmail_extra"> SBType::GetFieldAtIndex (uint32_t idx)</div><div class="gmail_extra">


 {</div><div class="gmail_extra">diff --git a/source/API/SBTypeEnumMember.cpp b/source/API/SBTypeEnumMember.cpp</div><div class="gmail_extra">new file mode 100644</div><div class="gmail_extra">index 0000000..47c57dd</div>


<div class="gmail_extra">--- /dev/null</div><div class="gmail_extra">+++ b/source/API/SBTypeEnumMember.cpp</div><div class="gmail_extra">@@ -0,0 +1,192 @@</div><div class="gmail_extra">+//===-- SBTypeEnumMember.cpp ---------------------------------- -*- C++ -*-===//</div>


<div class="gmail_extra">+//</div><div class="gmail_extra">+// Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  The LLVM Compiler Infrastructure</div><div class="gmail_extra">+//</div><div class="gmail_extra">+// This file is distributed under the University of Illinois Open Source</div>


<div class="gmail_extra">+// License. See LICENSE.TXT for details.</div><div class="gmail_extra">+//</div><div class="gmail_extra">+//===----------------------------------------------------------------------===//</div><div class="gmail_extra">


+</div><div class="gmail_extra">+#include "lldb/API/SBDefines.h"</div><div class="gmail_extra">+#include "lldb/API/SBType.h"</div><div class="gmail_extra">+#include "lldb/API/SBTypeEnumMember.h"</div>


<div class="gmail_extra">+#include "lldb/API/SBStream.h"</div><div class="gmail_extra">+#include "lldb/Core/Stream.h"</div><div class="gmail_extra">+#include "lldb/Symbol/ClangASTType.h"</div>


<div class="gmail_extra">+#include "lldb/Symbol/Type.h"</div><div class="gmail_extra">+</div><div class="gmail_extra">+using namespace lldb;</div><div class="gmail_extra">+using namespace lldb_private;</div><div class="gmail_extra">


+using namespace clang;</div><div class="gmail_extra">+</div><div class="gmail_extra">+SBTypeEnumMember::SBTypeEnumMember() :</div><div class="gmail_extra">+ Â  Â m_opaque_sp()</div><div class="gmail_extra">+{</div><div class="gmail_extra">


+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+SBTypeEnumMember::~SBTypeEnumMember()</div><div class="gmail_extra">+{</div><div class="gmail_extra">+}</div><div class="gmail_extra">+SBTypeEnumMember::SBTypeEnumMember (const lldb::TypeEnumMemberImplSP &enum_member_sp) :</div>


<div class="gmail_extra">+ Â  Â m_opaque_sp(enum_member_sp)</div><div class="gmail_extra">+{</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+SBTypeEnumMember::SBTypeEnumMember (const SBTypeEnumMember& rhs) :</div>


<div class="gmail_extra">+ Â  Â m_opaque_sp()</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â if (this != &rhs)</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â if (rhs.IsValid())</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â m_opaque_sp.reset(new TypeEnumMemberImpl(rhs.ref()));</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">


+SBTypeEnumMember&</div><div class="gmail_extra">+SBTypeEnumMember::operator = (const SBTypeEnumMember& rhs)</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â if (this != &rhs)</div><div class="gmail_extra">


+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â if (rhs.IsValid())</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â m_opaque_sp.reset(new TypeEnumMemberImpl(rhs.ref()));</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">


+ Â  Â return *this;</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+bool</div><div class="gmail_extra">+SBTypeEnumMember::IsValid() const</div><div class="gmail_extra">+{</div>


<div class="gmail_extra">+ Â  Â return m_opaque_sp.get();</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+const char *</div><div class="gmail_extra">+SBTypeEnumMember::GetName ()</div>


<div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â if (m_opaque_sp.get())</div><div class="gmail_extra">+ Â  Â  Â  Â return m_opaque_sp->GetName().GetCString();</div><div class="gmail_extra">+ Â  Â return NULL;</div>


<div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+int64_t</div><div class="gmail_extra">+SBTypeEnumMember::GetValueAsSigned()</div><div class="gmail_extra">+{</div><div class="gmail_extra">


+ Â  Â if (m_opaque_sp.get())</div><div class="gmail_extra">+ Â  Â  Â  Â return m_opaque_sp->GetValueAsSigned();</div><div class="gmail_extra">+ Â  Â return 0;</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div>


<div class="gmail_extra">+uint64_t</div><div class="gmail_extra">+SBTypeEnumMember::GetValueAsUnsigned()</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â if (m_opaque_sp.get())</div><div class="gmail_extra">


+ Â  Â  Â  Â return m_opaque_sp->GetValueAsUnsigned();</div><div class="gmail_extra">+ Â  Â return 0;</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+SBType</div><div class="gmail_extra">


+SBTypeEnumMember::GetType ()</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â SBType sb_type;</div><div class="gmail_extra">+ Â  Â if (m_opaque_sp.get())</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">


+ Â  Â  Â  Â sb_type.SetSP(m_opaque_sp->GetIntegerType());</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+ Â  Â return sb_type;</div><div class="gmail_extra">+</div><div class="gmail_extra">+}</div><div class="gmail_extra">


+</div><div class="gmail_extra">+void</div><div class="gmail_extra">+SBTypeEnumMember::reset(TypeEnumMemberImpl *type_member_impl)</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â m_opaque_sp.reset(type_member_impl);</div>


<div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+TypeEnumMemberImpl &</div><div class="gmail_extra">+SBTypeEnumMember::ref ()</div><div class="gmail_extra">+{</div><div class="gmail_extra">


+ Â  Â if (m_opaque_sp.get() == NULL)</div><div class="gmail_extra">+ Â  Â  Â  Â m_opaque_sp.reset (new TypeEnumMemberImpl());</div><div class="gmail_extra">+ Â  Â return *m_opaque_sp.get();</div><div class="gmail_extra">+}</div>


<div class="gmail_extra">+</div><div class="gmail_extra">+const TypeEnumMemberImpl &</div><div class="gmail_extra">+SBTypeEnumMember::ref () const</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â return *m_opaque_sp.get();</div>


<div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+</div><div class="gmail_extra">+SBTypeEnumMemberList::SBTypeEnumMemberList() :</div><div class="gmail_extra">+ Â  Â m_opaque_ap(new TypeEnumMemberListImpl())</div>


<div class="gmail_extra">+{</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+SBTypeEnumMemberList::SBTypeEnumMemberList(const SBTypeEnumMemberList& rhs) :</div><div class="gmail_extra">


+ Â  Â m_opaque_ap(new TypeEnumMemberListImpl())</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â for (uint32_t i = 0, rhs_size = const_cast<SBTypeEnumMemberList&>(rhs).GetSize(); i < rhs_size; i++)</div>


<div class="gmail_extra">+ Â  Â  Â  Â Append(const_cast<SBTypeEnumMemberList&>(rhs).GetTypeEnumMemberAtIndex(i));</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+bool</div>


<div class="gmail_extra">+SBTypeEnumMemberList::IsValid ()</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â return (m_opaque_ap.get() != NULL);</div><div class="gmail_extra">+}</div><div class="gmail_extra">


+</div><div class="gmail_extra">+SBTypeEnumMemberList&</div><div class="gmail_extra">+SBTypeEnumMemberList::operator = (const SBTypeEnumMemberList& rhs)</div><div class="gmail_extra">+{</div><div class="gmail_extra">


+ Â  Â if (this != &rhs)</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â m_opaque_ap.reset (new TypeEnumMemberListImpl());</div><div class="gmail_extra">+ Â  Â  Â  Â for (uint32_t i = 0, rhs_size = const_cast<SBTypeEnumMemberList&>(rhs).GetSize(); i < rhs_size; i++)</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â Append(const_cast<SBTypeEnumMemberList&>(rhs).GetTypeEnumMemberAtIndex(i));</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+ Â  Â return *this;</div><div class="gmail_extra">


+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+void</div><div class="gmail_extra">+SBTypeEnumMemberList::Append (SBTypeEnumMember enum_member)</div><div class="gmail_extra">+{</div><div class="gmail_extra">


+ Â  Â if (enum_member.IsValid())</div><div class="gmail_extra">+ Â  Â  Â  Â m_opaque_ap->Append (enum_member.m_opaque_sp);</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+SBTypeEnumMember</div>


<div class="gmail_extra">+SBTypeEnumMemberList::GetTypeEnumMemberAtIndex(uint32_t index)</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â if (m_opaque_ap.get())</div><div class="gmail_extra">+ Â  Â  Â  Â return SBTypeEnumMember(m_opaque_ap->GetTypeEnumMemberAtIndex(index));</div>


<div class="gmail_extra">+ Â  Â return SBTypeEnumMember();</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+uint32_t</div><div class="gmail_extra">+SBTypeEnumMemberList::GetSize()</div>


<div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â return m_opaque_ap->GetSize();</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+SBTypeEnumMemberList::~SBTypeEnumMemberList()</div>


<div class="gmail_extra">+{</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra">+bool</div><div class="gmail_extra">+SBTypeEnumMember::GetDescription (lldb::SBStream &description, </div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â lldb::DescriptionLevel description_level)</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â Stream &strm = description.ref();</div><div class="gmail_extra">


+</div><div class="gmail_extra">+ Â  Â if (m_opaque_sp.get())</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â if( m_opaque_sp->GetIntegerType()->GetDescription(strm, description_level) )</div>


<div class="gmail_extra">+ Â  Â  Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â strm.Printf(" %s", m_opaque_sp->GetName().GetCString());</div><div class="gmail_extra">+ Â  Â  Â  Â }</div><div class="gmail_extra">

+ Â  Â }</div>
<div class="gmail_extra">+ Â  Â else</div><div class="gmail_extra">+ Â  Â {</div><div class="gmail_extra">+ Â  Â  Â  Â strm.PutCString ("No value");</div><div class="gmail_extra">+ Â  Â }</div><div class="gmail_extra">+ Â  Â return true;</div>


<div class="gmail_extra">+}</div><div class="gmail_extra">diff --git a/source/Symbol/ClangASTType.cpp b/source/Symbol/ClangASTType.cpp</div><div class="gmail_extra">index da445d8..ee55f18 100644</div><div class="gmail_extra">


--- a/source/Symbol/ClangASTType.cpp</div><div class="gmail_extra">+++ b/source/Symbol/ClangASTType.cpp</div><div class="gmail_extra">@@ -4307,6 +4307,15 @@ check_op_param (uint32_t op_kind, bool unary, bool binary, uint32_t num_params)</div>


<div class="gmail_extra">  Â  Â  Â  Â return false;</div><div class="gmail_extra"> }</div><div class="gmail_extra"> </div><div class="gmail_extra">+clang::EnumDecl *</div><div class="gmail_extra">+ClangASTType::GetAsEnumDecl () const</div>


<div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â const EnumType *enum_type = dyn_cast<EnumType>(GetCanonicalQualType());</div><div class="gmail_extra">+ Â  Â if (enum_type)</div><div class="gmail_extra">


+ Â  Â  Â  Â return enum_type->getDecl();</div><div class="gmail_extra">+ Â  Â return NULL;</div><div class="gmail_extra">+}</div><div class="gmail_extra">+</div><div class="gmail_extra"> clang::RecordDecl *</div><div class="gmail_extra">


 ClangASTType::GetAsRecordDecl () const</div><div class="gmail_extra"> {</div><div class="gmail_extra">diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp</div><div class="gmail_extra">index 0af2359..20dc583 100644</div>


<div class="gmail_extra">--- a/source/Symbol/Type.cpp</div><div class="gmail_extra">+++ b/source/Symbol/Type.cpp</div><div class="gmail_extra">@@ -30,6 +30,8 @@</div><div class="gmail_extra"> </div><div class="gmail_extra">


 #include "llvm/ADT/StringRef.h"</div><div class="gmail_extra"> </div><div class="gmail_extra">+#include "clang/AST/Decl.h"</div><div class="gmail_extra">+</div><div class="gmail_extra"> using namespace lldb;</div>


<div class="gmail_extra"> using namespace lldb_private;</div><div class="gmail_extra"> </div><div class="gmail_extra">@@ -988,3 +990,12 @@ TypeImpl::GetName ()</div><div class="gmail_extra">  Â  Â  Â  Â return m_clang_ast_type.GetConstTypeName();</div>


<div class="gmail_extra">  Â  Â return ConstString();</div><div class="gmail_extra"> }</div><div class="gmail_extra">+</div><div class="gmail_extra">+TypeEnumMemberImpl::TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl,</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â const lldb_private::ClangASTType& integer_type) :</div><div class="gmail_extra">+ Â  Â m_value(enum_member_decl->getInitVal()),</div><div class="gmail_extra">


+ Â  Â m_integer_type(new TypeImpl(integer_type))</div><div class="gmail_extra">+{</div><div class="gmail_extra">+ Â  Â m_name = ConstString(enum_member_decl->getNameAsString().c_str());</div><div class="gmail_extra">+ Â  Â m_valid = true;</div>


<div class="gmail_extra">+}</div><div class="gmail_extra">diff --git a/test/python_api/type/TestTypeList.py b/test/python_api/type/TestTypeList.py</div><div class="gmail_extra">index a06259d..36b60f5 100644</div><div class="gmail_extra">


--- a/test/python_api/type/TestTypeList.py</div><div class="gmail_extra">+++ b/test/python_api/type/TestTypeList.py</div><div class="gmail_extra">@@ -70,6 +70,11 @@ class TypeAndTypeListTestCase(TestBase):</div><div class="gmail_extra">


  Â  Â  Â  Â for type in type_list:</div><div class="gmail_extra">  Â  Â  Â  Â  Â  Â self.assertTrue(type)</div><div class="gmail_extra">  Â  Â  Â  Â  Â  Â self.DebugSBType(type)</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â for field in type.fields:</div>


<div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â if <a href="http://field.name" target="_blank">field.name</a> == "type":</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â for enum_member in field.type.enum_members:</div>

<div class="gmail_extra">
+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â self.assertTrue(enum_member)</div><div class="gmail_extra">+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â self.DebugSBType(enum_member.type)</div><div class="gmail_extra"> </div><div class="gmail_extra">  Â  Â  Â  Â # Pass an empty string. Â LLDB should not crash. :-)</div>


<div class="gmail_extra">  Â  Â  Â  Â fuzz_types = target.FindTypes(None)</div><div class="gmail_extra">diff --git a/test/python_api/type/main.cpp b/test/python_api/type/main.cpp</div><div class="gmail_extra">index db0e249..67b57ac 100644</div>


<div class="gmail_extra">--- a/test/python_api/type/main.cpp</div><div class="gmail_extra">+++ b/test/python_api/type/main.cpp</div><div class="gmail_extra">@@ -12,9 +12,14 @@ class Task {</div><div class="gmail_extra"> public:</div>


<div class="gmail_extra">  Â  Â int id;</div><div class="gmail_extra">  Â  Â Task *next;</div><div class="gmail_extra">+ Â  Â enum {</div><div class="gmail_extra">+ Â  Â  Â  Â TASK_TYPE_1,</div><div class="gmail_extra">+ Â  Â  Â  Â TASK_TYPE_2</div>


<div class="gmail_extra">+ Â  Â } type;</div><div class="gmail_extra">  Â  Â Task(int i, Task *n):</div><div class="gmail_extra">  Â  Â  Â  Â id(i),</div><div class="gmail_extra">- Â  Â  Â  Â next(n)</div><div class="gmail_extra">+ Â  Â  Â  Â next(n),</div>


<div class="gmail_extra">+ Â  Â  Â  Â type(TASK_TYPE_1)</div><div class="gmail_extra">  Â  Â {}</div><div class="gmail_extra"> };</div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"> </div><div class="gmail_extra">

-- </div><div class="gmail_extra">1.7.10.4</div>
<div class="gmail_extra"><br></div></font></span></div></div></div>
</blockquote></div><br></div>