LLDB mainline
SBType.h
Go to the documentation of this file.
1//===-- SBType.h ------------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_API_SBTYPE_H
10#define LLDB_API_SBTYPE_H
11
12#include "lldb/API/SBDefines.h"
13
14namespace lldb_private {
15namespace python {
16class SWIGBridge;
17}
18} // namespace lldb_private
19
20namespace lldb {
21
22class SBTypeList;
23
25public:
27
29
31
32 lldb::SBTypeMember &operator=(const lldb::SBTypeMember &rhs);
33
34 explicit operator bool() const;
35
36 bool IsValid() const;
37
38 const char *GetName();
39
40 lldb::SBType GetType();
41
42 uint64_t GetOffsetInBytes();
43
44 uint64_t GetOffsetInBits();
45
46 bool IsBitfield();
47
48 uint32_t GetBitfieldSizeInBits();
49
50 bool GetDescription(lldb::SBStream &description,
51 lldb::DescriptionLevel description_level);
52
53protected:
54 friend class SBType;
55
56 void reset(lldb_private::TypeMemberImpl *);
57
59
60 const lldb_private::TypeMemberImpl &ref() const;
61
62 std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_up;
63};
64
66public:
68
70
72
74
75 explicit operator bool() const;
76
77 bool IsValid() const;
78
79 const char *GetName();
80
81 const char *GetDemangledName();
82
83 const char *GetMangledName();
84
86
88
89 uint32_t GetNumberOfArguments();
90
92
94
95 bool GetDescription(lldb::SBStream &description,
96 lldb::DescriptionLevel description_level);
97
98protected:
99 friend class SBType;
100
102
104
106
108};
109
110class SBType {
111public:
112 SBType();
113
114 SBType(const lldb::SBType &rhs);
115
117
118 explicit operator bool() const;
119
120 bool IsValid() const;
121
122 uint64_t GetByteSize();
123
124 bool IsPointerType();
125
126 bool IsReferenceType();
127
128 bool IsFunctionType();
129
130 bool IsPolymorphicClass();
131
132 bool IsArrayType();
133
134 bool IsVectorType();
135
136 bool IsTypedefType();
137
138 bool IsAnonymousType();
139
141
142 bool IsAggregateType();
143
145
147
149
151
153
155
157
158 lldb::SBType GetArrayType(uint64_t size);
159
161
163
165
166 // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic
167 // type eBasicTypeInvalid will be returned
169
170 // The call below confusing and should really be renamed to "CreateBasicType"
172
173 uint32_t GetNumberOfFields();
174
176
178
180
182
184
186
188
190
191 /// Return the TemplateArgumentKind of the template argument at index idx.
192 /// Variadic argument packs are automatically expanded.
194
196
198
200
202
204
205 const char *GetName();
206
207 const char *GetDisplayTypeName();
208
209 lldb::TypeClass GetTypeClass();
210
211 bool IsTypeComplete();
212
213 uint32_t GetTypeFlags();
214
215 bool GetDescription(lldb::SBStream &description,
216 lldb::DescriptionLevel description_level);
217
218 lldb::SBType FindDirectNestedType(const char *name);
219
221
222 bool operator==(lldb::SBType &rhs);
223
224 bool operator!=(lldb::SBType &rhs);
225
226protected:
228
229 const lldb_private::TypeImpl &ref() const;
230
232
233 void SetSP(const lldb::TypeImplSP &type_impl_sp);
234
236
237 friend class SBFunction;
238 friend class SBModule;
239 friend class SBTarget;
240 friend class SBTypeEnumMember;
243 friend class SBTypeMember;
245 friend class SBTypeList;
246 friend class SBValue;
247 friend class SBWatchpoint;
248
250
252 SBType(const lldb::TypeSP &);
253 SBType(const lldb::TypeImplSP &);
254};
255
257public:
258 SBTypeList();
259
260 SBTypeList(const lldb::SBTypeList &rhs);
261
263
265
266 explicit operator bool() const;
267
268 bool IsValid();
269
270 void Append(lldb::SBType type);
271
272 lldb::SBType GetTypeAtIndex(uint32_t index);
273
274 uint32_t GetSize();
275
276private:
277 std::unique_ptr<lldb_private::TypeListImpl> m_opaque_up;
278 friend class SBModule;
279 friend class SBCompileUnit;
280};
281
282} // namespace lldb
283
284#endif // LLDB_API_SBTYPE_H
static const char * GetName(DWARFDeclContext::Entry entry)
Returns the name of entry if it has one, or the appropriate "anonymous {namespace,...
#define LLDB_API
Definition: SBDefines.h:28
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
Definition: SBType.h:277
lldb::SBType GetTypeAtIndex(uint32_t index)
Definition: SBType.cpp:639
uint32_t GetSize()
Definition: SBType.cpp:647
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
Definition: SBType.cpp:620
bool IsValid()
Definition: SBType.cpp:610
void Append(lldb::SBType type)
Definition: SBType.cpp:632
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
Definition: SBType.cpp:867
const char * GetMangledName()
Definition: SBType.cpp:831
void reset(lldb_private::TypeMemberFunctionImpl *)
Definition: SBType.cpp:898
lldb::MemberFunctionKind GetKind()
Definition: SBType.cpp:878
lldb::SBType GetReturnType()
Definition: SBType.cpp:849
const char * GetName()
Definition: SBType.cpp:809
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
Definition: SBType.cpp:791
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:886
lldb::TypeMemberFunctionImplSP m_opaque_sp
Definition: SBType.h:107
uint32_t GetNumberOfArguments()
Definition: SBType.cpp:859
lldb::SBType GetType()
Definition: SBType.cpp:839
const char * GetDemangledName()
Definition: SBType.cpp:817
lldb_private::TypeMemberFunctionImpl & ref()
Definition: SBType.cpp:902
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
Definition: SBType.h:62
bool IsArrayType()
Definition: SBType.cpp:138
uint32_t GetNumberOfTemplateArguments()
Definition: SBType.cpp:545
uint32_t GetNumberOfDirectBaseClasses()
Definition: SBType.cpp:371
lldb::SBType FindDirectNestedType(const char *name)
Definition: SBType.cpp:589
lldb::SBType GetReferenceType()
Definition: SBType.cpp:180
lldb::SBType GetArrayType(uint64_t size)
Definition: SBType.cpp:213
lldb::SBType GetVectorElementType()
Definition: SBType.cpp:222
uint32_t GetNumberOfFields()
Definition: SBType.cpp:387
lldb::SBType GetDereferencedType()
Definition: SBType.cpp:196
lldb::SBModule GetModule()
Definition: SBType.cpp:510
lldb::BasicType GetBasicType()
Definition: SBType.cpp:354
bool IsPolymorphicClass()
Definition: SBType.cpp:243
uint32_t GetTypeFlags()
Definition: SBType.cpp:502
lldb::TypeImplSP GetSP()
Definition: SBType.cpp:76
friend class lldb_private::python::SWIGBridge
Definition: SBType.h:249
bool IsAggregateType()
Definition: SBType.cpp:275
bool IsReferenceType()
Definition: SBType.cpp:155
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:409
bool IsVectorType()
Definition: SBType.cpp:147
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
Return the TemplateArgumentKind of the template argument at index idx.
Definition: SBType.cpp:580
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
Definition: SBType.cpp:318
lldb::SBType GetPointerType()
Definition: SBType.cpp:163
uint32_t GetNumberOfMemberFunctions()
Definition: SBType.cpp:309
lldb::SBType GetTemplateArgumentType(uint32_t idx)
Definition: SBType.cpp:554
lldb::TypeClass GetTypeClass()
Definition: SBType.cpp:537
lldb::SBType GetCanonicalType()
Definition: SBType.cpp:336
bool operator!=(lldb::SBType &rhs)
Definition: SBType.cpp:64
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:395
lldb::SBTypeList GetFunctionArgumentTypes()
Definition: SBType.cpp:295
uint32_t GetNumberOfVirtualBaseClasses()
Definition: SBType.cpp:379
lldb::SBType GetTypedefedType()
Definition: SBType.cpp:188
lldb_private::TypeImpl & ref()
Definition: SBType.cpp:93
lldb::SBType & operator=(const lldb::SBType &rhs)
Definition: SBType.cpp:82
lldb::SBType GetFunctionReturnType()
Definition: SBType.cpp:283
lldb::TypeImplSP m_opaque_sp
Definition: SBType.h:235
lldb::SBType GetUnqualifiedType()
Definition: SBType.cpp:328
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:425
bool IsTypeComplete()
Definition: SBType.cpp:489
const char * GetDisplayTypeName()
Definition: SBType.cpp:529
lldb::SBType GetArrayElementType()
Definition: SBType.cpp:204
bool IsTypedefType()
Definition: SBType.cpp:251
bool IsAnonymousType()
Definition: SBType.cpp:259
bool IsPointerType()
Definition: SBType.cpp:130
const char * GetName()
Definition: SBType.cpp:521
lldb::SBType GetPointeeType()
Definition: SBType.cpp:172
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
Definition: SBType.cpp:463
void SetSP(const lldb::TypeImplSP &type_impl_sp)
Definition: SBType.cpp:78
uint64_t GetByteSize()
Definition: SBType.cpp:120
bool IsValid() const
Definition: SBType.cpp:107
bool operator==(lldb::SBType &rhs)
Definition: SBType.cpp:52
lldb::SBType GetEnumerationIntegerType()
Definition: SBType.cpp:344
lldb::SBTypeEnumMemberList GetEnumMembers()
Definition: SBType.cpp:441
bool IsFunctionType()
Definition: SBType.cpp:235
bool IsScopedEnumerationType()
Definition: SBType.cpp:267
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
Definition: SBAddress.h:15
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
std::shared_ptr< lldb_private::TypeMemberFunctionImpl > TypeMemberFunctionImplSP
Definition: lldb-forward.h:454
std::shared_ptr< lldb_private::Type > TypeSP
Definition: lldb-forward.h:449
MemberFunctionKind
Kind of member function.
class LLDB_API SBTypeList
Definition: SBDefines.h:127
std::shared_ptr< lldb_private::TypeImpl > TypeImplSP
Definition: lldb-forward.h:452