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
111public:
113
116
118
119 explicit operator bool() const;
120
121 bool IsValid() const;
122
123 const char *GetName();
124
125 const char *GetMangledName();
126
127 lldb::SBType GetType();
128
129 lldb::SBValue GetConstantValue(lldb::SBTarget target);
130
131protected:
132 friend class SBType;
133
135
136 std::unique_ptr<lldb_private::CompilerDecl> m_opaque_up;
137};
138
139class SBType {
140public:
141 SBType();
142
143 SBType(const lldb::SBType &rhs);
144
146
147 explicit operator bool() const;
148
149 bool IsValid() const;
150
151 uint64_t GetByteSize();
152
153 uint64_t GetByteAlign();
154
155 bool IsPointerType();
156
157 bool IsReferenceType();
158
159 bool IsFunctionType();
160
161 bool IsPolymorphicClass();
162
163 bool IsArrayType();
164
165 bool IsVectorType();
166
167 bool IsTypedefType();
168
169 bool IsAnonymousType();
170
172
173 bool IsAggregateType();
174
176
178
180
182
184
186
188
189 lldb::SBType GetArrayType(uint64_t size);
190
192
194
196
197 // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic
198 // type eBasicTypeInvalid will be returned
200
201 // The call below confusing and should really be renamed to "CreateBasicType"
203
204 uint32_t GetNumberOfFields();
205
207
209
211
213
215
217
219
221
223
224 /// Return the TemplateArgumentKind of the template argument at index idx.
225 /// Variadic argument packs are automatically expanded.
227
229
231
233
235
237
238 const char *GetName();
239
240 const char *GetDisplayTypeName();
241
242 lldb::TypeClass GetTypeClass();
243
244 bool IsTypeComplete();
245
246 uint32_t GetTypeFlags();
247
248 bool GetDescription(lldb::SBStream &description,
249 lldb::DescriptionLevel description_level);
250
251 lldb::SBType FindDirectNestedType(const char *name);
252
254
255 bool operator==(lldb::SBType &rhs);
256
257 bool operator!=(lldb::SBType &rhs);
258
259protected:
261
262 const lldb_private::TypeImpl &ref() const;
263
265
266 void SetSP(const lldb::TypeImplSP &type_impl_sp);
267
269
270 friend class SBFunction;
271 friend class SBModule;
272 friend class SBTarget;
273 friend class SBTypeEnumMember;
276 friend class SBTypeMember;
278 friend class SBTypeStaticField;
279 friend class SBTypeList;
280 friend class SBValue;
281 friend class SBWatchpoint;
282
284
286 SBType(const lldb::TypeSP &);
287 SBType(const lldb::TypeImplSP &);
288};
289
291public:
292 SBTypeList();
293
294 SBTypeList(const lldb::SBTypeList &rhs);
295
297
299
300 explicit operator bool() const;
301
302 bool IsValid();
303
304 void Append(lldb::SBType type);
305
306 lldb::SBType GetTypeAtIndex(uint32_t index);
307
308 uint32_t GetSize();
309
310private:
311 std::unique_ptr<lldb_private::TypeListImpl> m_opaque_up;
312 friend class SBModule;
313 friend class SBCompileUnit;
314};
315
316} // namespace lldb
317
318#endif // LLDB_API_SBTYPE_H
#define LLDB_API
Definition: SBDefines.h:28
static llvm::StringRef GetName(XcodeSDK::Type type)
Definition: XcodeSDK.cpp:21
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
Definition: SBType.h:311
lldb::SBType GetTypeAtIndex(uint32_t index)
Definition: SBType.cpp:740
uint32_t GetSize()
Definition: SBType.cpp:748
lldb::SBTypeList & operator=(const lldb::SBTypeList &rhs)
Definition: SBType.cpp:721
bool IsValid()
Definition: SBType.cpp:711
void Append(lldb::SBType type)
Definition: SBType.cpp:733
lldb::SBType GetArgumentTypeAtIndex(uint32_t)
Definition: SBType.cpp:968
const char * GetMangledName()
Definition: SBType.cpp:932
void reset(lldb_private::TypeMemberFunctionImpl *)
Definition: SBType.cpp:999
lldb::MemberFunctionKind GetKind()
Definition: SBType.cpp:979
lldb::SBType GetReturnType()
Definition: SBType.cpp:950
const char * GetName()
Definition: SBType.cpp:910
lldb::SBTypeMemberFunction & operator=(const lldb::SBTypeMemberFunction &rhs)
Definition: SBType.cpp:892
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:987
lldb::TypeMemberFunctionImplSP m_opaque_sp
Definition: SBType.h:107
uint32_t GetNumberOfArguments()
Definition: SBType.cpp:960
lldb::SBType GetType()
Definition: SBType.cpp:940
const char * GetDemangledName()
Definition: SBType.cpp:918
lldb_private::TypeMemberFunctionImpl & ref()
Definition: SBType.cpp:1003
std::unique_ptr< lldb_private::TypeMemberImpl > m_opaque_up
Definition: SBType.h:62
std::unique_ptr< lldb_private::CompilerDecl > m_opaque_up
Definition: SBType.h:136
bool IsArrayType()
Definition: SBType.cpp:156
uint32_t GetNumberOfTemplateArguments()
Definition: SBType.cpp:646
uint32_t GetNumberOfDirectBaseClasses()
Definition: SBType.cpp:462
lldb::SBType FindDirectNestedType(const char *name)
Definition: SBType.cpp:690
lldb::SBType GetReferenceType()
Definition: SBType.cpp:198
lldb::SBType GetArrayType(uint64_t size)
Definition: SBType.cpp:231
lldb::SBType GetVectorElementType()
Definition: SBType.cpp:240
uint32_t GetNumberOfFields()
Definition: SBType.cpp:478
lldb::SBType GetDereferencedType()
Definition: SBType.cpp:214
lldb::SBModule GetModule()
Definition: SBType.cpp:611
lldb::BasicType GetBasicType()
Definition: SBType.cpp:445
bool IsPolymorphicClass()
Definition: SBType.cpp:261
uint32_t GetTypeFlags()
Definition: SBType.cpp:603
lldb::TypeImplSP GetSP()
Definition: SBType.cpp:82
friend class lldb_private::python::SWIGBridge
Definition: SBType.h:283
bool IsAggregateType()
Definition: SBType.cpp:293
bool IsReferenceType()
Definition: SBType.cpp:173
lldb::SBTypeMember GetDirectBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:500
bool IsVectorType()
Definition: SBType.cpp:165
lldb::TemplateArgumentKind GetTemplateArgumentKind(uint32_t idx)
Return the TemplateArgumentKind of the template argument at index idx.
Definition: SBType.cpp:681
lldb::SBTypeMemberFunction GetMemberFunctionAtIndex(uint32_t idx)
Definition: SBType.cpp:336
lldb::SBType GetPointerType()
Definition: SBType.cpp:181
uint32_t GetNumberOfMemberFunctions()
Definition: SBType.cpp:327
lldb::SBType GetTemplateArgumentType(uint32_t idx)
Definition: SBType.cpp:655
lldb::TypeClass GetTypeClass()
Definition: SBType.cpp:638
lldb::SBType GetCanonicalType()
Definition: SBType.cpp:427
bool operator!=(lldb::SBType &rhs)
Definition: SBType.cpp:70
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBType.cpp:486
lldb::SBTypeList GetFunctionArgumentTypes()
Definition: SBType.cpp:313
uint32_t GetNumberOfVirtualBaseClasses()
Definition: SBType.cpp:470
lldb::SBType GetTypedefedType()
Definition: SBType.cpp:206
lldb_private::TypeImpl & ref()
Definition: SBType.cpp:99
lldb::SBTypeStaticField GetStaticFieldWithName(const char *name)
Definition: SBType.cpp:532
lldb::SBType & operator=(const lldb::SBType &rhs)
Definition: SBType.cpp:88
lldb::SBType GetFunctionReturnType()
Definition: SBType.cpp:301
lldb::TypeImplSP m_opaque_sp
Definition: SBType.h:268
lldb::SBType GetUnqualifiedType()
Definition: SBType.cpp:419
lldb::SBTypeMember GetVirtualBaseClassAtIndex(uint32_t idx)
Definition: SBType.cpp:516
bool IsTypeComplete()
Definition: SBType.cpp:590
const char * GetDisplayTypeName()
Definition: SBType.cpp:630
lldb::SBType GetArrayElementType()
Definition: SBType.cpp:222
bool IsTypedefType()
Definition: SBType.cpp:269
bool IsAnonymousType()
Definition: SBType.cpp:277
bool IsPointerType()
Definition: SBType.cpp:148
const char * GetName()
Definition: SBType.cpp:622
lldb::SBType GetPointeeType()
Definition: SBType.cpp:190
lldb::SBTypeMember GetFieldAtIndex(uint32_t idx)
Definition: SBType.cpp:564
void SetSP(const lldb::TypeImplSP &type_impl_sp)
Definition: SBType.cpp:84
uint64_t GetByteSize()
Definition: SBType.cpp:126
bool IsValid() const
Definition: SBType.cpp:113
uint64_t GetByteAlign()
Definition: SBType.cpp:136
bool operator==(lldb::SBType &rhs)
Definition: SBType.cpp:58
lldb::SBType GetEnumerationIntegerType()
Definition: SBType.cpp:435
lldb::SBTypeEnumMemberList GetEnumMembers()
Definition: SBType.cpp:542
bool IsFunctionType()
Definition: SBType.cpp:253
bool IsScopedEnumerationType()
Definition: SBType.cpp:285
Represents a generic declaration such as a function declaration.
Definition: CompilerDecl.h:28
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: 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:457
std::shared_ptr< lldb_private::Type > TypeSP
Definition: lldb-forward.h:452
MemberFunctionKind
Kind of member function.
class LLDB_API SBTypeList
Definition: SBDefines.h:129
std::shared_ptr< lldb_private::TypeImpl > TypeImplSP
Definition: lldb-forward.h:455