Change by Russell Harmon.
Xcode project updates (and all errors therein)
by Todd Fiala.
llvm-svn: 210046
class LLDB_API SBThread;
class LLDB_API SBType;
class LLDB_API SBTypeCategory;
+class LLDB_API SBTypeEnumMember;
+class LLDB_API SBTypeEnumMemberList;
class LLDB_API SBTypeFilter;
class LLDB_API SBTypeFormat;
class LLDB_API SBTypeNameSpecifier;
friend class SBTarget;
friend class SBThread;
friend class SBType;
+ friend class SBTypeEnumMember;
friend class SBTypeMember;
friend class SBValue;
friend class SBWatchpoint;
lldb::SBTypeMember
GetVirtualBaseClassAtIndex (uint32_t idx);
+ lldb::SBTypeEnumMemberList
+ GetEnumMembers();
+
uint32_t
GetNumberOfTemplateArguments ();
friend class SBFunction;
friend class SBModule;
friend class SBTarget;
+ friend class SBTypeEnumMember;
+ friend class SBTypeEnumMemberList;
friend class SBTypeNameSpecifier;
friend class SBTypeMember;
friend class SBTypeList;
--- /dev/null
+
+//===-- SBTypeEnumMember.h --------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBTypeEnumMember_h_
+#define LLDB_SBTypeEnumMember_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+
+class SBTypeEnumMember
+{
+public:
+ SBTypeEnumMember ();
+
+ SBTypeEnumMember (const SBTypeEnumMember& rhs);
+
+ ~SBTypeEnumMember();
+
+ SBTypeEnumMember&
+ operator = (const SBTypeEnumMember& rhs);
+
+ bool
+ IsValid() const;
+
+ int64_t
+ GetValueAsSigned();
+
+ uint64_t
+ GetValueAsUnsigned();
+
+ const char *
+ GetName ();
+
+ lldb::SBType
+ GetType ();
+
+ bool
+ GetDescription (lldb::SBStream &description,
+ lldb::DescriptionLevel description_level);
+
+protected:
+ friend class SBType;
+ friend class SBTypeEnumMemberList;
+
+ void
+ reset (lldb_private::TypeEnumMemberImpl *);
+
+ lldb_private::TypeEnumMemberImpl &
+ ref ();
+
+ const lldb_private::TypeEnumMemberImpl &
+ ref () const;
+
+ lldb::TypeEnumMemberImplSP m_opaque_sp;
+
+ SBTypeEnumMember (const lldb::TypeEnumMemberImplSP &);
+};
+
+class SBTypeEnumMemberList
+{
+public:
+ SBTypeEnumMemberList();
+
+ SBTypeEnumMemberList(const SBTypeEnumMemberList& rhs);
+
+ ~SBTypeEnumMemberList();
+
+ SBTypeEnumMemberList&
+ operator = (const SBTypeEnumMemberList& rhs);
+
+ bool
+ IsValid();
+
+ void
+ Append (SBTypeEnumMember entry);
+
+ SBTypeEnumMember
+ GetTypeEnumMemberAtIndex (uint32_t index);
+
+ uint32_t
+ GetSize();
+
+
+private:
+ std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_ap;
+};
+
+} // namespace lldb
+
+#endif // LLDB_SBTypeEnumMember_h_
class DiagnosticsEngine;
class DiagnosticOptions;
class EnumDecl;
+ class EnumConstantDecl;
class Expr;
class ExternalASTSource;
class ExtVectorElementExpr;
AddressType address_type,
StreamString &new_value);
+ clang::EnumDecl *
+ GetAsEnumDecl () const;
+
clang::RecordDecl *
GetAsRecordDecl () const;
#include "lldb/Symbol/ClangASTType.h"
#include "lldb/Symbol/Declaration.h"
+#include "llvm/ADT/APSInt.h"
+
#include <set>
namespace lldb_private {
TypePair m_type_pair;
ConstString m_type_name;
};
-
+
+class TypeEnumMemberImpl
+{
+public:
+ TypeEnumMemberImpl () :
+ m_integer_type(),
+ m_name("<invalid>"),
+ m_value(),
+ m_valid(false)
+ {
+ }
+
+ TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl,
+ const lldb_private::ClangASTType& integer_type);
+
+ TypeEnumMemberImpl (const TypeEnumMemberImpl& rhs) :
+ m_integer_type(rhs.m_integer_type),
+ m_name(rhs.m_name),
+ m_value(rhs.m_value),
+ m_valid(rhs.m_valid)
+ {
+ }
+
+ TypeEnumMemberImpl&
+ operator = (const TypeEnumMemberImpl& rhs);
+
+ bool
+ IsValid ()
+ {
+ return m_valid;
+ }
+
+ const ConstString &
+ GetName () const
+ {
+ return m_name;
+ }
+
+ const lldb::TypeImplSP &
+ GetIntegerType () const
+ {
+ return m_integer_type;
+ }
+
+ uint64_t
+ GetValueAsUnsigned () const
+ {
+ return *m_value.getRawData();
+ }
+
+ int64_t
+ GetValueAsSigned () const
+ {
+ return (int64_t) *m_value.getRawData();
+ }
+
+protected:
+ lldb::TypeImplSP m_integer_type;
+ ConstString m_name;
+ llvm::APSInt m_value;
+ bool m_valid;
+};
+
+class TypeEnumMemberListImpl
+{
+public:
+ TypeEnumMemberListImpl() :
+ m_content()
+ {
+ }
+
+ void
+ Append (const lldb::TypeEnumMemberImplSP& type)
+ {
+ m_content.push_back(type);
+ }
+
+ void
+ Append (const lldb_private::TypeEnumMemberListImpl& type_list);
+
+ lldb::TypeEnumMemberImplSP
+ GetTypeEnumMemberAtIndex(size_t idx)
+ {
+ lldb::TypeEnumMemberImplSP enum_member;
+ if (idx < GetSize())
+ enum_member = m_content[idx];
+ return enum_member;
+ }
+
+ size_t
+ GetSize()
+ {
+ return m_content.size();
+ }
+
+private:
+ std::vector<lldb::TypeEnumMemberImplSP> m_content;
+};
+
} // namespace lldb_private
#endif // liblldb_Type_h_
class TypeList;
class TypeListImpl;
class TypeMemberImpl;
+class TypeEnumMemberImpl;
+class TypeEnumMemberListImpl;
class TypeNameSpecifierImpl;
class TypePair;
class UUID;
typedef std::weak_ptr<lldb_private::Type> TypeWP;
typedef std::shared_ptr<lldb_private::TypeCategoryImpl> TypeCategoryImplSP;
typedef std::shared_ptr<lldb_private::TypeImpl> TypeImplSP;
+ typedef std::shared_ptr<lldb_private::TypeEnumMemberImpl> TypeEnumMemberImplSP;
typedef std::shared_ptr<lldb_private::TypeFilterImpl> TypeFilterImplSP;
typedef std::shared_ptr<lldb_private::TypeFormatImpl> TypeFormatImplSP;
typedef std::shared_ptr<lldb_private::TypeNameSpecifierImpl> TypeNameSpecifierImplSP;
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 23EFE389193D1ABC00E54E54 /* SBTypeEnumMember.h in Headers */ = {isa = PBXBuildFile; fileRef = 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 23EFE38B193D1AEC00E54E54 /* SBTypeEnumMember.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */; };
260157C61885F51C00F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
260157C71885F52500F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
260157C81885F53100F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
/* Begin PBXFileReference section */
23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterInfoInterface.h; path = Utility/RegisterInfoInterface.h; sourceTree = "<group>"; };
+ 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeEnumMember.h; path = include/lldb/API/SBTypeEnumMember.h; sourceTree = "<group>"; };
+ 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeEnumMember.cpp; path = source/API/SBTypeEnumMember.cpp; sourceTree = "<group>"; };
260157C41885F4FF00F875CF /* libpanel.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpanel.dylib; path = /usr/lib/libpanel.dylib; sourceTree = "<absolute>"; };
260223E7115F06D500A601A2 /* SBCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCommunication.h; path = include/lldb/API/SBCommunication.h; sourceTree = "<group>"; };
260223E8115F06E500A601A2 /* SBCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommunication.cpp; path = source/API/SBCommunication.cpp; sourceTree = "<group>"; };
08FB7794FE84155DC02AAC07 /* lldb */ = {
isa = PBXGroup;
children = (
+ 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */,
+ 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */,
26F5C32810F3DF7D009D5894 /* Libraries */,
264E8576159BE51A00E9D7A2 /* Resources */,
08FB7795FE84155DC02AAC07 /* Source */,
26D265A2136B40EE002EEE45 /* SharingPtr.h in Headers */,
26D265BC136B4269002EEE45 /* lldb-public.h in Headers */,
4CE4F673162C971A00F75CB3 /* SBExpressionOptions.h in Headers */,
+ 23EFE389193D1ABC00E54E54 /* SBTypeEnumMember.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 23EFE38B193D1AEC00E54E54 /* SBTypeEnumMember.cpp in Sources */,
9461569A14E358A6003A195C /* SBTypeFilter.cpp in Sources */,
9461569B14E358A6003A195C /* SBTypeFormat.cpp in Sources */,
262F12B51835468600AEB384 /* SBPlatform.cpp in Sources */,
lldb::SBTypeMember
GetVirtualBaseClassAtIndex (uint32_t idx);
+ lldb::SBTypeEnumMemberList
+ GetEnumMembers();
+
const char*
GetName();
members.append(field)
return members
+ def get_enum_members_array(self):
+ '''An accessor function that returns a list() that contains all enum members in an lldb.SBType object.'''
+ enum_members_list = []
+ sb_enum_members = self.GetEnumMembers()
+ for idx in range(sb_enum_members.GetSize()):
+ enum_members_list.append(sb_enum_members.GetTypeEnumMemberAtIndex(idx))
+ return enum_members_list
+
__swig_getmethods__["bases"] = get_bases_array
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.''')
__swig_getmethods__["members"] = get_members_array
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.''')
+ __swig_getmethods__["enum_members"] = get_enum_members_array
+ 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.''')
+
%}
};
--- /dev/null
+//===-- SWIG Interface for SBTypeEnumMember ---------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+%feature(
+ "docstring",
+ "Represents a member of an enum in lldb."
+) SBTypeEnumMember;
+
+class SBTypeEnumMember
+{
+public:
+ SBTypeEnumMember ();
+
+ SBTypeEnumMember (const SBTypeEnumMember& rhs);
+
+ ~SBTypeEnumMember();
+
+ bool
+ IsValid() const;
+
+ int64_t
+ GetValueAsSigned();
+
+ uint64_t
+ GetValueAsUnsigned();
+
+ const char *
+ GetName ();
+
+ lldb::SBType
+ GetType ();
+
+ bool
+ GetDescription (lldb::SBStream &description,
+ lldb::DescriptionLevel description_level);
+
+ %pythoncode %{
+ __swig_getmethods__["name"] = GetName
+ if _newclass: name = property(GetName, None, doc='''A read only property that returns the name for this enum member as a string.''')
+
+ __swig_getmethods__["type"] = GetType
+ 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.''')
+
+ __swig_getmethods__["signed"] = GetValueAsSigned
+ if _newclass: signed = property(GetValueAsSigned, None, doc='''A read only property that returns the value of this enum member as a signed integer.''')
+
+ __swig_getmethods__["unsigned"] = GetValueAsUnsigned
+ if _newclass: unsigned = property(GetValueAsUnsigned, None, doc='''A read only property that returns the value of this enum member as a unsigned integer.''')
+ %}
+
+protected:
+ friend class SBType;
+ friend class SBTypeEnumMemberList;
+
+ void
+ reset (lldb_private::TypeEnumMemberImpl *);
+
+ lldb_private::TypeEnumMemberImpl &
+ ref ();
+
+ const lldb_private::TypeEnumMemberImpl &
+ ref () const;
+
+ lldb::TypeEnumMemberImplSP m_opaque_sp;
+
+ SBTypeEnumMember (const lldb::TypeEnumMemberImplSP &);
+};
+
+%feature(
+ "docstring",
+ "Represents a list of SBTypeEnumMembers."
+) SBTypeEnumMemberList;
+
+class SBTypeEnumMemberList
+{
+public:
+ SBTypeEnumMemberList();
+
+ SBTypeEnumMemberList(const SBTypeEnumMemberList& rhs);
+
+ ~SBTypeEnumMemberList();
+
+ bool
+ IsValid();
+
+ void
+ Append (SBTypeEnumMember entry);
+
+ SBTypeEnumMember
+ GetTypeEnumMemberAtIndex (uint32_t index);
+
+ uint32_t
+ GetSize();
+
+
+private:
+ std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_ap;
+};
+
+} // namespace lldb
return PyString_FromString("");
}
}
+%extend lldb::SBTypeEnumMember {
+ PyObject *lldb::SBTypeEnumMember::__str__ (){
+ lldb::SBStream description;
+ $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+ const char *desc = description.GetData();
+ size_t desc_len = description.GetSize();
+ if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
+ --desc_len;
+ if (desc_len > 0)
+ return PyString_FromStringAndSize (desc, desc_len);
+ else
+ return PyString_FromString("");
+ }
+}
%extend lldb::SBTypeNameSpecifier {
PyObject *lldb::SBTypeNameSpecifier::__str__ (){
lldb::SBStream description;
#include "lldb/API/SBThread.h"
#include "lldb/API/SBType.h"
#include "lldb/API/SBTypeCategory.h"
+#include "lldb/API/SBTypeEnumMember.h"
#include "lldb/API/SBTypeFilter.h"
#include "lldb/API/SBTypeFormat.h"
#include "lldb/API/SBTypeNameSpecifier.h"
%include "./Python/interface/SBThread.i"
%include "./Python/interface/SBType.i"
%include "./Python/interface/SBTypeCategory.i"
+%include "./Python/interface/SBTypeEnumMember.i"
%include "./Python/interface/SBTypeFilter.i"
%include "./Python/interface/SBTypeFormat.i"
%include "./Python/interface/SBTypeNameSpecifier.i"
SBThread.cpp
SBType.cpp
SBTypeCategory.cpp
+ SBTypeEnumMember.cpp
SBTypeFilter.cpp
SBTypeFormat.cpp
SBTypeNameSpecifier.cpp
#include "lldb/API/SBDefines.h"
#include "lldb/API/SBType.h"
+#include "lldb/API/SBTypeEnumMember.h"
#include "lldb/API/SBStream.h"
#include "lldb/Core/ConstString.h"
#include "lldb/Core/Log.h"
#include "lldb/Symbol/ClangASTType.h"
#include "lldb/Symbol/Type.h"
+#include "clang/AST/Decl.h"
+
using namespace lldb;
using namespace lldb_private;
using namespace clang;
return sb_type_member;
}
+SBTypeEnumMemberList
+SBType::GetEnumMembers ()
+{
+ SBTypeEnumMemberList sb_enum_member_list;
+ if (IsValid())
+ {
+ const clang::EnumDecl *enum_decl = m_opaque_sp->GetClangASTType(true).GetFullyUnqualifiedType().GetAsEnumDecl();
+ if (enum_decl)
+ {
+ clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
+ for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
+ {
+ SBTypeEnumMember enum_member;
+ enum_member.reset(new TypeEnumMemberImpl(*enum_pos, ClangASTType(m_opaque_sp->GetClangASTContext(true), enum_decl->getIntegerType())));
+ sb_enum_member_list.Append(enum_member);
+ }
+ }
+ }
+ return sb_enum_member_list;
+}
+
SBTypeMember
SBType::GetFieldAtIndex (uint32_t idx)
{
--- /dev/null
+//===-- SBTypeEnumMember.cpp ---------------------------------- -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/API/SBDefines.h"
+#include "lldb/API/SBType.h"
+#include "lldb/API/SBTypeEnumMember.h"
+#include "lldb/API/SBStream.h"
+#include "lldb/Core/Stream.h"
+#include "lldb/Symbol/ClangASTType.h"
+#include "lldb/Symbol/Type.h"
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace clang;
+
+SBTypeEnumMember::SBTypeEnumMember() :
+ m_opaque_sp()
+{
+}
+
+SBTypeEnumMember::~SBTypeEnumMember()
+{
+}
+SBTypeEnumMember::SBTypeEnumMember (const lldb::TypeEnumMemberImplSP &enum_member_sp) :
+ m_opaque_sp(enum_member_sp)
+{
+}
+
+SBTypeEnumMember::SBTypeEnumMember (const SBTypeEnumMember& rhs) :
+ m_opaque_sp()
+{
+ if (this != &rhs)
+ {
+ if (rhs.IsValid())
+ m_opaque_sp.reset(new TypeEnumMemberImpl(rhs.ref()));
+ }
+}
+
+SBTypeEnumMember&
+SBTypeEnumMember::operator = (const SBTypeEnumMember& rhs)
+{
+ if (this != &rhs)
+ {
+ if (rhs.IsValid())
+ m_opaque_sp.reset(new TypeEnumMemberImpl(rhs.ref()));
+ }
+ return *this;
+}
+
+bool
+SBTypeEnumMember::IsValid() const
+{
+ return m_opaque_sp.get();
+}
+
+const char *
+SBTypeEnumMember::GetName ()
+{
+ if (m_opaque_sp.get())
+ return m_opaque_sp->GetName().GetCString();
+ return NULL;
+}
+
+int64_t
+SBTypeEnumMember::GetValueAsSigned()
+{
+ if (m_opaque_sp.get())
+ return m_opaque_sp->GetValueAsSigned();
+ return 0;
+}
+
+uint64_t
+SBTypeEnumMember::GetValueAsUnsigned()
+{
+ if (m_opaque_sp.get())
+ return m_opaque_sp->GetValueAsUnsigned();
+ return 0;
+}
+
+SBType
+SBTypeEnumMember::GetType ()
+{
+ SBType sb_type;
+ if (m_opaque_sp.get())
+ {
+ sb_type.SetSP(m_opaque_sp->GetIntegerType());
+ }
+ return sb_type;
+
+}
+
+void
+SBTypeEnumMember::reset(TypeEnumMemberImpl *type_member_impl)
+{
+ m_opaque_sp.reset(type_member_impl);
+}
+
+TypeEnumMemberImpl &
+SBTypeEnumMember::ref ()
+{
+ if (m_opaque_sp.get() == NULL)
+ m_opaque_sp.reset (new TypeEnumMemberImpl());
+ return *m_opaque_sp.get();
+}
+
+const TypeEnumMemberImpl &
+SBTypeEnumMember::ref () const
+{
+ return *m_opaque_sp.get();
+}
+
+
+SBTypeEnumMemberList::SBTypeEnumMemberList() :
+ m_opaque_ap(new TypeEnumMemberListImpl())
+{
+}
+
+SBTypeEnumMemberList::SBTypeEnumMemberList(const SBTypeEnumMemberList& rhs) :
+ m_opaque_ap(new TypeEnumMemberListImpl())
+{
+ for (uint32_t i = 0, rhs_size = const_cast<SBTypeEnumMemberList&>(rhs).GetSize(); i < rhs_size; i++)
+ Append(const_cast<SBTypeEnumMemberList&>(rhs).GetTypeEnumMemberAtIndex(i));
+}
+
+bool
+SBTypeEnumMemberList::IsValid ()
+{
+ return (m_opaque_ap.get() != NULL);
+}
+
+SBTypeEnumMemberList&
+SBTypeEnumMemberList::operator = (const SBTypeEnumMemberList& rhs)
+{
+ if (this != &rhs)
+ {
+ m_opaque_ap.reset (new TypeEnumMemberListImpl());
+ for (uint32_t i = 0, rhs_size = const_cast<SBTypeEnumMemberList&>(rhs).GetSize(); i < rhs_size; i++)
+ Append(const_cast<SBTypeEnumMemberList&>(rhs).GetTypeEnumMemberAtIndex(i));
+ }
+ return *this;
+}
+
+void
+SBTypeEnumMemberList::Append (SBTypeEnumMember enum_member)
+{
+ if (enum_member.IsValid())
+ m_opaque_ap->Append (enum_member.m_opaque_sp);
+}
+
+SBTypeEnumMember
+SBTypeEnumMemberList::GetTypeEnumMemberAtIndex(uint32_t index)
+{
+ if (m_opaque_ap.get())
+ return SBTypeEnumMember(m_opaque_ap->GetTypeEnumMemberAtIndex(index));
+ return SBTypeEnumMember();
+}
+
+uint32_t
+SBTypeEnumMemberList::GetSize()
+{
+ return m_opaque_ap->GetSize();
+}
+
+SBTypeEnumMemberList::~SBTypeEnumMemberList()
+{
+}
+
+bool
+SBTypeEnumMember::GetDescription (lldb::SBStream &description,
+ lldb::DescriptionLevel description_level)
+{
+ Stream &strm = description.ref();
+
+ if (m_opaque_sp.get())
+ {
+ if( m_opaque_sp->GetIntegerType()->GetDescription(strm, description_level) )
+ {
+ strm.Printf(" %s", m_opaque_sp->GetName().GetCString());
+ }
+ }
+ else
+ {
+ strm.PutCString ("No value");
+ }
+ return true;
+}
return true;
}
+clang::EnumDecl *
+ClangASTType::GetAsEnumDecl () const
+{
+ const clang::EnumType *enum_type = llvm::dyn_cast<clang::EnumType>(GetCanonicalQualType());
+ if (enum_type)
+ return enum_type->getDecl();
+ return NULL;
+}
+
clang::RecordDecl *
ClangASTType::GetAsRecordDecl () const
{
#include "llvm/ADT/StringRef.h"
+#include "clang/AST/Decl.h"
+
using namespace lldb;
using namespace lldb_private;
m_static_type.GetClangASTType().DumpTypeDescription(&strm);
return true;
}
+
+TypeEnumMemberImpl::TypeEnumMemberImpl (const clang::EnumConstantDecl* enum_member_decl,
+ const lldb_private::ClangASTType& integer_type) :
+ m_value(enum_member_decl->getInitVal()),
+ m_integer_type(new TypeImpl(integer_type))
+{
+ m_name = ConstString(enum_member_decl->getNameAsString().c_str());
+ m_valid = true;
+}
for type in type_list:
self.assertTrue(type)
self.DebugSBType(type)
+ for field in type.fields:
+ if field.name == "type":
+ for enum_member in field.type.enum_members:
+ self.assertTrue(enum_member)
+ self.DebugSBType(enum_member.type)
# Pass an empty string. LLDB should not crash. :-)
fuzz_types = target.FindTypes(None)
public:
int id;
Task *next;
+ enum {
+ TASK_TYPE_1,
+ TASK_TYPE_2
+ } type;
Task(int i, Task *n):
id(i),
- next(n)
+ next(n),
+ type(TASK_TYPE_1)
{}
};