LLDB  mainline
Type.h
Go to the documentation of this file.
1 //===-- Type.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_SYMBOL_TYPE_H
10 #define LLDB_SYMBOL_TYPE_H
11 
12 #include "lldb/Core/Declaration.h"
16 #include "lldb/Utility/UserID.h"
17 #include "lldb/lldb-private.h"
18 
19 #include "llvm/ADT/APSInt.h"
20 
21 #include <set>
22 
23 namespace lldb_private {
24 
25 /// CompilerContext allows an array of these items to be passed to perform
26 /// detailed lookups in SymbolVendor and SymbolFile functions.
29 
30  bool operator==(const CompilerContext &rhs) const {
31  return kind == rhs.kind && name == rhs.name;
32  }
33  bool operator!=(const CompilerContext &rhs) const { return !(*this == rhs); }
34 
35  void Dump() const;
36 
39 };
40 
41 /// Match \p context_chain against \p pattern, which may contain "Any"
42 /// kinds. The \p context_chain should *not* contain any "Any" kinds.
43 bool contextMatches(llvm::ArrayRef<CompilerContext> context_chain,
44  llvm::ArrayRef<CompilerContext> pattern);
45 
46 class SymbolFileType : public std::enable_shared_from_this<SymbolFileType>,
47  public UserID {
48 public:
50  : UserID(uid), m_symbol_file(symbol_file) {}
51 
52  SymbolFileType(SymbolFile &symbol_file, const lldb::TypeSP &type_sp);
53 
54  ~SymbolFileType() = default;
55 
56  Type *operator->() { return GetType(); }
57 
58  Type *GetType();
59  SymbolFile &GetSymbolFile() const { return m_symbol_file; }
60 
61 protected:
63  lldb::TypeSP m_type_sp;
64 };
65 
66 class Type : public std::enable_shared_from_this<Type>, public UserID {
67 public:
70  eEncodingIsUID, ///< This type is the type whose UID is m_encoding_uid
71  eEncodingIsConstUID, ///< This type is the type whose UID is m_encoding_uid
72  /// with the const qualifier added
73  eEncodingIsRestrictUID, ///< This type is the type whose UID is
74  /// m_encoding_uid with the restrict qualifier added
75  eEncodingIsVolatileUID, ///< This type is the type whose UID is
76  /// m_encoding_uid with the volatile qualifier added
77  eEncodingIsTypedefUID, ///< This type is pointer to a type whose UID is
78  /// m_encoding_uid
79  eEncodingIsPointerUID, ///< This type is pointer to a type whose UID is
80  /// m_encoding_uid
81  eEncodingIsLValueReferenceUID, ///< This type is L value reference to a type
82  /// whose UID is m_encoding_uid
83  eEncodingIsRValueReferenceUID, ///< This type is R value reference to a type
84  /// whose UID is m_encoding_uid,
85  eEncodingIsAtomicUID, ///< This type is the type whose UID is
86  /// m_encoding_uid as an atomic type.
88  };
89 
90  enum class ResolveState : unsigned char {
91  Unresolved = 0,
92  Forward = 1,
93  Layout = 2,
94  Full = 3
95  };
96 
97  Type(lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name,
98  llvm::Optional<uint64_t> byte_size, SymbolContextScope *context,
99  lldb::user_id_t encoding_uid, EncodingDataType encoding_uid_type,
100  const Declaration &decl, const CompilerType &compiler_qual_type,
101  ResolveState compiler_type_resolve_state, uint32_t opaque_payload = 0);
102 
103  // This makes an invalid type. Used for functions that return a Type when
104  // they get an error.
105  Type();
106 
107  void Dump(Stream *s, bool show_context,
109 
110  void DumpTypeName(Stream *s);
111 
112  /// Since Type instances only keep a "SymbolFile *" internally, other classes
113  /// like TypeImpl need make sure the module is still around before playing
114  /// with
115  /// Type instances. They can store a weak pointer to the Module;
116  lldb::ModuleSP GetModule();
117 
118  /// GetModule may return module for compile unit's object file.
119  /// GetExeModule returns module for executable object file that contains
120  /// compile unit where type was actualy defined.
121  /// GetModule and GetExeModule may return the same value.
122  lldb::ModuleSP GetExeModule();
123 
124  void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name,
125  ExecutionContextScope *exe_scope);
126 
128  const SymbolFile *GetSymbolFile() const { return m_symbol_file; }
129 
131 
132  llvm::Optional<uint64_t> GetByteSize(ExecutionContextScope *exe_scope);
133 
134  uint32_t GetNumChildren(bool omit_empty_base_classes);
135 
136  bool IsAggregateType();
137 
139 
141 
142  lldb::TypeSP GetTypedefType();
143 
144  ConstString GetName() const { return m_name; }
145 
147 
148  void DumpValue(ExecutionContext *exe_ctx, Stream *s,
149  const DataExtractor &data, uint32_t data_offset,
150  bool show_type, bool show_summary, bool verbose,
152 
153  bool DumpValueInMemory(ExecutionContext *exe_ctx, Stream *s,
154  lldb::addr_t address, AddressType address_type,
155  bool show_types, bool show_summary, bool verbose);
156 
157  bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address,
158  AddressType address_type, DataExtractor &data);
159 
160  bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address,
161  AddressType address_type, DataExtractor &data);
162 
163  bool GetIsDeclaration() const;
164 
165  void SetIsDeclaration(bool b);
166 
167  bool GetIsExternal() const;
168 
169  void SetIsExternal(bool b);
170 
172 
173  lldb::Encoding GetEncoding(uint64_t &count);
174 
178  m_context = context;
179  }
180 
182 
183  // Get the clang type, and resolve definitions for any
184  // class/struct/union/enum types completely.
186 
187  // Get the clang type, and resolve definitions enough so that the type could
188  // have layout performed. This allows ptrs and refs to
189  // class/struct/union/enum types remain forward declarations.
191 
192  // Get the clang type and leave class/struct/union/enum types as forward
193  // declarations if they haven't already been fully defined.
195 
196  static int Compare(const Type &a, const Type &b);
197 
198  // From a fully qualified typename, split the type into the type basename and
199  // the remaining type scope (namespaces/classes).
200  static bool GetTypeScopeAndBasename(const llvm::StringRef& name,
201  llvm::StringRef &scope,
202  llvm::StringRef &basename,
203  lldb::TypeClass &type_class);
204  void SetEncodingType(Type *encoding_type) { m_encoding_type = encoding_type; }
205 
207 
208  typedef uint32_t Payload;
209  /// Return the language-specific payload.
211  /// Return the language-specific payload.
212  void SetPayload(Payload opaque_payload) { m_payload = opaque_payload; }
213 
214 protected:
217  /// The symbol context in which this type is defined.
219  Type *m_encoding_type = nullptr;
222  uint64_t m_byte_size : 63;
223  uint64_t m_byte_size_has_value : 1;
227  /// Language-specific flags.
229 
231 
232  bool ResolveCompilerType(ResolveState compiler_type_resolve_state);
233 };
234 
235 // the two classes here are used by the public API as a backend to the SBType
236 // and SBTypeList classes
237 
238 class TypeImpl {
239 public:
240  TypeImpl() = default;
241 
242  ~TypeImpl() = default;
243 
244  TypeImpl(const lldb::TypeSP &type_sp);
245 
246  TypeImpl(const CompilerType &compiler_type);
247 
248  TypeImpl(const lldb::TypeSP &type_sp, const CompilerType &dynamic);
249 
250  TypeImpl(const CompilerType &compiler_type, const CompilerType &dynamic);
251 
252  void SetType(const lldb::TypeSP &type_sp);
253 
254  void SetType(const CompilerType &compiler_type);
255 
256  void SetType(const lldb::TypeSP &type_sp, const CompilerType &dynamic);
257 
258  void SetType(const CompilerType &compiler_type, const CompilerType &dynamic);
259 
260  bool operator==(const TypeImpl &rhs) const;
261 
262  bool operator!=(const TypeImpl &rhs) const;
263 
264  bool IsValid() const;
265 
266  explicit operator bool() const;
267 
268  void Clear();
269 
270  lldb::ModuleSP GetModule() const;
271 
272  ConstString GetName() const;
273 
275 
276  TypeImpl GetPointerType() const;
277 
278  TypeImpl GetPointeeType() const;
279 
280  TypeImpl GetReferenceType() const;
281 
282  TypeImpl GetTypedefedType() const;
283 
285 
287 
288  TypeImpl GetCanonicalType() const;
289 
290  CompilerType GetCompilerType(bool prefer_dynamic);
291 
292  TypeSystem *GetTypeSystem(bool prefer_dynamic);
293 
295  lldb::DescriptionLevel description_level);
296 
297 private:
298  bool CheckModule(lldb::ModuleSP &module_sp) const;
299  bool CheckExeModule(lldb::ModuleSP &module_sp) const;
300  bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp,
301  lldb::ModuleSP &module_sp) const;
302 
303  lldb::ModuleWP m_module_wp;
304  lldb::ModuleWP m_exe_module_wp;
307 };
308 
310 public:
312 
313  void Append(const lldb::TypeImplSP &type) { m_content.push_back(type); }
314 
316  public:
317  AppendVisitor(TypeListImpl &type_list) : m_type_list(type_list) {}
318 
319  void operator()(const lldb::TypeImplSP &type) { m_type_list.Append(type); }
320 
321  private:
323  };
324 
325  void Append(const lldb_private::TypeList &type_list);
326 
327  lldb::TypeImplSP GetTypeAtIndex(size_t idx) {
328  lldb::TypeImplSP type_sp;
329  if (idx < GetSize())
330  type_sp = m_content[idx];
331  return type_sp;
332  }
333 
334  size_t GetSize() { return m_content.size(); }
335 
336 private:
337  std::vector<lldb::TypeImplSP> m_content;
338 };
339 
341 public:
343  : m_type_impl_sp(), m_name()
344 
345  {}
346 
347  TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset,
348  ConstString name, uint32_t bitfield_bit_size = 0,
349  bool is_bitfield = false)
350  : m_type_impl_sp(type_impl_sp), m_bit_offset(bit_offset), m_name(name),
351  m_bitfield_bit_size(bitfield_bit_size), m_is_bitfield(is_bitfield) {}
352 
353  TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset)
354  : m_type_impl_sp(type_impl_sp), m_bit_offset(bit_offset), m_name(),
356  if (m_type_impl_sp)
357  m_name = m_type_impl_sp->GetName();
358  }
359 
360  const lldb::TypeImplSP &GetTypeImpl() { return m_type_impl_sp; }
361 
362  ConstString GetName() const { return m_name; }
363 
364  uint64_t GetBitOffset() const { return m_bit_offset; }
365 
367 
368  void SetBitfieldBitSize(uint32_t bitfield_bit_size) {
369  m_bitfield_bit_size = bitfield_bit_size;
370  }
371 
372  bool GetIsBitfield() const { return m_is_bitfield; }
373 
374  void SetIsBitfield(bool is_bitfield) { m_is_bitfield = is_bitfield; }
375 
376 protected:
377  lldb::TypeImplSP m_type_impl_sp;
378  uint64_t m_bit_offset = 0;
380  uint32_t m_bitfield_bit_size = 0; // Bit size for bitfield members only
381  bool m_is_bitfield = false;
382 };
383 
384 ///
385 /// Sometimes you can find the name of the type corresponding to an object, but
386 /// we don't have debug
387 /// information for it. If that is the case, you can return one of these
388 /// objects, and then if it
389 /// has a full type, you can use that, but if not at least you can print the
390 /// name for informational
391 /// purposes.
392 ///
393 
395 public:
396  TypeAndOrName() = default;
397  TypeAndOrName(lldb::TypeSP &type_sp);
398  TypeAndOrName(const CompilerType &compiler_type);
399  TypeAndOrName(const char *type_str);
400  TypeAndOrName(ConstString &type_const_string);
401 
402  bool operator==(const TypeAndOrName &other) const;
403 
404  bool operator!=(const TypeAndOrName &other) const;
405 
406  ConstString GetName() const;
407 
409 
410  void SetName(ConstString type_name);
411 
412  void SetName(const char *type_name_cstr);
413 
414  void SetTypeSP(lldb::TypeSP type_sp);
415 
416  void SetCompilerType(CompilerType compiler_type);
417 
418  bool IsEmpty() const;
419 
420  bool HasName() const;
421 
422  bool HasCompilerType() const;
423 
424  bool HasType() const { return HasCompilerType(); }
425 
426  void Clear();
427 
428  explicit operator bool() { return !IsEmpty(); }
429 
430 private:
433 };
434 
436 public:
438 
440  const std::string &name,
441  const lldb::MemberFunctionKind &kind)
442  : m_type(type), m_decl(decl), m_name(name), m_kind(kind) {}
443 
444  bool IsValid();
445 
446  ConstString GetName() const;
447 
448  ConstString GetMangledName() const;
449 
450  CompilerType GetType() const;
451 
452  CompilerType GetReturnType() const;
453 
454  size_t GetNumArguments() const;
455 
456  CompilerType GetArgumentAtIndex(size_t idx) const;
457 
459 
460  bool GetDescription(Stream &stream);
461 
462 protected:
464 
465 private:
470 };
471 
473 public:
475 
476  TypeEnumMemberImpl(const lldb::TypeImplSP &integer_type_sp,
477  ConstString name, const llvm::APSInt &value);
478 
479  TypeEnumMemberImpl(const TypeEnumMemberImpl &rhs) = default;
480 
482 
483  bool IsValid() { return m_valid; }
484 
485  ConstString GetName() const { return m_name; }
486 
487  const lldb::TypeImplSP &GetIntegerType() const { return m_integer_type_sp; }
488 
489  uint64_t GetValueAsUnsigned() const { return m_value.getZExtValue(); }
490 
491  int64_t GetValueAsSigned() const { return m_value.getSExtValue(); }
492 
493 protected:
494  lldb::TypeImplSP m_integer_type_sp;
496  llvm::APSInt m_value;
497  bool m_valid = false;
498 };
499 
501 public:
503 
504  void Append(const lldb::TypeEnumMemberImplSP &type) {
505  m_content.push_back(type);
506  }
507 
508  void Append(const lldb_private::TypeEnumMemberListImpl &type_list);
509 
510  lldb::TypeEnumMemberImplSP GetTypeEnumMemberAtIndex(size_t idx) {
511  lldb::TypeEnumMemberImplSP enum_member;
512  if (idx < GetSize())
513  enum_member = m_content[idx];
514  return enum_member;
515  }
516 
517  size_t GetSize() { return m_content.size(); }
518 
519 private:
520  std::vector<lldb::TypeEnumMemberImplSP> m_content;
521 };
522 
523 } // namespace lldb_private
524 
525 #endif // LLDB_SYMBOL_TYPE_H
lldb_private::TypeMemberFunctionImpl::m_kind
lldb::MemberFunctionKind m_kind
Definition: Type.h:469
lldb_private::Type::GetSymbolContextScope
const SymbolContextScope * GetSymbolContextScope() const
Definition: Type.h:176
lldb_private::TypeMemberFunctionImpl::m_type
CompilerType m_type
Definition: Type.h:466
lldb_private::SymbolFile
Definition: SymbolFile.h:38
lldb_private::TypeAndOrName::IsEmpty
bool IsEmpty() const
Definition: Type.cpp:792
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::TypeMemberImpl
Definition: Type.h:340
lldb_private::Type::EncodingDataType
EncodingDataType
Definition: Type.h:68
lldb_private::TypeEnumMemberImpl::m_value
llvm::APSInt m_value
Definition: Type.h:496
lldb_private::TypeImpl::CheckModuleCommon
bool CheckModuleCommon(const lldb::ModuleWP &input_module_wp, lldb::ModuleSP &module_sp) const
Definition: Type.cpp:865
lldb_private::TypeImpl::GetCanonicalType
TypeImpl GetCanonicalType() const
Definition: Type.cpp:1018
lldb_private::TypeEnumMemberImpl::m_valid
bool m_valid
Definition: Type.h:497
lldb_private::TypeAndOrName::GetCompilerType
CompilerType GetCompilerType() const
Definition: Type.h:408
lldb_private::TypeEnumMemberImpl
Definition: Type.h:472
lldb_private::Type::DumpValue
void DumpValue(ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, uint32_t data_offset, bool show_type, bool show_summary, bool verbose, lldb::Format format=lldb::eFormatDefault)
Definition: Type.cpp:309
lldb_private::Type::eEncodingIsSyntheticUID
@ eEncodingIsSyntheticUID
Definition: Type.h:87
lldb_private::TypeImpl::operator==
bool operator==(const TypeImpl &rhs) const
Definition: Type.cpp:894
CompilerDecl.h
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
lldb_private::TypeMemberImpl::m_bit_offset
uint64_t m_bit_offset
Definition: Type.h:378
lldb_private::Type::eEncodingIsConstUID
@ eEncodingIsConstUID
This type is the type whose UID is m_encoding_uid with the const qualifier added.
Definition: Type.h:71
lldb_private::TypeAndOrName::SetName
void SetName(ConstString type_name)
Definition: Type.cpp:770
lldb_private::TypeMemberImpl::GetBitfieldBitSize
uint32_t GetBitfieldBitSize() const
Definition: Type.h:366
lldb_private::Type::GetFormat
lldb::Format GetFormat()
Definition: Type.cpp:401
lldb_private::Type::eEncodingIsTypedefUID
@ eEncodingIsTypedefUID
This type is pointer to a type whose UID is m_encoding_uid.
Definition: Type.h:77
lldb_private::TypeMemberImpl::TypeMemberImpl
TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset)
Definition: Type.h:353
lldb_private::TypeEnumMemberImpl::GetIntegerType
const lldb::TypeImplSP & GetIntegerType() const
Definition: Type.h:487
lldb_private::TypeAndOrName::HasName
bool HasName() const
Definition: Type.cpp:801
lldb_private::contextMatches
bool contextMatches(llvm::ArrayRef< CompilerContext > context_chain, llvm::ArrayRef< CompilerContext > pattern)
Match context_chain against pattern, which may contain "Any" kinds.
Definition: Type.cpp:36
lldb_private::TypeAndOrName::SetCompilerType
void SetCompilerType(CompilerType compiler_type)
Definition: Type.cpp:786
lldb_private::TypeImpl::CheckModule
bool CheckModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:857
lldb_private::UserID
Definition: UserID.h:31
lldb_private::Type::GetEncodingType
Type * GetEncodingType()
Definition: Type.cpp:333
lldb_private::AddressType
AddressType
Definition: lldb-private-enumerations.h:30
lldb_private::TypeEnumMemberListImpl::TypeEnumMemberListImpl
TypeEnumMemberListImpl()
Definition: Type.h:502
lldb_private::Type::GetLayoutCompilerType
CompilerType GetLayoutCompilerType()
Definition: Type.cpp:651
lldb_private::TypeMemberFunctionImpl::m_decl
CompilerDecl m_decl
Definition: Type.h:467
lldb_private::Type::m_compiler_type_resolve_state
ResolveState m_compiler_type_resolve_state
Definition: Type.h:226
lldb_private::TypeMemberImpl::GetTypeImpl
const lldb::TypeImplSP & GetTypeImpl()
Definition: Type.h:360
lldb_private::TypeImpl::GetModule
lldb::ModuleSP GetModule() const
Definition: Type.cpp:919
LLDB_INVALID_UID
#define LLDB_INVALID_UID
Definition: lldb-defines.h:92
lldb_private::TypeEnumMemberListImpl::GetTypeEnumMemberAtIndex
lldb::TypeEnumMemberImplSP GetTypeEnumMemberAtIndex(size_t idx)
Definition: Type.h:510
lldb_private::CompilerContext::name
ConstString name
Definition: Type.h:38
lldb_private::Type::SetIsDeclaration
void SetIsDeclaration(bool b)
lldb::eMemberFunctionKindUnknown
@ eMemberFunctionKindUnknown
Not sure what the type of this is.
Definition: lldb-enumerations.h:1021
lldb_private::Type::m_payload
Payload m_payload
Language-specific flags.
Definition: Type.h:228
lldb_private::Type::GetModule
lldb::ModuleSP GetModule()
Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sur...
Definition: Type.cpp:722
lldb_private::Type::SetPayload
void SetPayload(Payload opaque_payload)
Return the language-specific payload.
Definition: Type.h:212
lldb_private::Type::m_byte_size_has_value
uint64_t m_byte_size_has_value
Definition: Type.h:223
lldb_private::TypeMemberFunctionImpl::GetMangledName
ConstString GetMangledName() const
Definition: Type.cpp:1076
lldb_private::CompilerDecl
Represents a generic declaration such as a function declaration.
Definition: CompilerDecl.h:28
lldb_private::TypeImpl::GetDisplayTypeName
ConstString GetDisplayTypeName() const
Definition: Type.cpp:936
lldb_private::Type::GetName
ConstString GetName() const
Definition: Type.h:144
lldb_private::TypeMemberFunctionImpl::m_name
ConstString m_name
Definition: Type.h:468
lldb_private::Type::m_encoding_uid_type
EncodingDataType m_encoding_uid_type
Definition: Type.h:221
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Type::GetName
ConstString GetName()
Definition: Type.cpp:301
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::TypeAndOrName::Clear
void Clear()
Definition: Type.cpp:796
lldb_private::TypeListImpl::GetSize
size_t GetSize()
Definition: Type.h:334
lldb_private::Type::GetIsDeclaration
bool GetIsDeclaration() const
lldb_private::Type::Dump
void Dump(Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
Definition: Type.cpp:235
lldb_private::TypeEnumMemberImpl::GetValueAsUnsigned
uint64_t GetValueAsUnsigned() const
Definition: Type.h:489
lldb_private::TypeMemberFunctionImpl::TypeMemberFunctionImpl
TypeMemberFunctionImpl()
Definition: Type.h:437
lldb_private::Type::GetEncoding
lldb::Encoding GetEncoding(uint64_t &count)
Definition: Type.cpp:403
lldb_private::Type::eEncodingIsRValueReferenceUID
@ eEncodingIsRValueReferenceUID
This type is R value reference to a type whose UID is m_encoding_uid,.
Definition: Type.h:83
lldb_private::TypeEnumMemberImpl::IsValid
bool IsValid()
Definition: Type.h:483
lldb_private::TypeListImpl::Append
void Append(const lldb::TypeImplSP &type)
Definition: Type.h:313
lldb_private::SymbolFileType
Definition: Type.h:46
lldb_private::TypeImpl::TypeImpl
TypeImpl()=default
lldb_private::Type::ResolveCompilerType
bool ResolveCompilerType(ResolveState compiler_type_resolve_state)
Definition: Type.cpp:471
lldb_private::TypeImpl::IsValid
bool IsValid() const
Definition: Type.cpp:903
lldb_private::TypeImpl::m_dynamic_type
CompilerType m_dynamic_type
Definition: Type.h:306
lldb_private::Type::Type
Type()
Definition: Type.cpp:163
lldb_private::TypeMemberFunctionImpl::GetName
ConstString GetName() const
Definition: Type.cpp:1074
lldb_private::Type::GetByteSize
llvm::Optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope)
Definition: Type.cpp:339
lldb_private::Type::ResolveState
ResolveState
Definition: Type.h:90
lldb_private::Type::eEncodingInvalid
@ eEncodingInvalid
Definition: Type.h:69
lldb_private::TypeMemberFunctionImpl::GetKind
lldb::MemberFunctionKind GetKind() const
Definition: Type.cpp:1082
lldb_private::CompilerContext
CompilerContext allows an array of these items to be passed to perform detailed lookups in SymbolVend...
Definition: Type.h:27
lldb_private::Type::m_symbol_file
SymbolFile * m_symbol_file
Definition: Type.h:216
lldb_private::SymbolFileType::GetType
Type * GetType()
Definition: Type.cpp:133
lldb_private::TypeMemberImpl::TypeMemberImpl
TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset, ConstString name, uint32_t bitfield_bit_size=0, bool is_bitfield=false)
Definition: Type.h:347
lldb_private::TypeAndOrName::GetName
ConstString GetName() const
Definition: Type.cpp:762
lldb_private::TypeMemberImpl::m_type_impl_sp
lldb::TypeImplSP m_type_impl_sp
Definition: Type.h:377
lldb_private::Type::eEncodingIsRestrictUID
@ eEncodingIsRestrictUID
This type is the type whose UID is m_encoding_uid with the restrict qualifier added.
Definition: Type.h:73
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::Type::ResolveState::Unresolved
@ Unresolved
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::TypeMemberFunctionImpl::GetType
CompilerType GetType() const
Definition: Type.cpp:1080
lldb_private::CompilerContext::Dump
void Dump() const
Definition: Type.cpp:65
lldb_private::TypeMemberImpl::SetBitfieldBitSize
void SetBitfieldBitSize(uint32_t bitfield_bit_size)
Definition: Type.h:368
lldb_private::SymbolFileType::m_type_sp
lldb::TypeSP m_type_sp
Definition: Type.h:63
lldb_private::TypeAndOrName::HasCompilerType
bool HasCompilerType() const
Definition: Type.cpp:803
lldb_private::Type::eEncodingIsVolatileUID
@ eEncodingIsVolatileUID
This type is the type whose UID is m_encoding_uid with the volatile qualifier added.
Definition: Type.h:75
lldb_private::CompilerContext::operator==
bool operator==(const CompilerContext &rhs) const
Definition: Type.h:30
lldb_private::Type::GetTypedefType
lldb::TypeSP GetTypedefType()
Definition: Type.cpp:391
Declaration.h
lldb_private::TypeMemberFunctionImpl::GetPrintableTypeName
std::string GetPrintableTypeName()
lldb_private::Type::IsValidType
bool IsValidType()
Definition: Type.h:138
lldb_private::Type::GetPayload
Payload GetPayload()
Return the language-specific payload.
Definition: Type.h:210
lldb_private::TypeEnumMemberImpl::GetValueAsSigned
int64_t GetValueAsSigned() const
Definition: Type.h:491
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::Type::DumpTypeName
void DumpTypeName(Stream *s)
Definition: Type.cpp:307
lldb_private::SymbolFileType::operator->
Type * operator->()
Definition: Type.h:56
lldb_private::Type::GetExeModule
lldb::ModuleSP GetExeModule()
GetModule may return module for compile unit's object file.
Definition: Type.cpp:728
lldb::eDescriptionLevelFull
@ eDescriptionLevelFull
Definition: lldb-enumerations.h:209
lldb_private::Type::GetDeclaration
const lldb_private::Declaration & GetDeclaration() const
Definition: Type.cpp:469
lldb_private::Type::GetSymbolFile
SymbolFile * GetSymbolFile()
Definition: Type.h:127
lldb_private::CompilerContext::operator!=
bool operator!=(const CompilerContext &rhs) const
Definition: Type.h:33
lldb_private::Type::SetSymbolContextScope
void SetSymbolContextScope(SymbolContextScope *context)
Definition: Type.h:177
lldb_private::Type::GetTypeScopeAndBasename
static bool GetTypeScopeAndBasename(const llvm::StringRef &name, llvm::StringRef &scope, llvm::StringRef &basename, lldb::TypeClass &type_class)
Definition: Type.cpp:665
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::TypeImpl::GetPointeeType
TypeImpl GetPointeeType() const
Definition: Type.cpp:958
lldb_private::TypeImpl::GetDereferencedType
TypeImpl GetDereferencedType() const
Definition: Type.cpp:994
lldb_private::Type::WriteToMemory
bool WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:464
lldb_private::TypeMemberImpl::TypeMemberImpl
TypeMemberImpl()
Definition: Type.h:342
lldb_private::TypeListImpl::AppendVisitor::m_type_list
TypeListImpl & m_type_list
Definition: Type.h:322
CompilerType.h
lldb_private::Type::ResolveState::Full
@ Full
lldb_private::TypeListImpl::AppendVisitor::operator()
void operator()(const lldb::TypeImplSP &type)
Definition: Type.h:319
UserID.h
lldb_private::Type::GetSymbolFile
const SymbolFile * GetSymbolFile() const
Definition: Type.h:128
lldb_private::Type::m_context
SymbolContextScope * m_context
The symbol context in which this type is defined.
Definition: Type.h:218
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
lldb_private::TypeMemberImpl::GetName
ConstString GetName() const
Definition: Type.h:362
lldb_private::Type::m_encoding_type
Type * m_encoding_type
Definition: Type.h:219
lldb_private::TypeImpl::GetName
ConstString GetName() const
Definition: Type.cpp:926
lldb-private.h
lldb_private::SymbolFileType::GetSymbolFile
SymbolFile & GetSymbolFile() const
Definition: Type.h:59
lldb_private::Type::GetEncodingMask
uint32_t GetEncodingMask()
Definition: Type.cpp:637
lldb_private::Type::eEncodingIsPointerUID
@ eEncodingIsPointerUID
This type is pointer to a type whose UID is m_encoding_uid.
Definition: Type.h:79
lldb_private::Type::GetDescription
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
Definition: Type.cpp:170
lldb_private::TypeEnumMemberListImpl::m_content
std::vector< lldb::TypeEnumMemberImplSP > m_content
Definition: Type.h:520
lldb_private::TypeMemberImpl::m_bitfield_bit_size
uint32_t m_bitfield_bit_size
Definition: Type.h:380
lldb_private::TypeListImpl::AppendVisitor
Definition: Type.h:315
lldb_private::CompilerContextKind
CompilerContextKind
Definition: lldb-private-enumerations.h:195
lldb_private::Type::m_encoding_uid
lldb::user_id_t m_encoding_uid
Definition: Type.h:220
lldb_private::Type::GetIsExternal
bool GetIsExternal() const
lldb_private::Type::SetIsExternal
void SetIsExternal(bool b)
lldb_private::TypeMemberImpl::GetIsBitfield
bool GetIsBitfield() const
Definition: Type.h:372
lldb_private::TypeEnumMemberImpl::m_integer_type_sp
lldb::TypeImplSP m_integer_type_sp
Definition: Type.h:494
lldb_private::Type::IsAggregateType
bool IsAggregateType()
Definition: Type.cpp:387
lldb_private::TypeImpl::GetUnqualifiedType
TypeImpl GetUnqualifiedType() const
Definition: Type.cpp:1006
lldb_private::TypeEnumMemberImpl::m_name
ConstString m_name
Definition: Type.h:495
lldb_private::Type::GetQualifiedName
ConstString GetQualifiedName()
Definition: Type.cpp:661
lldb_private::Type::ResolveState::Layout
@ Layout
lldb_private::TypeEnumMemberListImpl
Definition: Type.h:500
uint32_t
lldb_private::Type::Payload
uint32_t Payload
Definition: Type.h:208
lldb_private::Type::eEncodingIsLValueReferenceUID
@ eEncodingIsLValueReferenceUID
This type is L value reference to a type whose UID is m_encoding_uid.
Definition: Type.h:81
lldb_private::TypeMemberFunctionImpl::GetArgumentAtIndex
CompilerType GetArgumentAtIndex(size_t idx) const
Definition: Type.cpp:1123
lldb_private::TypeMemberFunctionImpl::GetReturnType
CompilerType GetReturnType() const
Definition: Type.cpp:1110
lldb_private::Type::IsTypedef
bool IsTypedef()
Definition: Type.h:140
lldb_private::TypeImpl::SetType
void SetType(const lldb::TypeSP &type_sp)
Definition: Type.cpp:828
lldb_private::Type::Compare
static int Compare(const Type &a, const Type &b)
lldb_private::TypeAndOrName::SetTypeSP
void SetTypeSP(lldb::TypeSP type_sp)
Definition: Type.cpp:778
lldb_private::TypeImpl::GetDescription
bool GetDescription(lldb_private::Stream &strm, lldb::DescriptionLevel description_level)
Definition: Type.cpp:1054
lldb_private::Type::ReadFromMemory
bool ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
Definition: Type.cpp:426
lldb_private::Type::SetEncodingType
void SetEncodingType(Type *encoding_type)
Definition: Type.h:204
lldb_private::TypeImpl::m_exe_module_wp
lldb::ModuleWP m_exe_module_wp
Definition: Type.h:304
lldb_private::Type::DumpValueInMemory
bool DumpValueInMemory(ExecutionContext *exe_ctx, Stream *s, lldb::addr_t address, AddressType address_type, bool show_types, bool show_summary, bool verbose)
Definition: Type.cpp:408
lldb_private::Type
Definition: Type.h:66
lldb_private::TypeAndOrName::operator!=
bool operator!=(const TypeAndOrName &other) const
Definition: Type.cpp:758
lldb_private::TypeImpl::GetCompilerType
CompilerType GetCompilerType(bool prefer_dynamic)
Definition: Type.cpp:1030
lldb_private::Type::GetForwardCompilerType
CompilerType GetForwardCompilerType()
Definition: Type.cpp:656
lldb_private::TypeListImpl::TypeListImpl
TypeListImpl()
Definition: Type.h:311
lldb_private::TypeListImpl::m_content
std::vector< lldb::TypeImplSP > m_content
Definition: Type.h:337
lldb_private::TypeAndOrName::operator==
bool operator==(const TypeAndOrName &other) const
Definition: Type.cpp:750
lldb_private::TypeImpl::Clear
void Clear()
Definition: Type.cpp:913
lldb_private::SymbolFileType::SymbolFileType
SymbolFileType(SymbolFile &symbol_file, lldb::user_id_t uid)
Definition: Type.h:49
lldb_private::TypeImpl::GetTypeSystem
TypeSystem * GetTypeSystem(bool prefer_dynamic)
Definition: Type.cpp:1042
lldb::Encoding
Encoding
Register encoding definitions.
Definition: lldb-enumerations.h:146
lldb_private::TypeImpl::~TypeImpl
~TypeImpl()=default
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb_private::TypeMemberFunctionImpl::GetNumArguments
size_t GetNumArguments() const
Definition: Type.cpp:1116
lldb_private::TypeMemberImpl::m_name
ConstString m_name
Definition: Type.h:379
lldb_private::Type::m_decl
Declaration m_decl
Definition: Type.h:224
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::TypeListImpl::AppendVisitor::AppendVisitor
AppendVisitor(TypeListImpl &type_list)
Definition: Type.h:317
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::Type::ResolveState::Forward
@ Forward
lldb_private::TypeImpl
Definition: Type.h:238
lldb_private::CompilerContext::kind
CompilerContextKind kind
Definition: Type.h:37
lldb_private::TypeImpl::GetPointerType
TypeImpl GetPointerType() const
Definition: Type.cpp:946
lldb_private::TypeAndOrName::HasType
bool HasType() const
Definition: Type.h:424
lldb_private::TypeSystem
Interface for representing a type system.
Definition: TypeSystem.h:71
lldb_private::TypeList
Definition: TypeList.h:20
lldb_private::TypeImpl::GetTypedefedType
TypeImpl GetTypedefedType() const
Definition: Type.cpp:982
ConstString.h
lldb_private::TypeAndOrName::TypeAndOrName
TypeAndOrName()=default
lldb::MemberFunctionKind
MemberFunctionKind
Kind of member function.
Definition: lldb-enumerations.h:1020
lldb_private::TypeEnumMemberImpl::operator=
TypeEnumMemberImpl & operator=(const TypeEnumMemberImpl &rhs)
lldb_private::TypeEnumMemberListImpl::Append
void Append(const lldb::TypeEnumMemberImplSP &type)
Definition: Type.h:504
lldb_private::TypeEnumMemberListImpl::GetSize
size_t GetSize()
Definition: Type.h:517
lldb_private::TypeMemberImpl::m_is_bitfield
bool m_is_bitfield
Definition: Type.h:381
lldb_private::TypeImpl::GetReferenceType
TypeImpl GetReferenceType() const
Definition: Type.cpp:970
lldb_private::SymbolFileType::m_symbol_file
SymbolFile & m_symbol_file
Definition: Type.h:62
lldb_private::TypeImpl::m_module_wp
lldb::ModuleWP m_module_wp
Definition: Type.h:303
lldb_private::Type::m_name
ConstString m_name
Definition: Type.h:215
lldb_private::TypeMemberFunctionImpl::IsValid
bool IsValid()
Definition: Type.cpp:1070
lldb_private::Type::eEncodingIsAtomicUID
@ eEncodingIsAtomicUID
This type is the type whose UID is m_encoding_uid as an atomic type.
Definition: Type.h:85
lldb_private::TypeListImpl::GetTypeAtIndex
lldb::TypeImplSP GetTypeAtIndex(size_t idx)
Definition: Type.h:327
lldb_private::TypeMemberImpl::GetBitOffset
uint64_t GetBitOffset() const
Definition: Type.h:364
lldb_private::TypeAndOrName
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition: Type.h:394
lldb_private::TypeMemberFunctionImpl
Definition: Type.h:435
lldb_private::TypeMemberFunctionImpl::TypeMemberFunctionImpl
TypeMemberFunctionImpl(const CompilerType &type, const CompilerDecl &decl, const std::string &name, const lldb::MemberFunctionKind &kind)
Definition: Type.h:439
lldb_private::TypeImpl::CheckExeModule
bool CheckExeModule(lldb::ModuleSP &module_sp) const
Definition: Type.cpp:861
lldb_private::SymbolFileType::~SymbolFileType
~SymbolFileType()=default
lldb_private::TypeMemberImpl::SetIsBitfield
void SetIsBitfield(bool is_bitfield)
Definition: Type.h:374
lldb_private::TypeAndOrName::m_type_name
ConstString m_type_name
Definition: Type.h:432
lldb_private::TypeMemberFunctionImpl::GetDescription
bool GetDescription(Stream &stream)
Definition: Type.cpp:1086
lldb_private::Declaration
Definition: Declaration.h:24
lldb_private::Type::m_byte_size
uint64_t m_byte_size
Definition: Type.h:222
lldb_private::Type::GetSymbolContextScope
SymbolContextScope * GetSymbolContextScope()
Definition: Type.h:175
lldb_private::TypeImpl::operator!=
bool operator!=(const TypeImpl &rhs) const
Definition: Type.cpp:899
lldb_private::Type::m_compiler_type
CompilerType m_compiler_type
Definition: Type.h:225
lldb_private::Type::GetFullCompilerType
CompilerType GetFullCompilerType()
Definition: Type.cpp:646
lldb_private::CompilerContext::CompilerContext
CompilerContext(CompilerContextKind t, ConstString n)
Definition: Type.h:28
lldb_private::TypeEnumMemberImpl::TypeEnumMemberImpl
TypeEnumMemberImpl()
Definition: Type.h:474
lldb::eFormatDefault
@ eFormatDefault
Definition: lldb-enumerations.h:156
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::Type::eEncodingIsUID
@ eEncodingIsUID
This type is the type whose UID is m_encoding_uid.
Definition: Type.h:70
lldb_private::TypeAndOrName::m_compiler_type
CompilerType m_compiler_type
Definition: Type.h:431
lldb_private::TypeListImpl
Definition: Type.h:309
lldb_private::TypeImpl::m_static_type
CompilerType m_static_type
Definition: Type.h:305
lldb_private::TypeEnumMemberImpl::GetName
ConstString GetName() const
Definition: Type.h:485
lldb_private::Type::GetNumChildren
uint32_t GetNumChildren(bool omit_empty_base_classes)
Definition: Type.cpp:383