diff options
Diffstat (limited to 'lldb/include')
-rw-r--r-- | lldb/include/lldb/API/SBFrame.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/API/SBType.h | 156 | ||||
-rw-r--r-- | lldb/include/lldb/API/SBValue.h | 56 | ||||
-rw-r--r-- | lldb/include/lldb/Symbol/ClangASTContext.h | 31 | ||||
-rw-r--r-- | lldb/include/lldb/Symbol/ClangASTType.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/Symbol/Type.h | 51 | ||||
-rw-r--r-- | lldb/include/lldb/lldb-enumerations.h | 29 | ||||
-rw-r--r-- | lldb/include/lldb/lldb-forward.h | 1 |
8 files changed, 250 insertions, 82 deletions
diff --git a/lldb/include/lldb/API/SBFrame.h b/lldb/include/lldb/API/SBFrame.h index 7729290fda9..47c59a908ce 100644 --- a/lldb/include/lldb/API/SBFrame.h +++ b/lldb/include/lldb/API/SBFrame.h @@ -200,8 +200,8 @@ private: lldb_private::StackFrame * get() const; - const lldb::StackFrameSP & - get_sp() const; + lldb::StackFrameSP & + get_sp(); #endif diff --git a/lldb/include/lldb/API/SBType.h b/lldb/include/lldb/API/SBType.h index 5ef83130016..5989ea769d4 100644 --- a/lldb/include/lldb/API/SBType.h +++ b/lldb/include/lldb/API/SBType.h @@ -16,78 +16,148 @@ namespace lldb { class SBTypeList; -class SBType +class SBTypeMember { public: - - SBType (const SBType &rhs); - - ~SBType (); - -#ifndef SWIG - const lldb::SBType & - operator = (const lldb::SBType &rhs); + SBTypeMember (); - bool - operator == (const lldb::SBType &rhs) const; + SBTypeMember (const lldb::SBTypeMember& rhs); + + ~SBTypeMember(); +#ifndef SWIG + lldb::SBTypeMember& + operator = (const lldb::SBTypeMember& rhs); +#endif + bool - operator != (const lldb::SBType &rhs) const; + IsValid() const; - lldb_private::TypeImpl & - ref (); + const char * + GetName (); - const lldb_private::TypeImpl & - ref () const; + lldb::SBType + GetType (); -#endif + uint64_t + GetOffsetByteSize(); +protected: + friend class SBType; + +#ifndef SWIG + void + reset (lldb_private::TypeMemberImpl *); + + lldb_private::TypeMemberImpl & + ref (); + + const lldb_private::TypeMemberImpl & + ref () const; +#endif + + std::auto_ptr<lldb_private::TypeMemberImpl> m_opaque_ap; +}; + +class SBType +{ +public: + + SBType(); + + SBType (const lldb::SBType &rhs); + + ~SBType (); + bool IsValid() const; size_t - GetByteSize() const; + GetByteSize(); bool - IsPointerType() const; + IsPointerType(); bool - IsReferenceType() const; + IsReferenceType(); - SBType - GetPointerType() const; + lldb::SBType + GetPointerType(); - SBType - GetPointeeType() const; + lldb::SBType + GetPointeeType(); - SBType - GetReferenceType() const; + lldb::SBType + GetReferenceType(); - SBType - GetDereferencedType() const; + lldb::SBType + GetDereferencedType(); - SBType - GetBasicType(lldb::BasicType type) const; - + lldb::SBType + GetBasicType(lldb::BasicType type); + + uint32_t + GetNumberOfFields (); + + uint32_t + GetNumberOfDirectBaseClasses (); + + uint32_t + GetNumberOfVirtualBaseClasses (); + + lldb::SBTypeMember + GetFieldAtIndex (uint32_t idx); + + lldb::SBTypeMember + GetDirectBaseClassAtIndex (uint32_t idx); + + lldb::SBTypeMember + GetVirtualBaseClassAtIndex (uint32_t idx); + const char* GetName(); + lldb::TypeClass + GetTypeClass (); + // DEPRECATED: but needed for Xcode right now static bool IsPointerType (void * clang_type); protected: + +#ifndef SWIG + lldb::SBType & + operator = (const lldb::SBType &rhs); + + bool + operator == (lldb::SBType &rhs); + + bool + operator != (lldb::SBType &rhs); + + lldb_private::TypeImpl & + ref (); + + const lldb_private::TypeImpl & + ref () const; + + void + reset(const lldb::TypeImplSP &type_impl_sp); +#endif + + lldb::TypeImplSP m_opaque_sp; friend class SBModule; friend class SBTarget; friend class SBValue; + friend class SBTypeMember; friend class SBTypeList; SBType (const lldb_private::ClangASTType &); SBType (const lldb::TypeSP &); SBType (const lldb::TypeImplSP &); - SBType(); }; @@ -96,28 +166,30 @@ class SBTypeList public: SBTypeList(); - SBTypeList(const SBTypeList& rhs); + SBTypeList(const lldb::SBTypeList& rhs); - SBTypeList& - operator = (const SBTypeList& rhs); + ~SBTypeList(); + + lldb::SBTypeList& + operator = (const lldb::SBTypeList& rhs); bool - IsValid() const; + IsValid(); void - Append (const SBType& type); + Append (lldb::SBType type); - SBType - GetTypeAtIndex(int index) const; + lldb::SBType + GetTypeAtIndex (uint32_t index); - int - GetSize() const; + uint32_t + GetSize(); - ~SBTypeList(); private: std::auto_ptr<lldb_private::TypeListImpl> m_opaque_ap; }; + } // namespace lldb diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index 44ec2cdb8a3..48fa0f3b478 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -22,17 +22,17 @@ class SBValue public: SBValue (); - SBValue (const SBValue &rhs); + SBValue (const lldb::SBValue &rhs); #ifndef SWIG - const SBValue & - operator =(const SBValue &rhs); + lldb::SBValue & + operator =(const lldb::SBValue &rhs); #endif ~SBValue (); bool - IsValid() const; + IsValid(); SBError GetError(); @@ -50,28 +50,22 @@ public: GetByteSize (); bool - IsInScope (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. - - bool IsInScope (); lldb::Format - GetFormat () const; + GetFormat (); void SetFormat (lldb::Format format); const char * - GetValue (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. - - const char * GetValue (); int64_t - GetValueAsSigned(SBError& error, int64_t fail_value=0); + GetValueAsSigned (lldb::SBError& error, int64_t fail_value=0); uint64_t - GetValueAsUnsigned(SBError& error, uint64_t fail_value=0); + GetValueAsUnsigned (lldb::SBError& error, uint64_t fail_value=0); int64_t GetValueAsSigned(int64_t fail_value=0); @@ -83,56 +77,43 @@ public: GetValueType (); bool - GetValueDidChange (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. - - bool GetValueDidChange (); const char * - GetSummary (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. - - const char * GetSummary (); const char * - GetObjectDescription (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. - - const char * GetObjectDescription (); const char * - GetLocation (const lldb::SBFrame &frame); // DEPRECATED - SBValues know their own frames. - - const char * GetLocation (); bool - SetValueFromCString (const lldb::SBFrame &frame, const char *value_str); // DEPRECATED - SBValues know their own frames. - - bool SetValueFromCString (const char *value_str); lldb::SBValue GetChildAtIndex (uint32_t idx); lldb::SBValue - CreateChildAtOffset (const char *name, uint32_t offset, const SBType& type); + CreateChildAtOffset (const char *name, uint32_t offset, lldb::SBType type); lldb::SBValue - Cast(const SBType& type); + Cast (lldb::SBType type); lldb::SBValue CreateValueFromExpression (const char *name, const char* expression); lldb::SBValue - CreateValueFromAddress(const char* name, lldb::addr_t address, const SBType& type); + CreateValueFromAddress (const char* name, + lldb::addr_t address, + lldb::SBType type); // this has no address! GetAddress() and GetLoadAddress() as well as AddressOf() // on the return of this call all return invalid lldb::SBValue CreateValueFromData (const char* name, - const SBData& data, - const SBType& type); + lldb::SBData data, + lldb::SBType type); //------------------------------------------------------------------ /// Get a child value by index from a value. @@ -279,7 +260,7 @@ public: bool TypeIsPointerType (); - SBType + lldb::SBType GetType(); bool @@ -289,7 +270,8 @@ public: GetExpressionPath (lldb::SBStream &description); bool - GetExpressionPath (lldb::SBStream &description, bool qualify_cxx_base_classes); + GetExpressionPath (lldb::SBStream &description, + bool qualify_cxx_base_classes); SBValue (const lldb::ValueObjectSP &value_sp); @@ -298,8 +280,8 @@ public: // currently rely on being able to extract the SharedPointer out of an SBValue. if the implementation // is deferred to the .cpp file instead of being inlined here, the platform will fail to link // correctly. however, this is temporary till a better general solution is found. FIXME - const lldb::ValueObjectSP& - get_sp() const + lldb::ValueObjectSP& + get_sp() { return m_opaque_sp; } diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index ffd5e1b16f4..8fbd99cf1b6 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -413,6 +413,37 @@ public: lldb::clang_type_t clang_type, bool omit_empty_base_classes); + static uint32_t + GetNumDirectBaseClasses (clang::ASTContext *ast, + lldb::clang_type_t clang_type); + + static uint32_t + GetNumVirtualBaseClasses (clang::ASTContext *ast, + lldb::clang_type_t clang_type); + + static uint32_t + GetNumFields (clang::ASTContext *ast, + lldb::clang_type_t clang_type); + + static lldb::clang_type_t + GetDirectBaseClassAtIndex (clang::ASTContext *ast, + lldb::clang_type_t clang_type, + uint32_t idx, + uint32_t *byte_offset_ptr); + + static lldb::clang_type_t + GetVirtualBaseClassAtIndex (clang::ASTContext *ast, + lldb::clang_type_t clang_type, + uint32_t idx, + uint32_t *byte_offset_ptr); + + static lldb::clang_type_t + GetFieldAtIndex (clang::ASTContext *ast, + lldb::clang_type_t clang_type, + uint32_t idx, + std::string& name, + uint32_t *byte_offset_ptr); + static uint32_t GetNumPointeeChildren (lldb::clang_type_t clang_type); diff --git a/lldb/include/lldb/Symbol/ClangASTType.h b/lldb/include/lldb/Symbol/ClangASTType.h index 9d256b77540..841afd16598 100644 --- a/lldb/include/lldb/Symbol/ClangASTType.h +++ b/lldb/include/lldb/Symbol/ClangASTType.h @@ -107,6 +107,10 @@ public: GetMinimumLanguage (clang::ASTContext *ctx, lldb::clang_type_t clang_type); + static lldb::TypeClass + GetTypeClass (clang::ASTContext *ast_context, + lldb::clang_type_t clang_type); + void DumpValue (ExecutionContext *exe_ctx, Stream *s, diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index a35f1003034..d228164776a 100644 --- a/lldb/include/lldb/Symbol/Type.h +++ b/lldb/include/lldb/Symbol/Type.h @@ -390,6 +390,57 @@ public: private: std::vector<lldb::TypeImplSP> m_content; }; + +class TypeMemberImpl +{ +public: + TypeMemberImpl () : + m_type_impl_sp (), + m_bit_offset (0), + m_name () + { + } + + TypeMemberImpl (const lldb::TypeImplSP &type_impl_sp, + uint64_t bit_offset, + const ConstString &name) : + m_type_impl_sp (type_impl_sp), + m_bit_offset (bit_offset), + m_name (name) + { + } + + TypeMemberImpl (const lldb::TypeImplSP &type_impl_sp, + uint64_t bit_offset): + m_type_impl_sp (type_impl_sp), + m_bit_offset (bit_offset), + m_name () + { + } + + const lldb::TypeImplSP & + GetTypeImpl () + { + return m_type_impl_sp; + } + + const ConstString & + GetName () const + { + return m_name; + } + + uint64_t + GetBitOffset () const + { + return m_bit_offset; + } + +protected: + lldb::TypeImplSP m_type_impl_sp; + uint64_t m_bit_offset; + ConstString m_name; +}; } // namespace lldb_private diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index 950796d67a0..704df80edf3 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -550,7 +550,34 @@ namespace lldb { eBasicTypeObjCClass, eBasicTypeObjCSel } BasicType; - + + typedef enum TypeClass + { + eTypeClassInvalid = (0u), + eTypeClassArray = (1u << 0), + eTypeClassBlockPointer = (1u << 1), + eTypeClassBuiltin = (1u << 2), + eTypeClassClass = (1u << 3), + eTypeClassComplexFloat = (1u << 4), + eTypeClassComplexInteger = (1u << 5), + eTypeClassEnumeration = (1u << 6), + eTypeClassFunction = (1u << 7), + eTypeClassMemberPointer = (1u << 8), + eTypeClassObjCObject = (1u << 9), + eTypeClassObjCInterface = (1u << 10), + eTypeClassObjCObjectPointer = (1u << 11), + eTypeClassPointer = (1u << 12), + eTypeClassReference = (1u << 13), + eTypeClassStruct = (1u << 14), + eTypeClassTypedef = (1u << 15), + eTypeClassUnion = (1u << 16), + eTypeClassVector = (1u << 17), + // Define the last type class as the MSBit of a 32 bit value + eTypeClassOther = (1u << 31), + // Define a mask that can be used for any type when finding types + eTypeClassAny = (0xffffffffu) + }TypeClass; + } // namespace lldb diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h index c07af33ce20..ac155ff7798 100644 --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -170,6 +170,7 @@ class TypeImpl; class TypeAndOrName; class TypeList; class TypeListImpl; +class TypeMemberImpl; class UUID; class Unwind; class UnwindAssembly; |