diff options
author | Greg Clayton <gclayton@apple.com> | 2011-09-09 23:04:00 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-09-09 23:04:00 +0000 |
commit | bf2331c4917bb35b9a50f6ddcf7993d6312cccff (patch) | |
tree | d71cc5f39c112aae3fca6bfb7e506bd9229446ac /lldb/scripts/Python | |
parent | b3722e222377cf3384bb2bafda90cfeb4e151df5 (diff) | |
download | bcm5719-llvm-bf2331c4917bb35b9a50f6ddcf7993d6312cccff.tar.gz bcm5719-llvm-bf2331c4917bb35b9a50f6ddcf7993d6312cccff.zip |
Added the ability to introspect types thourgh the public SBType interface.
Fixed up many API calls to not be "const" as const doesn't mean anything to
most of our lldb::SB objects since they contain a shared pointer, auto_ptr, or
pointer to the types which circumvent the constness anyway.
llvm-svn: 139428
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r-- | lldb/scripts/Python/interface/SBType.i | 100 | ||||
-rw-r--r-- | lldb/scripts/Python/interface/SBValue.i | 14 |
2 files changed, 82 insertions, 32 deletions
diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i index 3086338d800..ea20754e8f5 100644 --- a/lldb/scripts/Python/interface/SBType.i +++ b/lldb/scripts/Python/interface/SBType.i @@ -9,6 +9,35 @@ namespace lldb { + %feature("docstring", +"Represents a member of a type in lldb. +") SBTypeMember; + +class SBTypeMember +{ +public: + SBTypeMember (); + + SBTypeMember (const lldb::SBTypeMember& rhs); + + ~SBTypeMember(); + + bool + IsValid() const; + + const char * + GetName (); + + lldb::SBType + GetType (); + + uint64_t + GetOffsetByteSize(); + +protected: + std::auto_ptr<lldb_private::TypeMemberImpl> m_opaque_ap; +}; + %feature("docstring", "Represents a data type in lldb. The FindFirstType() method of SBTarget/SBModule returns a SBType. @@ -85,39 +114,60 @@ find_type.py: class SBType { public: - SBType (const SBType &rhs); + SBType (const lldb::SBType &rhs); ~SBType (); bool - IsValid() const; + IsValid(); size_t - GetByteSize() const; + GetByteSize(); bool - IsPointerType() const; + IsPointerType(); bool - IsReferenceType() const; - - SBType - GetPointerType() const; - - SBType - GetPointeeType() const; - - SBType - GetReferenceType() const; - - SBType - GetDereferencedType() const; - - SBType - GetBasicType(lldb::BasicType type) const; + IsReferenceType(); + + lldb::SBType + GetPointerType(); + + lldb::SBType + GetPointeeType(); + + lldb::SBType + GetReferenceType(); + + lldb::SBType + GetDereferencedType(); + + 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 (); }; %feature("docstring", @@ -157,15 +207,15 @@ public: SBTypeList(); bool - IsValid() const; + IsValid(); void - Append(const SBType& type); + Append (lldb::SBType type); - SBType - GetTypeAtIndex(int index); + lldb::SBType + GetTypeAtIndex (uint32_t index); - int + uint32_t GetSize(); ~SBTypeList(); diff --git a/lldb/scripts/Python/interface/SBValue.i b/lldb/scripts/Python/interface/SBValue.i index e87241070cb..8792464b245 100644 --- a/lldb/scripts/Python/interface/SBValue.i +++ b/lldb/scripts/Python/interface/SBValue.i @@ -65,7 +65,7 @@ public: ~SBValue (); bool - IsValid() const; + IsValid(); SBError GetError(); @@ -86,7 +86,7 @@ public: IsInScope (); lldb::Format - GetFormat () const; + GetFormat (); void SetFormat (lldb::Format format); @@ -185,21 +185,21 @@ public: bool can_create_synthetic); lldb::SBValue - CreateChildAtOffset (const char *name, uint32_t offset, const SBType& type); + CreateChildAtOffset (const char *name, uint32_t offset, lldb::SBType type); lldb::SBValue - SBValue::Cast(const SBType& type); + SBValue::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); lldb::SBValue CreateValueFromData (const char* name, - const SBData& data, - const SBType& type); + lldb::SBData data, + lldb::SBType type); lldb::SBType GetType(); |