LLDB API Documentation

SBType.h
Go to the documentation of this file.
1 //===-- SBType.h ------------------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLDB_SBType_h_
11 #define LLDB_SBType_h_
12 
13 #include "lldb/API/SBDefines.h"
14 
15 namespace lldb {
16 
17 class SBTypeList;
18 
19 class LLDB_API SBTypeMember {
20 public:
21  SBTypeMember();
22 
23  SBTypeMember(const lldb::SBTypeMember &rhs);
24 
25  ~SBTypeMember();
26 
27  lldb::SBTypeMember &operator=(const lldb::SBTypeMember &rhs);
28 
29  bool IsValid() const;
30 
31  const char *GetName();
32 
33  lldb::SBType GetType();
34 
35  uint64_t GetOffsetInBytes();
36 
37  uint64_t GetOffsetInBits();
38 
39  bool IsBitfield();
40 
41  uint32_t GetBitfieldSizeInBits();
42 
43  bool GetDescription(lldb::SBStream &description,
44  lldb::DescriptionLevel description_level);
45 
46 protected:
47  friend class SBType;
48 
49  void reset(lldb_private::TypeMemberImpl *);
50 
51  lldb_private::TypeMemberImpl &ref();
52 
53  const lldb_private::TypeMemberImpl &ref() const;
54 
55  std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_ap;
56 };
57 
59 public:
61 
63 
65 
67 
68  bool IsValid() const;
69 
70  const char *GetName();
71 
72  const char *GetDemangledName();
73 
74  const char *GetMangledName();
75 
77 
79 
80  uint32_t GetNumberOfArguments();
81 
83 
84  lldb::MemberFunctionKind GetKind();
85 
86  bool GetDescription(lldb::SBStream &description,
87  lldb::DescriptionLevel description_level);
88 
89 protected:
90  friend class SBType;
91 
92  void reset(lldb_private::TypeMemberFunctionImpl *);
93 
94  lldb_private::TypeMemberFunctionImpl &ref();
95 
96  const lldb_private::TypeMemberFunctionImpl &ref() const;
97 
98  lldb::TypeMemberFunctionImplSP m_opaque_sp;
99 };
100 
101 class SBType {
102 public:
103  SBType();
104 
105  SBType(const lldb::SBType &rhs);
106 
107  ~SBType();
108 
109  bool IsValid() const;
110 
111  uint64_t GetByteSize();
112 
113  bool IsPointerType();
114 
115  bool IsReferenceType();
116 
117  bool IsFunctionType();
118 
119  bool IsPolymorphicClass();
120 
121  bool IsArrayType();
122 
123  bool IsVectorType();
124 
125  bool IsTypedefType();
126 
127  bool IsAnonymousType();
128 
130 
132 
134 
136 
138 
140 
142 
143  lldb::SBType GetArrayType(uint64_t size);
144 
146 
148  // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic
149  // type eBasicTypeInvalid will be returned
150  lldb::BasicType GetBasicType();
151 
152  // The call below confusing and should really be renamed to "CreateBasicType"
153  lldb::SBType GetBasicType(lldb::BasicType type);
154 
155  uint32_t GetNumberOfFields();
156 
157  uint32_t GetNumberOfDirectBaseClasses();
158 
160 
161  lldb::SBTypeMember GetFieldAtIndex(uint32_t idx);
162 
164 
166 
168 
169  uint32_t GetNumberOfTemplateArguments();
170 
172 
173  lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx);
174 
176 
178 
179  uint32_t GetNumberOfMemberFunctions();
180 
182 
183  const char *GetName();
184 
185  const char *GetDisplayTypeName();
186 
187  lldb::TypeClass GetTypeClass();
188 
189  bool IsTypeComplete();
190 
191  uint32_t GetTypeFlags();
192 
193  bool GetDescription(lldb::SBStream &description,
194  lldb::DescriptionLevel description_level);
195 
196  lldb::SBType &operator=(const lldb::SBType &rhs);
197 
198  bool operator==(lldb::SBType &rhs);
199 
200  bool operator!=(lldb::SBType &rhs);
201 
202 protected:
203  lldb_private::TypeImpl &ref();
204 
205  const lldb_private::TypeImpl &ref() const;
206 
207  lldb::TypeImplSP GetSP();
208 
209  void SetSP(const lldb::TypeImplSP &type_impl_sp);
210 
211  lldb::TypeImplSP m_opaque_sp;
212 
213  friend class SBFunction;
214  friend class SBModule;
215  friend class SBTarget;
216  friend class SBTypeEnumMember;
217  friend class SBTypeEnumMemberList;
218  friend class SBTypeNameSpecifier;
219  friend class SBTypeMember;
220  friend class SBTypeMemberFunction;
221  friend class SBTypeList;
222  friend class SBValue;
223 
224  SBType(const lldb_private::CompilerType &);
225  SBType(const lldb::TypeSP &);
226  SBType(const lldb::TypeImplSP &);
227 };
228 
229 class SBTypeList {
230 public:
231  SBTypeList();
232 
233  SBTypeList(const lldb::SBTypeList &rhs);
234 
235  ~SBTypeList();
236 
238 
239  bool IsValid();
240 
241  void Append(lldb::SBType type);
242 
243  lldb::SBType GetTypeAtIndex(uint32_t index);
244 
245  uint32_t GetSize();
246 
247 private:
248  std::unique_ptr<lldb_private::TypeListImpl> m_opaque_ap;
249  friend class SBModule;
250  friend class SBCompileUnit;
251 };
252 
253 } // namespace lldb
254 
255 #endif // LLDB_SBType_h_
lldb::SBType GetArrayType(uint64_t size)
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
bool IsVectorType()
uint32_t GetNumberOfFields()
lldb::SBType GetFunctionReturnType()
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
class LLDB_API SBTypeList
Definition: SBDefines.h:93
bool IsTypeComplete()
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
lldb::SBType GetReturnType()
uint64_t GetByteSize()
lldb_private::TypeImpl & ref()
bool IsTypedefType()
lldb::TypeMemberFunctionImplSP m_opaque_sp
Definition: SBType.h:98
const char * GetMangledName()
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
uint32_t GetNumberOfTemplateArguments()
lldb::SBType GetCanonicalType()
uint32_t GetNumberOfMemberFunctions()
lldb_private::TypeMemberFunctionImpl & ref()
uint32_t GetTypeFlags()
lldb::MemberFunctionKind GetKind()
lldb::SBType GetDereferencedType()
lldb::SBType GetTemplateArgumentType(uint32_t idx)
void Append(lldb::SBType type)
uint32_t GetNumberOfDirectBaseClasses()
bool operator!=(lldb::SBType &rhs)
bool IsArrayType()
bool IsFunctionType()
lldb::BasicType GetBasicType()
lldb::SBType GetArrayElementType()
bool IsValid() const
lldb::SBType GetUnqualifiedType()
uint32_t GetNumberOfVirtualBaseClasses()
lldb::SBType GetPointerType()
bool IsAnonymousType()
lldb::SBTypeList GetFunctionArgumentTypes()
bool IsPolymorphicClass()
bool IsPointerType()
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
lldb::SBType GetTypedefedType()
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
lldb::TypeClass GetTypeClass()
lldb::SBType & operator=(const lldb::SBType &rhs)
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
const char * GetDemangledName()
bool IsReferenceType()
lldb::SBType GetPointeeType()
lldb::SBTypeEnumMemberList GetEnumMembers()
void SetSP(const lldb::TypeImplSP &type_impl_sp)
lldb::SBType GetTypeAtIndex(uint32_t index)
const char * GetName()
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_ap
Definition: SBType.h:55
bool operator==(lldb::SBType &rhs)
void reset(lldb_private::TypeMemberFunctionImpl *)
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
const char * GetDisplayTypeName()
uint32_t GetSize()
lldb::SBType GetVectorElementType()
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
lldb::TypeImplSP m_opaque_sp
Definition: SBType.h:211
lldb::TypeImplSP GetSP()
lldb::SBType GetReferenceType()